Skip to content

millikanjames/R-Files

Repository files navigation

R-Files

R Files to accompany Statistical Reasoning in Sports by Tabor and Franklin plus a Precalculus sinusoidal modeling project.

In this folder I have included:

An R script for making basic plots in R (pie charts, bar charts, segmented bar charts, and dotplots).

Chapter 1 simulation script - A modifiable R script for performing categorical simulations. Currently the script is set to perform 100 simulations of LeBron James's 2008 playoff performance. By adjusting the true ability, the number of attempts, and the number of desired simulations, you can quickly recreate the simulations done in the first chapter of the Tabor and Franklin text. The script displays the results of the simulation as a dotplot. I have annotated the script to explain how it works.

Chapter 2 simulation script - A modifiable R script for performing simulations to compare two proportions. The script currently tests the hypothesis that the 2004-2008 Arizona Cardinals had a greater ability to win at home than on the road.

An Excel file that simulates Steph Curry's three point shooting ability. This uses the same methods used in the R Script. The Excel file, like the R Script, can be easily modified to simulate outcomes of any categorical variable—just change the true ability intervals and fill the columns down until you have the number of desired attempts. The random numbers in the Excel sheet change continually, making it possible to generate as many simulations as you need. It's definitely slower than the R script, so you might want to build a Macro if you are simulating more than 50 performances or so. Performing a few simulations in the spreadsheet is a good way to give students insight into what's going on "under the hood' before moving on to R.

An R file for calculating a simple OLS regression using a bit of linear algebra.

An R file for calculating multiple regression correlation and R-Square coefficients using linear algebra.

Bonus: Honors Precalculus Project and R script for climate models for Alaska's Yukon-Kuskakwim Delta. You can read about the effects of the warming here: https://www.theguardian.com/environment/interactive/2013/may/13/newtok-alaska-climate-change-refugees. Send me an email at jmillikan@jesuits.org if you need the solutions to the project.

About

R files to accompany Statistical Reasoning in Sports by Tabor and Franklin and climate modeling project for Honors Precalculus

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages