Introduction to Statistics (MAT/SST 115.03 2008S)

R notes for Activity 9-6: Marriage Ages


The data for this exercises are stored in MarriageAges.csv.

MarriageAges = read.csv("/home/rebelsky/Stats115/Data/MarriageAges.csv")

The column names in the frame are Couple, HusbandAge, WifeAge, and Difference. We might, for example, compute the median husband age with

median(MarriageAges$HusbandAge)

You may once again find it useful to ask for summaries of the different variables.

summary(MarriageAges$HusbandAge)

We can get summaries of all the variables with

summary(MarriageAges)

The problem also asks you to compute standard deviations and interquartile ranges. You use the sd to compute standard deviations. You use the IQR function to compute interquartile ranges.

sd(MarriageAges$HusbandAge)
IQR(MarriageAges$HusbandAge)

Creative Commons License

Samuel A. Rebelsky, rebelsky@grinnell.edu

Copyright (c) 2007-8 Samuel A. Rebelsky.

This work is licensed under a Creative Commons Attribution-NonCommercial 2.5 License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/2.5/ or send a letter to Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, 94105, USA.