Chapter 5

Summarizing It All

IN THIS CHAPTER

Bullet Working with things great and small

Bullet Understanding symmetry, peaks, and plateaus

Bullet Getting descriptive

The measures of central tendency and variability I discuss in previous chapters aren’t the only ways to summarize a set of scores. These measures are a subset of descriptive statistics. Some descriptive statistics — like maximum, minimum, and range — are easy to understand. Some — like skewness and kurtosis — are not.

This chapter covers descriptive statistics, and shows you how to calculate them in R.

How Many?

Perhaps the fundamental descriptive statistic is the number of scores in a set of data. In previous chapters, I work with length(), the R function that calculates this number. As in those chapters, I work with the Cars93 data frame, which is in the MASS package. (If it’s unchecked, select the check box next to MASS on the Packages tab.)

Cars93 holds data on 27 variables for 93 cars available in 1993. What happens when I apply length() to the data frame?

> length(Cars93)[1] 27

So length() returns the number of variables in the data frame. The function ncol() does the same thing:

> ncol(Cars93)[1] 27

I already know the number ...

Get R All-in-One For Dummies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.