Textbook Data for Math 245
You can access case study and exercise data from the textbook using the R package Sleuth3. This package should be installed on lab computers in CMC but you will need to install the package on your personal computer (and possibly on computers outside the CMC). To do this click the Packages tab in Rstudio and select Install. Type Sleuth3 in the packages name field and select Install. (Alternatively, run the command install.packages("Sleuth3").) You will only need to install the package once on your personal computer.
To access a data set run the command:
in the Console window. Also include this command at the start of any Markdown document that uses textbook data. The data set names are of the form type, chapter and number, e.g. case0701 or ex0721
> head(case0701)
Velocity Distance
1 170 0.03
2 290 0.03
3 -130 0.21
4 -70 0.26
5 -185 0.28
6 -220 0.28
Additional Data for Math 245:
Additional class data is located both on Collab (Departments/MATH/MATH-Shared/StClair/Math_245/data) and online. You can access online with its URL:
> agstrat <- read.csv("http://people.carleton.edu/~kstclair/data/agstrat.csv")
> names(agstrat)
[1] "county" "state" "acres92" "acres87" "acres82" "farms92"
[7] "farms87" "farms82" "largef92" "largef87" "largef82" "smallf92"
[13] "smallf87" "smallf82" "region" "rn" "weight"
To get the url address used above, simply right click on the agstrat.csv link and copy the link address. All other data sets will follow a similar url path as the one above, just using a different data set name.
You can also access data using the Collab file path. The exact file path depends on whether you use a mac or pc. A better option than using the Collab file path is to simply copy the data folder from the class Collab folder to your Math245 folder. Then from your Math245 working directory, or any .Rmd file located in this directory, you read the data using a relative file path:
> agstrat <- read.csv("data/agstrat.csv")
- Chapters 1,2: Agricultural Survey data agstrat.csv
- Chapter 7: Woodpecker nesting data woodpeckers.csv. Data from the study described in Artificial Trees as a Cavity Substrate for Woodpeckers, The Journal of Wildlife Management (1983).
- Chapter 8: Drug offenders sentences DrugOffenses2.csv. Data on 24,011 individuals convicted on federal drug charges during 2013-14. This data comes from the US Sentencing Commission.
- Chapter 8: Car stats from 2004 cars2004.csv. Data on 230 car makes and models from 2004.
- Chapter 8: 2005 Residential Energy Survey EnergySurvey.csv. RECS is a survey of US households that assesses energy use. The 2005 data has a random sample of 4,382 households.
- Homework 3: PCB water pollution data. Pcb.csv Contain PCB measurements (ppm) for a sample of 37 bodies of water in 1984 and 1985.
- Chapter 9: Music and math test scores data. MusicEducation.csv
- Homework 4: Gender stereotypes and intellect. StereoTypeStudy34.csv Combined data with demographics from the 2017 Science article: Gender stereotypes about intellectual ability emerge early and influence children’s interests.
- Chapter 11: Animal sleep sleep.csv. Data on sleep habits of 62 mammals.
- Chapter 12: Collinearity simulation data 1 sim1.csv.
- Chapter 12: Collinearity simulation data 2 sim2.csv.
- Chapter 20: BWCAW July 4, 1999 blowdown data blowBF.csv. This data set contains survival records for 659 balsam fir trees surveyed after the storm. Link to NOAA info about the storm.
- Chapter 21: Challenger data challenger.csv.
- Chapter 21: SAV rake data RakeData.csv. Quasibinomial example data that models the probability SAV is detected using a long-handled rake.
- Chapter 21: Franken election recount data recount.csv. The 2008 MN senate race recount county-level results between Al Franken (Dem) and Norm Coleman (Rep).
- Chapter 22: Possum habitat data possums.csv. Data collected from a sample of \(n = 151\) 3-hectare sites in Australia. Goal is to determine which factors are associated with good habitat for possums.
- Chapter 22: Math 215 survey data Survey.csv.
- Report 3: NES survey data from 1980 and 2000 NES.csv.