Question: Complete the code chunk below to generate 10,000 permutated data sets and compare the social mobility scores of highly selective public colleges with those of

Complete the code chunk below to generate 10,000 permutated data sets and compare the social mobility scores of highly selective public colleges with those of highly selective private schools in each of them, then create a distribution of the sample statistics. Complete the lines of code that say # COMPLETE after them. ```{r} set.seed(1) P = 10000 store_median_diff = rep(0, P) for (n in 1:P){ school.perm = school school.perm$mobility_rate = # COMPLETE school.perm.prv = # COMPLETE - for private schools school.perm.pub = # COMPLETE - for public schools store_median_diff[n] = # COMPLETE } hist(store_median_diff, breaks = 20, freq = FALSE, col = 'black', border = 'white', xlab = 'Median Diff of Social Mobility Scores', main = 'Histogram of Social Mobility Score Diff (Permuted Data)')

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock