Code Studio: Describe a Variable (psych)
Practice: Statistical Summary asks for psych::describe, which is now available. It gives many summary statistics at once.
The program reads the name of a column of the built-in swiss dataset.
- Run
describe()on that column. - Keep only the columns
n,mean,sd,median,skewandkurtosis. - Round them to 2 decimal places and print the result.
Hint: describe() returns a data frame, so you can select columns with d[, c("n", "mean")].
Compare the skew of Catholic with that of Examination. What does the histogram of each probably look like?
Practice: Statistical Summary asks for psych::describe, which is now available. It gives many summary statistics at once.
The program reads the name of a column of the built-in swiss dataset.
- Run
describe()on that column. - Keep only the columns
n,mean,sd,median,skewandkurtosis. - Round them to 2 decimal places and print the result.
Hint: describe() returns a data frame, so you can select columns with d[, c("n", "mean")].
Compare the skew of Catholic with that of Examination. What does the histogram of each probably look like?