Summary Statistics of Data Frame in R (4 Examples) | Calculate Descriptive Metrics | Mean, Max & Sum

Statistics Globe
Statistics Globe
939 بار بازدید - 2 سال پیش - How to calculate summary statistics
How to calculate summary statistics for the columns of a data frame in the R programming language. More details: https://statisticsglobe.com/summary-s...
R code of this video:

set.seed(926436)                 # Create example data frame
data <- data.frame(x1 = rnorm(100),
                  x2 = runif(100),
                  x3 = LETTERS[1:4])

mean(data$x1)                    # Calculate mean of one column

max(data$x1)                     # Calculate maximum of one column

sum(data$x1)                     # Calculate sum of one column

apply(data, 2, max)              # Calculate maxima of all columns

summary(data)                    # Calculate summary statistics table

aggregate(x1 ~ x3, data, var)    # Calculate variance by group

Follow me on Social Media:
Facebook – Statistics Globe Page: Facebook: statisticsglobecom
Facebook – R Programming Group for Discussions & Questions: Facebook: statisticsglobe
Facebook – Python Programming Group for Discussions & Questions: Facebook: statisticsglobepython
LinkedIn – Statistics Globe Page: LinkedIn: statisticsglobe
LinkedIn – R Programming Group for Discussions & Questions: LinkedIn: 12555223
LinkedIn – Python Programming Group for Discussions & Questions: LinkedIn: 12673534
Twitter: Twitter: JoachimSchork

Music by bensound.com
2 سال پیش در تاریخ 1401/07/16 منتشر شده است.
939 بـار بازدید شده
... بیشتر