Skip to main content

Statistics for Comparing Means and Proportions

  • Chapter
  • First Online:
Behavioral Research Data Analysis with R

Part of the book series: Use R! ((USE R))

  • 6950 Accesses

Abstract

This chapter covers methods to compare means across groups of study participants. Means can be the averages of continuous variables, e.g., hours of sleep when a drug is given or proportions of dichotomous variables, e.g., the proportions of students accepted by college admission. Nonparametric methods may be appropriate if the distribution of a continuous variable is skewed. In this case the nonparametric test (e.g., wilcox.test()) may be more appropriate than parametric test (e.g., t.test()). Comparisons of proportions can be made by prop.test() or chisq.test(). If the sample size is small, fisher.test() is more appropriate than chisq.test(). More generally, loglinear modeling using loglin() can address mutliway contingency tables. We use loglin() to test a mediation effect.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 64.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 84.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Wickens used the term ‘mediated’ but we believe “moderated” is a better fit because mediation relationships typically imply temporal causation which is not available in this example. Either way, it is really about the conditional independence hypothesis in a 3-way contingency table.

  2. 2.

    Fisher’s test is versatile; fisher.test() is not limited to 2 ×2 tables, it can handle tables more complex than a 2 ×2 table.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Yuelin Li .

Rights and permissions

Reprints and permissions

Copyright information

© 2012 Springer Science+Business Media, LLC

About this chapter

Cite this chapter

Li, Y., Baron, J. (2012). Statistics for Comparing Means and Proportions. In: Behavioral Research Data Analysis with R. Use R!. Springer, New York, NY. https://doi.org/10.1007/978-1-4614-1238-0_3

Download citation

Publish with us

Policies and ethics