Introduction to R Session 6: More loops, control structures, and bootstrapping Download the dataset, from the course website, and read it into your R lawschool session. This dataset is a random sample of 15 law schools, taken from a collection of 82 participating law schools in a large study of admission practices. Two measurements were made on the entering classes of each school: LSAT, the average score for the class on a national law test, and GPA, the average undergraduate grade-point average for the class. We will estimate the correlation of and and obtain a 95% confidence LSAT GPA, interval for this correlation. Illustrate the relationship of and using a plot (or plots) of your choice. LSAT GPA Calculate the correlation of and with the LSAT GPA cor()function. Bootstrap the correlation of and using a LSAT GPA repeat()or while() loop. Start with 50 bootstrap replicates, and then try using 200, 800, and 3200 bootstrap replicates. Keep the output from all four versions. In one graphical window, plot histograms of the bootstrap correlation values for the four bootstrap replicate sizes considered in the previous question (50, 200, 800, and 3,200 replicates). Also calculate the standard deviation of the correlation of and for each of the bootstrap replicate sizes. LSAT GPA Calculate a 95% confidence interval for the correlation of and using LSAT GPA the bootstrap quantiles with 3,200 bootstrap replicates.
Introduction to R Session 6: More loops, control structures, and bootstrapping Download the lawschool dataset, from the course website, and read it into your R session. This dataset is a random sample of 15 law schools, taken from a collection of 82 participating law schools in a large study of admission practices. Two measurements were made on the entering classes of each school: LSAT, the average score for the class on a national law test, and GPA, the average undergraduate grade-point average for the class. We will estimate the correlation of LSAT and GPA, and obtain a 95% confidence interval for this correlation. Illustrate the relationship of LSAT and GPA using a plot (or plots) of your choice. Calculate the correlation of LSAT and GPA with the cor()function. Bootstrap the correlation of LSAT and GPA using a repeat()or while() loop. Start with 50 bootstrap replicates, and then try using 200, 800, and 3200 bootstrap replicates. Keep the output from all four versions. In one graphical window, plot histograms of the bootstrap correlation values for the four bootstrap replicate sizes considered in the previous question (50, 200, 800, and 3,200 replicates). Also calculate the standard deviation of the correlation of LSAT and GPA for each of the bootstrap replicate sizes. Calculate a 95% confidence interval for the correlation of LSAT and GPA using the bootstrap quantiles with 3,200 bootstrap replicates.
rintro18-ex06.docx