Chapter 7. Basic statistics

 

This chapter covers

  • Descriptive statistics
  • Frequency and contingency tables
  • Correlations and covariances
  • t-tests
  • Nonparametric statistics

In previous chapters, you learned how to import data into R and use a variety of functions to organize and transform the data into a useful format. We then reviewed basic methods for visualizing data.

Once your data is properly organized and you’ve begun to explore the data visually, the next step will typically be to describe the distribution of each variable numerically, followed by an exploration of the relationships among selected variables two at a time. The goal is to answer questions like these:

  • What kind of mileage are cars getting these days? Specifically, what’s the distribution of miles per gallon (mean, standard deviation, median, range, etc.) in a survey of automobile makes?
  • After a new drug trial, what’s the outcome (no improvement, some improvement, marked improvement) for drug versus placebo groups? Does the gender of the participants have an impact on the outcome?
  • What’s the correlation between income and life expectancy? Is it significantly different from zero?
  • Are you more likely to receive imprisonment for a crime in different regions of the United States? Are the differences between regions statistically significant?

7.1. Descriptive statistics

7.2. Frequency and contingency tables

7.3. Correlations

7.4. t-tests

7.5. Nonparametric tests of group differences

7.6. Visualizing group differences

7.7. Summary

sitemap