Course Outline

list full book

Book
  • full book
  • second book

10.2 Using Bootstrapping to Construct a Confidence Interval

By now you should have a sense of what a sampling distribution is, and some intuition as to why we need sampling distributions to construct confidence intervals. Most of our ideas about sampling distributions have been developed through simulations. Although simulations help us to understand how all this works, they may not be as practical in a data analysis situation.

Simulations require us to make some assumptions about the DGP. For example, we have assumed in previous sections that the population distribution is normal in shape, and that it has a particular standard deviation, which we have estimated from our sample. We generated sampling distributions based on these assumptions. But not all DGPs are normal, so there are going to be plenty of situations where we don’t want to make this assumption.

The rise of cheap and fast computers has made popular an alternative approach to creating sampling distributions. This approach is called resampling, or bootstrapping. One cool thing about resampling techniques is that they use only the data you collect in your sample. So, unlike simulation, they don’t require you to make up anything else.

How Bootstrapping Works

We have already used the resample() function in R. We used it previously to create a sampling distribution of the means of samples of 24 die rolls. We created a vector with the numbers 1 to 6, then rigged up a DGP in which each number had an equal chance of being resampled.

Bootstrapping works the same way, but instead of making up the distribution to sample from, we resample from the actual data we have collected. Let’s start by explaining the process using our TinyFingers data set of six thumb lengths. Then we will apply the same techniques to our actual sample of 157 thumb lengths.

Here are the six thumb lengths from the TinyFingers data set again:

TinyFingers$Thumb
[1] 56 60 61 63 64 68

Let’s start by reviewing what the resample() command does.

resample(TinyFingers$Thumb, 6)

Here is the output of this command.

[1] 60 60 63 56 61 61

What resample() does here is take a new random sample of six observations from our data set of six observations. It samples with replacement, meaning that when it samples the first number, it then puts it back so it can be sampled again.

You can see that all of the numbers in the resampled data came from the original data set. But, some of the numbers in the original data were not selected (e.g. 68), while others (e.g. 60) were selected twice. It’s a random process, meaning each number has an equal chance of being selected each time a number is selected.

Bootstrapping a Sampling Distribution from our Fingers Data Set

Let’s now use resample() to bootstrap a sampling distribution of means we can use to help us interpret the mean thumb length we observed in our sample of 157 students.

Let’s start by creating just five bootstrapped sample means by running this code. We’ll save the bootstrapped means in a new data frame called bootSDoM. Note that all of the five means are based on our original data points.

packages <- c("mosaic", "Lock5withR", "Lock5Data", "supernova", "ggformula", "okcupiddata") lapply(packages, library, character.only = T) custom_seed(31) # This selects a bootstrapped sample and calculates the mean 5 times. # These 5 means are saved in bootSDoM. bootSDoM <- do(5) * mean(resample(Fingers$Thumb, 157)) # This prints bootSDoM. bootSDoM # This selects a bootstrapped sample and calculates the mean 5 times. # These 5 means are saved in bootSDoM. bootSDoM <- do(5) * mean(resample(Fingers$Thumb, 157)) # This prints bootSDoM. bootSDoM ex() %>% { check_output_expr(., "bootSDoM") check_object(., "bootSDoM") %>% check_equal() }
Just click Run
DataCamp: ch10-5

Modify the code now to create a sampling distribution of 1,000 means, then plot the means of this bootstrapped sampling distribution as a histogram.

packages <- c("mosaic", "Lock5withR", "Lock5Data", "supernova", "ggformula", "okcupiddata") lapply(packages, library, character.only = T) custom_seed(31) # Modify to bootstrap 1000 means. bootSDoM <- do(5) * mean(resample(Fingers$Thumb, 157)) # Make a histogram of these bootstrapped means. # Modify to bootstrap 1000 means. bootSDoM <- do(1000) * mean(resample(Fingers$Thumb, 157)) # Make a histogram of these bootstrapped means gf_histogram(~ mean, data = bootSDoM, fill = "darkblue") %>% gf_labs(title = "Bootstrapped Sampling Distribution of Means (n = 157)") ex() %>% check_object("bootSDoM") %>% check_equal() ex() %>% check_or( check_function(., "gf_histogram") %>% { check_arg(., "object") %>% check_equal() }, override_solution(., "gf_histogram(bootSDoM, ~mean)") %>% check_function(., "gf_histogram") %>% { check_arg(., "object") %>% check_equal() check_arg(., "gformula") %>% check_equal() }, override_solution(., "gf_histogram(~bootSDoM$mean)") %>% check_function("gf_histogram") %>% check_arg("object") %>% check_equal() )
Don't forget to update the `do()` function!
DataCamp: ch10-6

Comparing the Bootstrapped Sampling Distribution with the Simulated Sampling Distribution

The histogram of our bootstrapped distribution of 1,000 means certainly looks like a sampling distribution. It’s normal in shape, and is centered on our observed sample mean of 60.1. This makes sense given that all the numbers sampled to go into these means came from our sample with a mean of 60.1.

Let’s compare this bootstrapped distribution to a simulated distribution of 1,000 means centered on the same mean and based on estimates derived from the same sample of 157 students: a mean of 60.1 (Thumb.stats$mean) and a standard deviation of 8.73 (Thumb.stats$sd). Save the resulting sampling distribution in a data frame called simSDoM. (You have done this before; we are just asking you to do it again.)

packages <- c("mosaic", "Lock5withR", "Lock5Data", "supernova", "ggformula", "okcupiddata") lapply(packages, library, character.only = T) custom_seed(31) Thumb.stats <- favstats(~ Thumb, data = Fingers) # This generates and plots a sampling distribution of 1000 bootstrapped means. bootSDoM <- do(1000) * mean(resample(Fingers$Thumb, 157)) gf_histogram(~ mean, data = bootSDoM, fill = "darkblue") %>% gf_labs(title = "Bootstrapped Sampling Distribution of Means (n = 157)") # Modify this code to generate and plot a sampling distribution of 1000 simulated means. simSDoM <- gf_histogram(~ mean, data = simSDoM, fill = "blue") %>% gf_labs(title = "Simulated Sampling Distribution of Means (n = 157)") # This generates and plots a sampling distribution of 1000 bootstrapped means. bootSDoM <- do(1000) * mean(resample(Fingers$Thumb, 157)) gf_histogram(~ mean, data = bootSDoM, fill = "darkblue") %>% gf_labs(title = "Bootstrapped Sampling Distribution of Means (n = 157)") # Modify this code to generate and plot a sampling distribution of 1000 simulated means. simSDoM <- do(1000) * mean(rnorm(157, mean = Thumb.stats$mean, sd = Thumb.stats$sd)) gf_histogram(~ mean, data = simSDoM, fill = "blue") %>% gf_labs(title = "Simulated Sampling Distribution of Means (n = 157)") ex() %>% { check_function(., "rnorm") %>% { check_arg(., "n") %>% check_equal() check_arg(., "mean") %>% check_equal() check_arg(., "sd") %>% check_equal() } check_code(., "do\\(1000\\) ?\\* ?mean\\(rnorm") } ex() %>% check_or( check_function(., "gf_histogram", index = 2) %>% { check_arg(., "object") %>% check_equal() check_arg(., "data") %>% check_equal() }, override_solution(., "gf_histogram(1:3); gf_histogram(simSDoM, ~mean)") %>% check_function(., "gf_histogram", index = 2) %>% { check_arg(., "object") %>% check_equal() check_arg(., "gformula") %>% check_equal() }, override_solution(., "gf_histogram(1:3); gf_histogram(~simSDoM$mean)") %>% check_function("gf_histogram", index = 2) %>% check_arg("object") %>% check_equal() ) success_msg("Great thinking!")
Think about the difference between a sampling difference of bootstrapped means and a sampling distribution of simulated means.What function could you use to simulate a distribution?
DataCamp: ch10-7

Now compare the two sampling distributions of means of samples of n=157. On the left is our bootstrapped sampling distribution. On the right is the simulated sampling distribution.

A histogram of the distribution of the variable mean in the data frame bootSDoM on the left. A histogram of the distribution of the variable mean in the data frame simSDoM on the right. These two distributions look roughly similar in shape, center, and spread.

Go ahead and get the favstats() for Fingers$Thumb (the original variable with 157 thumb lengths), bootSDoM$mean, and simSDoM$mean.

packages <- c("mosaic", "Lock5withR", "Lock5Data", "supernova", "ggformula", "okcupiddata") lapply(packages, library, character.only = T) RBackend::custom_seed(31) Thumb.stats <- favstats(~ Thumb, data = Fingers) bootSDoM <- data.frame(mean = list( c(61.0020063694268,61.0147770700637,59.3556050955414,59.4213375796178,59.5877070063694,59.5794267515924,60.881178343949,59.3518789808917,58.7692356687898,59.2991719745223,59.261974522293,58.5667197452229,58.7577707006369,60.3584076433121,59.5166878980892,59.7835668789809,60.2649681528662,60.190796178344,60.2551592356688,58.6678025477707,60.0283121019108,60.4431847133758,60.561974522293,60.9227707006369,59.8675477707006,60.5073885350319,59.7288853503185,59.8583439490446,60.5559872611465,60.1817515923567,59.9006050955414,60.7224840764331,59.3931847133758,59.6908598726115,60.3463694267516,59.5552866242038,61.0134076433121,60.2412420382166,60.6310191082803,59.0171656050955,59.8913375796178,60.6028662420382,59.9125159235669,61.0462738853503,60.1015286624204,60.1912738853503,59.6527388535032,59.9388853503185,59.0318152866242,60.0586942675159,58.6305732484076,60.9182165605096,59.9859872611465,60.160796178344,61.0479299363057,60.3269108280255,60.2718789808917,60.3868152866242,61.0549044585987,59.9144904458599,59.6427070063694,59.743949044586,60.0247770700637,59.0194904458599,59.7881847133758,58.9855414012739,60.4451592356688,60.2363694267516,58.4535031847134,60.8078025477707,60.8949681528662,60.745796178344,60.2380891719745,60.4352547770701,60.4199044585987,59.7881210191083,60.5373566878981,58.4365286624204,59.6831847133758,60.2950636942675,60.8923248407643,59.184203821656,60.078152866242,59.850127388535,61.8756369426752,60.3116878980892,60.191050955414,60.607898089172,60.5977388535032,60.7529936305733,60.168152866242,60.5856369426752,59.7264331210191,60.7035668789809,60.2846815286624,58.4640127388535,60.7056050955414,60.5424840764331,61.3418789808917,60.5924522292994,60.2901592356688,61.1482802547771,59.8722929936306,59.9935668789809,60.3107961783439,59.846974522293,60.0866878980892,59.5413694267516,61.1490127388535,59.9484713375796,59.7722929936306,60.1707324840764,59.4850318471338,59.7022292993631,60.0282165605096,59.2028025477707,59.9106369426752,60.6444585987261,60.7520700636943,60.3702547770701,60.5849681528662,60.0957324840764,58.9313694267516,60.7392356687898,60.726050955414,60.2635668789809,59.5965605095541,60.1914649681529,59.3333757961783,58.1182484076433,60.601974522293,58.9444904458599,59.1149681528662,59.6750318471338,59.8292993630573,59.7839808917197,60.3870063694268,59.1917197452229,60.0186942675159,59.9595859872611,60.9529617834395,59.9596815286624,60.2205732484076,59.0217515923567,60.3700955414013,61.3917834394904,60.5620700636943,60.7003503184713,58.7424203821656,60.3724203821656,60.5645859872611,60.6020063694268,60.4578343949045,59.9199044585987,60.1814649681529,58.9360191082803,60.3632165605096,60.4492993630573,60.3638535031847,60.9569108280255,60.5435031847134,59.6505095541401,59.1698089171975,59.5056050955414,60.1450318471338,60.3533757961783,60.093025477707,60.5575796178344,60.2490445859873,60.0797452229299,59.7629617834395,59.910127388535,60.6206050955414,59.3897770700637,61.3440127388535,60.1224840764331,60.8052547770701,60.0979617834395,60.4945541401274,59.2866878980892,59.9606050955414,59.7955732484076,60.4507324840764,60.0562738853503,60.8179617834395,59.5063375796178,58.730923566879,58.5345859872611,60.3827388535032,59.4966878980892,58.9622611464968,60.4847770700637,61.2259554140127,59.9905095541401,60.9279617834395,60.141178343949,60.2501910828025,59.5736624203822,59.9447133757962,59.5702229299363), c(59.626050955414,60.6979617834395,60.5515605095541,60.7474203821656,60.3567515923567,60.86,60.3896815286624,59.1646496815287,60.1069426751592,61.005923566879,59.7933439490446,59.1877388535032,60.7342038216561,60.4812420382166,59.4789808917197,61.258025477707,60.3203821656051,59.902101910828,60.4777070063694,59.941847133758,60.378821656051,60.2780891719745,60.1727388535032,62.2073248407643,58.6756050955414,59.4602866242038,59.4675159235669,60.7385987261147,60.2567515923567,59.649872611465,59.9802547770701,60.5514012738854,59.6092675159236,58.9612420382166,59.4956050955414,60.0503184713376,60.6807643312102,59.6449363057325,58.8077707006369,60.4085031847134,60.8815286624204,58.9206687898089,58.4188535031847,60.053152866242,59.8078343949045,60.4247770700637,59.3932802547771,60.4764331210191,60.5965605095541,60.7267197452229,59.1676433121019,60.0707643312102,59.8945541401274,59.0871337579618,60.4038535031847,59.7632484076433,59.0606050955414,59.6276114649682,60.5886624203822,60.0386624203822,59.7858598726115,59.2321337579618,60.6176114649681,60.2924522292994,60.1144267515924,59.71,62.1438853503185,61.2416242038217,59.9547133757962,58.4540127388535,59.1574203821656,58.7834394904459,58.9857006369427,59.6249044585987,60.2435350318471,59.5279299363057,59.6875796178344,59.4290445859873,59.9630891719745,59.7571974522293,59.8325159235669,60.6326751592357,60.3754140127389,60.4561464968153,60.0614649681529,60.2735350318471,60.1684076433121,60.380127388535,60.3058280254777,59.8476114649682,59.716847133758,60.7446496815287,61.4364331210191,59.358949044586,60.4370063694268,59.0200955414013,60.2910828025478,60.3982484076433,60.0766242038217,59.8057324840764,59.9637261146497,58.1924522292994,59.2070063694268,60.3434713375796,59.8607643312102,59.3537898089172,59.9544267515924,59.8222611464968,59.2460191082803,59.0587898089172,59.5818152866242,60.6557961783439,60.4595541401274,60.4052866242038,60.663152866242,59.7303184713376,60.614203821656,60.1999044585987,59.7442675159236,60.3945859872611,60.265127388535,60.056974522293,60.9645859872611,60.1981847133758,59.7733121019108,60.4239171974522,59.3639171974522,59.4753184713376,61.9625159235669,60.7666242038217,59.7999681528662,59.0453184713376,59.3503503184713,60.552898089172,60.0322929936306,60.6771974522293,60.0953184713376,60.0986305732484,59.0823248407643,60.9681210191083,60.36,59.665923566879,59.6033439490446,60.4471337579618,59.9064649681529,59.6996178343949,59.9347452229299,61.8200636942675,60.4672292993631,60.0672292993631,59.4928025477707,60.9420063694267,59.8218789808917,59.908152866242,60.2936624203822,59.2133121019108,60.557101910828,60.3145222929936,60.7654458598726,58.1563057324841,60.7208598726115,59.6152866242038,60.0646815286624,61.1518789808917,59.2687579617834,59.9259872611465,60.2022611464968,58.9238853503185,59.8892675159236,59.8322292993631,59.4727388535032,60.9275477707006,60.3474840764331,60.1209872611465,60.446974522293,59.8523248407643,59.891974522293,58.8847770700637,59.7015286624204,59.8407006369427,59.8292993630573,59.6435350318471,59.9993630573248,60.1252229299363,60.1797770700637,60.350923566879,60.4731847133758,60.6667197452229,60.7173566878981,60.6611464968153,60.3972611464968,60.3777707006369,60.3297133757962,60.526050955414,59.1966878980892,60.746847133758,59.7729299363057,59.7575159235669,60.198025477707,60.0695859872611), c(61.5961146496815,59.1163694267516,61.0120063694268,60.0363694267516,59.4614012738854,60.3835987261146,59.5713375796178,60.9863694267516,60.1699363057325,59.4817515923567,59.2943312101911,60.3257324840764,60.8167834394904,60.4964331210191,60.3836942675159,60.0619426751592,58.6811464968153,59.6634076433121,58.6696178343949,59.5132484076433,59.5729299363057,59.9937261146497,60.5327070063694,60.3405732484076,59.909203821656,61.0844585987261,60.5952547770701,60.8201910828025,58.8685987261146,60.1772292993631,58.0146178343949,60.6513375796178,61.229872611465,59.7492038216561,60.0052866242038,60.2205732484076,59.2599681528662,60.250923566879,61.063821656051,60.2847452229299,59.0992038216561,61.467101910828,61.4866878980892,59.9985668789809,59.5356687898089,60.7069426751592,61.1353184713376,60.3353184713376,60.5123566878981,59.9130891719745,59.0285031847134,60.1184394904459,60.9995222929936,59.5250636942675,61.1692675159236,59.7987898089172,60.0459554140127,60.3046815286624,59.8500636942675,60.52,61.1693312101911,61.8423248407643,59.6821337579618,59.5101910828025,60.2964012738854,59.8604458598726,60.0375477707006,61.1702547770701,60.7249363057325,60.968821656051,59.911050955414,60.2016878980892,59.0993949044586,60.2246496815287,59.4547770700637,60.231847133758,60.8470700636943,58.8814968152866,61.0601910828025,59.4235031847134,60.7843949044586,59.8621337579618,59.7878343949045,60.55,58.8224840764331,61.2104777070064,59.5717515923567,60.9752547770701,60.192101910828,61.5305414012739,60.9867515923567,59.6555732484076,60.4626751592357,60.5473248407643,61.0055732484076,58.9995222929936,59.5537579617834,60.3579617834395,60.073152866242,60.9934713375796,61.5597452229299,59.5572611464968,60.0138535031847,61.0119108280255,60.5699681528662,60.8894267515924,60.2570063694268,60.2647133757962,59.5064968152866,59.8178025477707,59.518152866242,60.5645222929936,60.8326114649682,59.4468152866242,59.6832802547771,60.4097452229299,59.3814968152866,59.5778343949045,61.3907643312102,59.1738535031847,59.9695541401274,59.1440445859873,60.9267515923567,59.388025477707,58.6235350318471,59.5268152866242,61.1999363057325,61.281847133758,60.9037579617834,59.4916242038217,60.1006369426752,60.2676114649682,59.8067515923567,58.9439171974522,60.2510828025478,59.7753821656051,58.3583757961783,59.7570063694268,59.6245222929936,61.0515286624204,59.3624203821656,60.7662738853503,59.6063057324841,59.4263694267516,59.6517834394904,59.7312101910828,60.5904458598726,59.6835668789809,60.0736624203822,58.1104458598726,60.0799044585987,59.9366878980892,60.0236942675159,60.1883439490446,59.5065923566879,59.4762738853503,59.7106050955414,60.6800955414013,60.5575159235669,60.640127388535,59.5553503184713,60.0086624203822,60.6506369426752,60.3438535031847,59.9182484076433,59.386050955414,60.4788535031847,59.3835668789809,59.5337898089172,60.6056687898089,59.9573248407643,61.1400955414013,60.2014649681529,60.6008598726115,60.5538853503185,58.9166560509554,61.1829299363057,59.2741082802548,59.4936305732484,59.769872611465,60.331974522293,61.1719108280255,60.8428343949045,59.5264012738853,60.7681847133758,61.1693630573248,60.9347452229299,60.6674522292994,60.0016878980892,60.4112101910828,59.5227070063694,59.775796178344,60.9238535031847,59.2277070063694,59.8812420382166,60.0852547770701,59.7945222929936,58.8564968152866,59.8442356687898,60.818025477707), c(61.8938853503185,60.7552866242038,59.7002866242038,61.228821656051,60.052101910828,60.3055732484076,60.8815286624204,60.5428025477707,60.8645859872611,59.7182484076433,61.2398089171975,60.776050955414,59.8643630573248,60.3888853503185,59.4732484076433,60.1390445859873,60.3177707006369,61.456178343949,59.6733439490446,61.2214968152866,60.9405095541401,59.8352547770701,59.6148407643312,60.0186624203822,60.9722929936306,58.8043312101911,59.9575159235669,59.9752229299363,60.9656687898089,61.2833121019108,59.9390445859873,59.9889171974522,60.523152866242,60.2733439490446,60.1566878980892,60.6633757961783,59.3705095541401,59.7494585987261,62.2259872611465,59.7665605095541,61.3925477707006,59.7166560509554,60.9784713375796,59.9785031847134,58.8865605095541,59.6827070063694,59.7918152866242,59.53,59.3862101910828,59.5486942675159,58.8472611464968,61.0959554140127,59.8466560509554,60.2991719745223,60.3483757961783,60.8065286624204,59.2248407643312,58.6994585987261,59.4504777070064,60.2963057324841,61.1114649681529,59.4582165605096,59.3286624203822,60.1983439490446,59.6457006369427,62,59.3928662420382,61.3519108280255,58.4563057324841,60.3962101910828,60.0098407643312,61.6078662420382,59.9799363057325,60.9818789808917,60.4972929936306,60.1370063694268,59.8911464968153,59.0443312101911,60.6795541401274,60.151050955414,60.6231210191083,59.6601910828025,60.4752229299363,59.9043949044586,60.4008280254777,60.5853821656051,60.7919426751592,60.3977070063694,59.242898089172,60.4311146496815,60.3363694267516,59.8975159235669,60.2490445859873,59.2555732484076,59.6961146496815,59.3297452229299,60.5776114649682,60.6912101910828,59.869872611465,59.6552229299363,59.9648407643312,61.1055732484076,59.5303184713376,60.6385668789809,58.9341719745223,61.3296178343949,61.1029617834395,57.7058280254777,59.8567515923567,59.7017834394904,59.7698407643312,60.2184076433121,60.5599681528662,59.7645541401274,60.5258598726115,59.7073566878981,60.6190127388535,60.1522929936306,60.4466560509554,60.3121656050955,60.101050955414,60.2567515923567,61.9561146496815,60.446974522293,59.9451592356688,60.7714012738854,59.3455414012739,59.2587898089172,58.9526114649682,59.703152866242,59.8583121019108,59.9092993630573,59.9724522292994,59.9716560509554,59.7279299363057,61.1229299363057,59.9135668789809,60.6745541401274,60.2013694267516,60.6663375796178,60.1371656050955,60.4999681528662,59.8127707006369,59.9609872611465,59.5594904458599,60.5675159235669,59.8429617834395,60.7856369426752,60.4230573248408,59.0755732484076,60.1667515923567,61.1944585987261,59.0157006369427,59.8873248407643,59.5155414012739,60.0366242038217,60.0283439490446,60.793025477707,59.1199681528662,59.6312420382166,60.3364649681529,59.8104458598726,59.3143949044586,58.8073885350318,60.5829299363057,61.2062101910828,59.5791401273885,60.6329299363057,59.573025477707,59.9530573248408,60.6166242038217,60.0546815286624,60.1849363057325,60.8491082802548,58.2073248407643,60.8361146496815,60.7074522292994,60.3665605095541,60.9569108280255,59.7416878980892,61.2163057324841,60.0374522292994,59.4464331210191,59.7243312101911,59.69,60.919076433121,60.9208280254777,60.4207006369427,61.4015923566879,60.1770063694267,59.8596496815287,59.6578343949045,60.0611146496815,60.0079617834395,61.0314649681529,60.4982165605096,59.576178343949,60.1444904458599,59.9501592356688,60.8068152866242), c(61.046178343949,58.1761146496815,60.4333757961783,59.9696815286624,59.3815286624204,60.9741082802548,59.6559554140127,60.5732484076433,60.6894267515924,61.044203821656,59.931178343949,59.4819426751592,58.6553184713376,61.1898407643312,60.5426114649682,59.3907643312102,60.0437579617834,60.1094267515924,60.0064331210191,59.8281210191083,59.5013694267516,60.8798407643312,60.6855414012739,61.5238853503185,60.7260828025478,59.248949044586,60.5508917197452,59.9325477707006,59.5301910828025,60.0527388535032,60.9431210191083,59.1145541401274,59.2801910828025,60.1677707006369,59.5994585987261,59.2320063694267,60.3118789808917,60.801847133758,60.8154140127389,60.1263375796178,60.7790127388535,60.1875477707006,60.2964968152866,60.3666878980892,59.6014012738854,61.0240127388535,60.7969426751592,59.245,60.663152866242,61.3126433121019,60.447898089172,59.3614649681529,59.2055095541401,60.1053821656051,59.9242675159236,60.2578025477707,60.8513694267516,58.3081847133758,58.5672611464968,59.1809872611465,60.1503184713376,60.0743630573248,60.1732165605096,60.2839171974522,61.1309872611465,60.0924203821656,60.3432165605096,59.4116878980892,60.4738853503185,59.0579299363057,59.8163057324841,60.0550318471338,60.0014649681529,59.5484076433121,60.3057643312102,60.4140445859873,60.5958598726115,61.2854140127389,60.2399044585987,60.5053503184713,59.824203821656,60.989203821656,59.6955732484076,60.0785987261146,59.0173248407643,59.6819426751592,60.3176114649682,60.7818152866242,59.7049681528662,60.0686942675159,60.8742675159236,59.0914649681529,61.4695541401274,60.552101910828,59.4002547770701,60.3410828025478,60.7012738853503,60.5144904458599,59.6560191082803,60.4788535031847,60.3645222929936,59.4120700636943,60.2292993630573,59.2909554140127,59.9278662420382,58.9183757961783,60.2322292993631,61.551974522293,60.5312738853503,59.2037898089172,60.1787898089172,60.8143312101911,60.4057961783439,61.0727707006369,60.2409872611465,59.8076114649682,59.1655095541401,61.3667515923567,59.8884394904459,59.8824203821656,59.4906687898089,61.0455414012739,60.0213375796178,60.9354140127389,59.6150955414013,61.0712738853503,61.2024203821656,59.6272929936306,60.7886942675159,60.5985987261147,60.4888535031847,60.1143312101911,59.2643312101911,59.4061146496815,60.3850318471338,58.9592993630573,61.0555095541401,59.2156369426752,60.155,60.0606369426752,60.0939171974522,58.7500955414013,59.9883439490446,60.0471337579618,58.9571656050955,59.6201592356688,60.0616560509554,59.7668152866242,61.4127070063694,59.6583121019108,59.2770382165605,60.0632165605096,59.9720382165605,59.0078662420382,59.2098407643312,61.5252229299363,60.9706050955414,59.1827070063694,59.9828025477707,60.4334394904459,59.7533439490446,60.0336942675159,60.9295541401274,59.7282484076433,60.7632165605096,61.6702866242038,60.0409872611465,59.979872611465,61.3007643312102,61.0803821656051,59.2177388535032,59.4621656050955,60.8806369426752,61.0148089171974,59.5683121019108,60.5049681528662,60.4552229299363,58.6230891719745,59.7050318471338,60.2346815286624,60.2906369426752,60.2460828025478,59.8796815286624,60.2814012738854,61.1729617834395,59.3175796178344,59.8741401273885,60.6749363057325,59.0128662420382,60.0768789808917,60.1215923566879,57.8424203821656,61.1960191082803,60.3628343949045,60.7782484076433,60.6828662420382,61.0566560509554,60.2485350318471,60.138949044586,60.0508280254777) ) %>% purrr::reduce(c)) simSDoM <- data.frame(mean = list( c(59.7588917430597,59.8944572094188,60.9839626434119,60.6798705486915,60.8186566467587,61.3597763982235,61.3284138172637,59.7676940404699,60.859957043136,60.5522953907898,59.2465098115763,59.736084569419,59.6703449661941,60.5341051180542,59.981715401832,59.2583855398623,58.2742138433096,59.0000491944237,59.993064581743,59.4378147840095,60.5203993169088,60.5667380455007,60.8173806526032,61.5913769404935,61.3447937970333,59.5747256946318,59.5399288286923,59.8583660752289,59.6600509515479,60.4275189460079,59.7850291563314,59.5518338793789,59.7080226655715,59.8723685228513,60.0563231210755,60.1353815384324,59.9283894509478,59.9183090262782,59.2432831418853,60.2066397330036,60.2863576130474,59.7591450253998,59.5761111067485,60.5876970464061,61.4218357568107,59.8096538210289,60.4721746153591,60.4150526974107,60.6542676410745,59.650737535696,58.9918626840407,60.1250389594842,59.6361596688968,59.7750191226738,60.4191095966401,60.1811966701731,60.612957417785,59.4808238591511,59.0778988078306,59.7649094683586,59.3523828958804,61.5627235155007,60.2183661928891,59.2266614099336,59.7673516131503,59.7881866357501,58.9695926346687,59.5726643294009,59.8365024679704,60.8272655121895,59.1635455376999,60.0419604688849,59.6540319465268,59.6214231539207,60.1598315111993,59.179052421691,58.7589988223075,59.4338470239698,59.9862207687815,61.2217907526621,61.1277775410672,59.6754525164382,60.3759972761418,60.5615520432254,59.9384634610461,60.5603865539692,60.4391429957572,60.7123289179478,58.9491405308596,60.284985512851,59.7314863029287,60.4174047489251,59.2268861170776,60.6839764550678,60.4050125792139,61.5147382465856,60.0161605821625,60.4175394527646,60.0530031909177,59.8157068384971,59.286003432833,59.8719610178585,59.6871394547651,61.2471924403752,59.5297355700745,59.2356054008505,60.0859683065028,59.7961305123925,60.063813575257,60.2182480606133,59.3793196822151,61.5480145634206,59.8384810316507,60.6221731107875,60.6493078975424,59.0756830765886,60.7899499535498,59.7957779215393,60.4525853588511,60.3850147778723,59.7201021080432,60.3438907519421,59.7819180333054,59.8792451059189,59.988230447349,59.1860137400892,60.2550012874431,61.2929311624079,60.5628573302067,59.1826217612414,60.4099314693025,59.5292945933308,60.6848136608785,60.7735639196712,60.1171341832897,59.0859636294269,61.310205891744,61.3117154488175,60.0264879206908,60.5229985078491,58.122719789604,60.7895506724737,60.465635083026,60.127547624846,60.7154186123334,59.6821349488305,59.9994426812713,58.9574896721071,60.8643233781579,59.4374577800657,59.7511369625001,60.2620789123672,60.6460355215115,60.3463349515004,59.6197782776479,59.4466726295615,60.1408352137871,60.5744233335575,60.3996098256486,60.3586720298543,60.0074677254119,59.8836445537428,60.0699670935439,59.9548314586602,60.4640504863488,60.1103165539961,60.6906751917531,59.8572469159198,59.7488330940743,59.9070675495667,60.0910167461119,59.9023036559428,58.9798503451708,59.3004342612168,60.0971524581755,61.4714866370756,60.1348144238285,60.3732409413317,59.7772383145772,58.7695058923113,60.2407462690037,60.360641714887,59.6158725376674,59.6623444856176,60.5203044017352,59.6356343813199,58.9975516737764,58.5172275321097,60.8112896466016,60.0472692038476,60.3528902828765,59.7379948149309,59.6501742836214,59.4473737389464,60.1428795090969,60.1816292424458,60.8073625081934,59.7944352981859,59.1940678916639,60.8032742919017), c(59.530666874188,60.8884875156738,60.3575019404329,58.2810282608276,59.7034138688096,59.6850247006623,60.3460982569558,59.6459319164848,59.861431682497,60.5762661024429,60.0218004870194,59.8388467877816,59.9981603667657,59.5523892943964,59.8162004503622,60.2648261972851,61.6075982875652,59.5798479359515,61.2576454575129,60.4887726980084,60.2503289548239,60.0093891096938,60.7936085323536,61.1964728390723,60.1746037549553,60.1741769862031,59.5328941172477,59.6993208847916,59.1165998053535,59.4801273142816,59.4691223833074,59.4374685818685,60.7586829901746,60.3802276881013,61.2127579826396,61.3346338142009,60.7003763395411,60.9231264371872,58.5716307968546,60.4104787563856,60.2862698941946,60.4094165855767,59.6588461397033,58.9971297559393,59.9452505950082,60.519371644557,59.5845079333314,60.3993456140089,60.4507442187073,59.944112517794,60.2295034470762,59.5307353226377,60.2615568054985,60.4413461576593,59.3746352210159,60.5362299908142,60.6422496741627,60.2175932900429,59.0520530990458,60.397391735439,59.3945927065191,61.5071007430539,59.7208916852417,59.9326375001195,60.3903810605155,61.094873535985,59.9126253658811,60.0658256005568,59.6153729634227,59.3077306234341,60.9243896929552,60.602398584734,61.0682035003042,59.9524876999678,59.4986441191596,61.2517394636542,59.2714438489891,60.8212307029339,59.8204229624046,60.5989476767813,60.6273893537046,60.4376189408063,60.1586695179006,60.0513411375454,59.9890012770559,59.798552745548,59.5076268984696,60.36310918324,59.8719110481694,59.6617326691388,59.1191684223771,60.7666398711106,60.9825761743266,61.5087807233399,60.8125078200741,59.3286575774533,60.2314310452719,60.6970502117498,60.4610938707992,60.5227167785604,59.6537106565027,59.8658095076567,60.8986691092576,59.4675371376698,58.9832252805817,61.7522278865898,59.8225846710637,60.581100515679,59.6741786847289,59.7875527590939,59.5480060387495,60.274691896586,60.4979831112505,60.4303178356921,59.9431817266602,59.6302758821538,58.6405411375313,60.4362418807884,61.4562792770302,62.1487940834251,60.3854224676051,59.8302359309698,58.9114677323573,60.4332614474346,60.2465691931376,60.2654121079381,59.9506331601825,60.0711305225423,59.4272054203397,59.1305167849909,59.4749509029891,59.4745076022608,59.4953613664656,59.7486457155227,58.9803159170114,59.7379619726717,60.3582725488226,60.2806678019711,60.5048632954895,61.3895120495584,60.0784392661994,60.242258915747,61.5469028337006,60.4845609984882,60.4404695094447,60.6913648911077,60.1529653544604,60.8063808709262,59.4678982336154,59.4969366754253,59.1576130767396,60.0247539252398,59.6669194177906,59.1107321697064,60.771227784674,60.6782405530447,58.302352582313,59.282183083531,60.5523054441995,60.543360627896,60.208827459354,60.5428664321082,59.3630452349092,61.2847734444728,61.7218974396462,59.8393415067177,60.2763466918324,60.0756587505893,59.7428699760569,59.5910928750614,61.1059589570225,60.3214450082731,60.8345382762938,60.5894185923354,60.0648474389448,59.6829324804307,60.5430168283516,58.9443018947845,59.7483731362293,60.1060064579155,59.4967428412274,59.3482385234188,59.7105329915118,60.2777396818449,60.4265601150724,60.5643543927587,60.1602595073521,61.3480720048332,60.1050585138139,60.2935878507021,60.183484364727,60.0242209101817,59.7308944941635,60.8258978331436,60.7128139597231,59.776573505904,60.0132827722362,60.8486754945663,60.8491253222014,61.4390318381143), c(60.0096095495964,58.6809996705825,60.2756937799215,59.8823504414667,59.6118587591167,59.7120924059262,60.8663589803706,59.7538683932212,60.0343700693273,60.5427836971993,59.5328298504406,59.662517929128,59.3813896381686,60.7358712169759,60.3474946170839,59.4522575912185,60.762926611552,59.0399571328298,59.2183454264477,59.6835405321251,60.5559459727678,60.297728466055,60.7333817820875,59.8985793582704,60.1792994429298,59.5626453599132,60.626418944268,60.5269561247936,59.9757649334274,61.6085124238053,58.2495043140016,59.5137122658008,59.6163254425697,59.164182715705,60.4912825741827,59.6648100509728,61.1563226803055,59.4200234843674,60.4156809754187,59.7448498088947,60.3291391626157,59.5343782077219,60.6577123248963,60.5060697927544,60.3222602151583,60.3671763592725,59.9922553722583,61.2132801441289,60.2516715442386,60.4511431325814,60.7131773584482,60.9537966714909,61.1961047142451,59.3022463945896,59.8950779398287,60.4951148380698,59.0365999371635,59.8127181744942,60.0793798228761,59.4027938735997,59.5942379432556,60.2951266300762,59.9274979403639,59.9568431103847,58.8146675145915,60.2767600133241,59.2761845252668,60.441841012917,60.328523203378,59.9120375221231,61.1725696323549,59.6604126133944,60.6734160102807,61.229321960302,59.442054178748,59.642594963821,58.9299762336235,60.031991026814,60.685745787374,59.3572270744115,60.5476535358467,60.4813167354353,59.236145320708,60.3600323241234,60.7078693671994,59.7591472953061,60.1504996653717,59.1812835177357,60.5607595370552,60.2345623444139,60.6298799216303,59.4926994689967,59.6905239170842,61.0976606150953,60.5635454152301,59.2085051604724,59.9981560961669,59.7062669225262,60.6843165380039,59.927908450648,59.8027418481433,59.8323550900404,59.3582149932976,59.9168574137478,60.9053147522123,60.2353093646606,59.7751161538951,59.6531941068942,59.8749393096718,61.2431361527973,60.2672095592502,59.6571593332474,59.9642497954376,60.8454958843117,59.8976588053327,59.9969521070266,59.57260773092,62.0563829947083,60.5678626231672,59.768857336524,59.3415296119674,59.5219268211849,60.6328789474846,60.2044012083854,59.6830084930018,59.911712097604,59.9216908224711,60.088826594236,60.3598932183402,60.0852959495549,60.0630865389422,61.0920660361794,61.0032338455556,60.3967245885856,59.6649955062087,61.2509865552296,60.020012372724,60.7747050382667,59.3170234261691,59.7480758199113,60.2955055694806,59.1787904357197,60.5436646304922,60.2876005767972,60.7362239019336,60.1991633519744,59.3758782585434,60.6970015922837,61.2804244547162,59.4937434905902,60.3813335200885,60.9570947271601,59.8842279383554,59.8935591141508,60.2393815421066,59.8037745550141,59.8149758677998,61.1790695188317,61.463941549278,59.4833543725617,59.0759673341495,60.7769394847369,60.7108642192232,59.7394297591228,60.4010354795505,59.1755955153769,61.5188675563559,60.0408478702982,60.1005086046771,61.1353317604818,61.2562764937003,58.6246281154295,59.5218384239944,59.8667284377105,60.7335456295911,60.5220854055418,61.245093169961,60.4143795187427,59.9154961445522,61.2441570237443,60.5014861205114,58.929559983521,60.35265358197,59.5586768996659,59.3654175144267,60.4744337935364,59.2284670131124,60.1175438079164,59.9381473695702,59.658646102782,59.5308097298363,60.596919866747,60.0597820210964,59.6027932272816,60.2711238836619,60.1297842296562,59.9446120081984,60.6400057333987,60.88900382297,59.5697007760127), c(61.3261290139958,60.8120941007976,59.3389746199269,59.8864940319875,59.9702343046591,61.1546533117204,59.6217245635421,61.6591045060493,59.5585870345448,59.4787239833723,60.9664204910843,60.4149219268725,60.0891122905905,61.5448742225568,60.1492506225949,60.5295286653395,59.3993984174103,58.744658711481,59.3968359097341,61.0891514450465,60.7553997784106,60.4596315769758,60.6437635889136,60.6063487569981,60.5342784442188,60.5296857665087,59.9900894563879,60.6428159464162,59.8830013887129,59.4032360129865,60.1841506599384,60.0821657235679,59.7392402552358,60.2513260249844,59.5864660781688,59.9169856137467,60.5643014396155,59.6429367915281,59.8223724022059,61.2268219254029,58.873707973003,59.6485332338723,60.0407082565955,59.4658421165957,59.3177477793316,60.7415593931066,61.0437677676188,59.8432046765302,60.7296871871978,59.9470065636748,60.8919176665152,59.6885560234063,61.3307973388718,60.9942405710121,60.3823550096939,59.4921228250216,59.5571965753596,61.2993314884712,61.2658292506548,60.4007817156422,58.8114319349615,59.9093203917245,59.97032100163,61.0092619371867,59.1908258121854,59.5985106549561,60.1026401326151,60.8787332566329,59.1138678554328,60.0300896815409,60.2435081699687,61.2205565420449,59.3006712561574,59.7713888198321,58.8617140997569,59.8307197077579,59.1095895604376,60.7648038247214,59.2163661864549,61.4600727571819,59.9740222941699,60.4552729938783,61.2673514022465,62.2629426668024,61.022812676353,60.6462007005899,61.3835303379889,59.0074561291754,59.9214326873602,59.753420847834,60.4319588778558,60.6698907532607,60.1664846925084,60.7211351114956,60.4102842127074,59.3936547242943,60.3143163089017,60.8437555256814,59.8457753093843,58.5349140247802,59.3736882493877,60.5258782747811,59.58297439159,61.0942878332925,60.002631582667,60.3165510560565,59.7079988997994,60.5513510598373,60.4410542744449,60.9651081771602,59.5240768940464,60.849629170599,59.8808791936893,59.1688225750905,58.885871379653,60.234530268955,59.3710571182874,58.9114936325948,60.5636996745379,60.7470014170316,59.6882410897874,60.080805856823,61.1575222812582,60.331719168621,59.4438708561795,60.0579476006431,59.6298184656509,60.7125888400735,60.7322820847289,60.1099919112391,60.9203431075061,59.308315209583,59.6987850997316,59.7982679524458,59.124278111387,60.1720278730685,59.8575380277764,59.251390302563,59.6785737578727,59.370029212945,60.2781008819024,59.6902966993148,61.36368616623,60.7474767488787,59.9798875780049,60.6254500038286,60.0034605356412,59.6027466120976,59.1622926031632,59.5353328745795,60.5470379965997,60.0611438169625,60.0028460431322,59.3516351590905,59.9109083254828,60.8316117546808,59.7559841561232,59.9476064924199,59.9400885001734,59.0500403893681,59.6710350951886,59.9439835250382,59.3683848671757,59.1396935052354,59.7820587660652,59.6591214069358,59.394811315389,59.9622327357061,59.6680121113749,61.0316334017118,60.1278222980278,61.0647528832959,58.5406299098882,59.7182256242613,60.7124665823383,61.8336216741092,60.3137994535497,60.8250267882948,60.0845781131773,60.9096445623922,60.7022893557548,59.5942495262014,60.5345575808119,61.8208396091076,60.1901406056897,60.130479458639,59.7016353378152,59.1992928543209,61.4262172243993,60.6306764447324,59.2596371883028,58.7730085441379,60.5120639328772,60.3502685634136,59.6354573027548,59.6739488323224,60.6555863696654,60.9699673091905,61.5647138129864,59.4537323234602), c(60.6695815521804,59.6441998352113,61.3491463755832,60.0887023847572,59.5908328427489,60.2954671127551,59.7991036444437,59.814113997127,59.5663933951994,60.353348127578,59.1792707562573,60.2506125550034,59.6323523448602,60.5757335460023,60.1186549921193,60.0168194745208,60.6925921999031,60.6180652576061,61.5362381150017,59.9157820431914,59.7562749585094,60.6384983432627,60.7919493115937,60.3581780073885,59.8206743082405,57.8946289399936,60.2163514513746,60.2033341308216,59.7506066895417,59.905055855178,58.4025223626292,59.441548670785,59.2760492029892,59.8824445613063,60.5449737433193,60.1855608750121,61.8664088087641,60.2668269760888,59.6675279929039,59.5628740863026,60.1929355129432,59.9936055768661,60.4370670389749,60.1953983905953,59.9152052450626,59.0285715051758,61.5309610033415,59.1781938299306,60.4820425561825,60.0761943604693,59.6408200367892,60.5810652611315,61.1058262580893,59.6250477462056,60.017691160235,61.027898366119,60.4088877428535,60.7756928425459,60.302296337597,60.5748770753937,59.3698407705395,61.2974621958253,60.0963904911743,60.3582251832494,60.0773750863895,59.4287714250451,59.8006534698138,59.4571929040289,61.258143036526,60.2049933279903,58.3693532527488,60.0783209477314,60.0753207235338,60.9833693308873,60.8515860154156,60.0910197822717,62.1725226242798,60.1167023775651,60.2816060310067,59.6015835023149,59.1665103709205,60.2702628229201,58.6952473335314,60.088174174346,60.1388511216964,60.5038609941364,60.3475093703317,60.3651612785382,60.913456572941,60.9422100153358,59.687748471595,61.4721377185418,60.1765480046176,59.2466754913399,60.4667444447107,59.2198360847605,59.5247342181647,61.2157354136748,59.5915842603391,59.7266613816319,59.0973007973808,60.516601986903,59.9167450373914,60.2515403496572,59.7882971646563,60.2527563689263,58.889754207679,59.083108095208,60.0865147955744,60.7785446362905,59.7993004339763,60.3328253484169,58.6176297109174,60.3243143301882,60.0376619799519,60.0981575810723,60.6930049240127,59.995982536232,60.6414871445766,61.1144898083219,59.8575340051311,60.279202770733,59.4894660206417,59.7338850124031,59.2445168038706,59.9303799933449,59.6316649560908,60.5008947059161,58.3423571080556,59.6315347194301,60.600815452492,59.6779702262296,60.1166380745228,60.194057709357,59.1831202807502,59.6378063443035,60.1276630862186,60.090385190253,61.1696002097434,61.6078119319733,59.6123426719362,59.0880082602978,60.2432838741042,59.3112373498669,60.3743925316228,59.2872882554498,57.890958257317,59.3546293778389,60.05548941192,59.4680791919355,60.743841310564,59.5697643380717,60.2967104777372,59.9505381495463,59.2813372378942,59.6319397289762,60.2464975161653,60.9449745648837,58.9181037327687,60.8914820067583,61.2036564084059,60.1633656214146,59.8695218511589,59.7380098710844,59.6193059894016,60.6105946698555,59.727075265483,60.7206666593913,61.1024292586005,59.6149679474762,59.5809335734944,61.781705892107,59.7377516106666,57.9934829921399,60.0197174234106,60.9118273974453,60.6428368519589,60.7845280939168,60.1894389243614,60.3766569795719,60.2615032531037,61.8425219683731,59.7509185445018,61.1077454045702,60.2564631255193,58.9267960140798,61.022763387646,60.9373971199212,60.6200531637601,60.1381002633885,59.7687420333368,60.7366648057754,60.4593818314934,61.4351981119079,60.3690834583071,60.3736088133981,59.8189452373423,59.5687863298831,59.5771759107271,61.353196959761) ) %>% purrr::reduce(c)) # favstats for Thumb # favstats for bootstrapped means # favstats for simulated means # favstats for Thumb favstats(~Thumb, data = Fingers) # favstats for bootstrapped means favstats(~mean, data = bootSDoM) # favstats for simulated means favstats(~mean, data = simSDoM) ex() %>% { check_output_expr(., "favstats(~Thumb, data = Fingers)") check_output_expr(., "favstats(~mean, data = bootSDoM)") check_output_expr(., "favstats(~mean, data = simSDoM)") } success_msg("Nice job!")
You'll want to use Fingers, bootSDoM, and simSDoM
DataCamp: ch10-8

Using the Bootstrapped Sampling Distribution to Construct the 95% Confidence Interval

We have established that the bootstrapped sampling distribution is nearly identical to the simulated sampling distribution. Although we used different methods to create them, we end up in the same place. Just based on the fact that the two distributions have similar standard errors, we can guess that the confidence interval we would construct from the bootstrapped distribution would be roughly the same as what we got from the simulated distribution.

A histogram of the bootstrapped sampling distribution of means centered at the sample mean on the left. A histogram of the simulated sampling distribution of means centered at the sample mean on the right. The two distributions look roughly the same.

The code window below finds the confidence interval using the simulated sampling distribution centered at the sample mean. As before, we sort the means in descending order and then print the 25th largest mean and 975th largest mean. These correspond to the upper and lower bounds of the confidence interval.

Add code to find the confidence interval using the bootstrapped distribution. See how the confidence intervals compare using the two different distributions.

packages <- c("mosaic", "Lock5withR", "Lock5Data", "supernova", "ggformula", "okcupiddata") lapply(packages, library, character.only = T) RBackend::custom_seed(31) Thumb.stats <- favstats(~ Thumb, data = Fingers) bootSDoM <- data.frame(mean = list( c(61.0020063694268,61.0147770700637,59.3556050955414,59.4213375796178,59.5877070063694,59.5794267515924,60.881178343949,59.3518789808917,58.7692356687898,59.2991719745223,59.261974522293,58.5667197452229,58.7577707006369,60.3584076433121,59.5166878980892,59.7835668789809,60.2649681528662,60.190796178344,60.2551592356688,58.6678025477707,60.0283121019108,60.4431847133758,60.561974522293,60.9227707006369,59.8675477707006,60.5073885350319,59.7288853503185,59.8583439490446,60.5559872611465,60.1817515923567,59.9006050955414,60.7224840764331,59.3931847133758,59.6908598726115,60.3463694267516,59.5552866242038,61.0134076433121,60.2412420382166,60.6310191082803,59.0171656050955,59.8913375796178,60.6028662420382,59.9125159235669,61.0462738853503,60.1015286624204,60.1912738853503,59.6527388535032,59.9388853503185,59.0318152866242,60.0586942675159,58.6305732484076,60.9182165605096,59.9859872611465,60.160796178344,61.0479299363057,60.3269108280255,60.2718789808917,60.3868152866242,61.0549044585987,59.9144904458599,59.6427070063694,59.743949044586,60.0247770700637,59.0194904458599,59.7881847133758,58.9855414012739,60.4451592356688,60.2363694267516,58.4535031847134,60.8078025477707,60.8949681528662,60.745796178344,60.2380891719745,60.4352547770701,60.4199044585987,59.7881210191083,60.5373566878981,58.4365286624204,59.6831847133758,60.2950636942675,60.8923248407643,59.184203821656,60.078152866242,59.850127388535,61.8756369426752,60.3116878980892,60.191050955414,60.607898089172,60.5977388535032,60.7529936305733,60.168152866242,60.5856369426752,59.7264331210191,60.7035668789809,60.2846815286624,58.4640127388535,60.7056050955414,60.5424840764331,61.3418789808917,60.5924522292994,60.2901592356688,61.1482802547771,59.8722929936306,59.9935668789809,60.3107961783439,59.846974522293,60.0866878980892,59.5413694267516,61.1490127388535,59.9484713375796,59.7722929936306,60.1707324840764,59.4850318471338,59.7022292993631,60.0282165605096,59.2028025477707,59.9106369426752,60.6444585987261,60.7520700636943,60.3702547770701,60.5849681528662,60.0957324840764,58.9313694267516,60.7392356687898,60.726050955414,60.2635668789809,59.5965605095541,60.1914649681529,59.3333757961783,58.1182484076433,60.601974522293,58.9444904458599,59.1149681528662,59.6750318471338,59.8292993630573,59.7839808917197,60.3870063694268,59.1917197452229,60.0186942675159,59.9595859872611,60.9529617834395,59.9596815286624,60.2205732484076,59.0217515923567,60.3700955414013,61.3917834394904,60.5620700636943,60.7003503184713,58.7424203821656,60.3724203821656,60.5645859872611,60.6020063694268,60.4578343949045,59.9199044585987,60.1814649681529,58.9360191082803,60.3632165605096,60.4492993630573,60.3638535031847,60.9569108280255,60.5435031847134,59.6505095541401,59.1698089171975,59.5056050955414,60.1450318471338,60.3533757961783,60.093025477707,60.5575796178344,60.2490445859873,60.0797452229299,59.7629617834395,59.910127388535,60.6206050955414,59.3897770700637,61.3440127388535,60.1224840764331,60.8052547770701,60.0979617834395,60.4945541401274,59.2866878980892,59.9606050955414,59.7955732484076,60.4507324840764,60.0562738853503,60.8179617834395,59.5063375796178,58.730923566879,58.5345859872611,60.3827388535032,59.4966878980892,58.9622611464968,60.4847770700637,61.2259554140127,59.9905095541401,60.9279617834395,60.141178343949,60.2501910828025,59.5736624203822,59.9447133757962,59.5702229299363), c(59.626050955414,60.6979617834395,60.5515605095541,60.7474203821656,60.3567515923567,60.86,60.3896815286624,59.1646496815287,60.1069426751592,61.005923566879,59.7933439490446,59.1877388535032,60.7342038216561,60.4812420382166,59.4789808917197,61.258025477707,60.3203821656051,59.902101910828,60.4777070063694,59.941847133758,60.378821656051,60.2780891719745,60.1727388535032,62.2073248407643,58.6756050955414,59.4602866242038,59.4675159235669,60.7385987261147,60.2567515923567,59.649872611465,59.9802547770701,60.5514012738854,59.6092675159236,58.9612420382166,59.4956050955414,60.0503184713376,60.6807643312102,59.6449363057325,58.8077707006369,60.4085031847134,60.8815286624204,58.9206687898089,58.4188535031847,60.053152866242,59.8078343949045,60.4247770700637,59.3932802547771,60.4764331210191,60.5965605095541,60.7267197452229,59.1676433121019,60.0707643312102,59.8945541401274,59.0871337579618,60.4038535031847,59.7632484076433,59.0606050955414,59.6276114649682,60.5886624203822,60.0386624203822,59.7858598726115,59.2321337579618,60.6176114649681,60.2924522292994,60.1144267515924,59.71,62.1438853503185,61.2416242038217,59.9547133757962,58.4540127388535,59.1574203821656,58.7834394904459,58.9857006369427,59.6249044585987,60.2435350318471,59.5279299363057,59.6875796178344,59.4290445859873,59.9630891719745,59.7571974522293,59.8325159235669,60.6326751592357,60.3754140127389,60.4561464968153,60.0614649681529,60.2735350318471,60.1684076433121,60.380127388535,60.3058280254777,59.8476114649682,59.716847133758,60.7446496815287,61.4364331210191,59.358949044586,60.4370063694268,59.0200955414013,60.2910828025478,60.3982484076433,60.0766242038217,59.8057324840764,59.9637261146497,58.1924522292994,59.2070063694268,60.3434713375796,59.8607643312102,59.3537898089172,59.9544267515924,59.8222611464968,59.2460191082803,59.0587898089172,59.5818152866242,60.6557961783439,60.4595541401274,60.4052866242038,60.663152866242,59.7303184713376,60.614203821656,60.1999044585987,59.7442675159236,60.3945859872611,60.265127388535,60.056974522293,60.9645859872611,60.1981847133758,59.7733121019108,60.4239171974522,59.3639171974522,59.4753184713376,61.9625159235669,60.7666242038217,59.7999681528662,59.0453184713376,59.3503503184713,60.552898089172,60.0322929936306,60.6771974522293,60.0953184713376,60.0986305732484,59.0823248407643,60.9681210191083,60.36,59.665923566879,59.6033439490446,60.4471337579618,59.9064649681529,59.6996178343949,59.9347452229299,61.8200636942675,60.4672292993631,60.0672292993631,59.4928025477707,60.9420063694267,59.8218789808917,59.908152866242,60.2936624203822,59.2133121019108,60.557101910828,60.3145222929936,60.7654458598726,58.1563057324841,60.7208598726115,59.6152866242038,60.0646815286624,61.1518789808917,59.2687579617834,59.9259872611465,60.2022611464968,58.9238853503185,59.8892675159236,59.8322292993631,59.4727388535032,60.9275477707006,60.3474840764331,60.1209872611465,60.446974522293,59.8523248407643,59.891974522293,58.8847770700637,59.7015286624204,59.8407006369427,59.8292993630573,59.6435350318471,59.9993630573248,60.1252229299363,60.1797770700637,60.350923566879,60.4731847133758,60.6667197452229,60.7173566878981,60.6611464968153,60.3972611464968,60.3777707006369,60.3297133757962,60.526050955414,59.1966878980892,60.746847133758,59.7729299363057,59.7575159235669,60.198025477707,60.0695859872611), c(61.5961146496815,59.1163694267516,61.0120063694268,60.0363694267516,59.4614012738854,60.3835987261146,59.5713375796178,60.9863694267516,60.1699363057325,59.4817515923567,59.2943312101911,60.3257324840764,60.8167834394904,60.4964331210191,60.3836942675159,60.0619426751592,58.6811464968153,59.6634076433121,58.6696178343949,59.5132484076433,59.5729299363057,59.9937261146497,60.5327070063694,60.3405732484076,59.909203821656,61.0844585987261,60.5952547770701,60.8201910828025,58.8685987261146,60.1772292993631,58.0146178343949,60.6513375796178,61.229872611465,59.7492038216561,60.0052866242038,60.2205732484076,59.2599681528662,60.250923566879,61.063821656051,60.2847452229299,59.0992038216561,61.467101910828,61.4866878980892,59.9985668789809,59.5356687898089,60.7069426751592,61.1353184713376,60.3353184713376,60.5123566878981,59.9130891719745,59.0285031847134,60.1184394904459,60.9995222929936,59.5250636942675,61.1692675159236,59.7987898089172,60.0459554140127,60.3046815286624,59.8500636942675,60.52,61.1693312101911,61.8423248407643,59.6821337579618,59.5101910828025,60.2964012738854,59.8604458598726,60.0375477707006,61.1702547770701,60.7249363057325,60.968821656051,59.911050955414,60.2016878980892,59.0993949044586,60.2246496815287,59.4547770700637,60.231847133758,60.8470700636943,58.8814968152866,61.0601910828025,59.4235031847134,60.7843949044586,59.8621337579618,59.7878343949045,60.55,58.8224840764331,61.2104777070064,59.5717515923567,60.9752547770701,60.192101910828,61.5305414012739,60.9867515923567,59.6555732484076,60.4626751592357,60.5473248407643,61.0055732484076,58.9995222929936,59.5537579617834,60.3579617834395,60.073152866242,60.9934713375796,61.5597452229299,59.5572611464968,60.0138535031847,61.0119108280255,60.5699681528662,60.8894267515924,60.2570063694268,60.2647133757962,59.5064968152866,59.8178025477707,59.518152866242,60.5645222929936,60.8326114649682,59.4468152866242,59.6832802547771,60.4097452229299,59.3814968152866,59.5778343949045,61.3907643312102,59.1738535031847,59.9695541401274,59.1440445859873,60.9267515923567,59.388025477707,58.6235350318471,59.5268152866242,61.1999363057325,61.281847133758,60.9037579617834,59.4916242038217,60.1006369426752,60.2676114649682,59.8067515923567,58.9439171974522,60.2510828025478,59.7753821656051,58.3583757961783,59.7570063694268,59.6245222929936,61.0515286624204,59.3624203821656,60.7662738853503,59.6063057324841,59.4263694267516,59.6517834394904,59.7312101910828,60.5904458598726,59.6835668789809,60.0736624203822,58.1104458598726,60.0799044585987,59.9366878980892,60.0236942675159,60.1883439490446,59.5065923566879,59.4762738853503,59.7106050955414,60.6800955414013,60.5575159235669,60.640127388535,59.5553503184713,60.0086624203822,60.6506369426752,60.3438535031847,59.9182484076433,59.386050955414,60.4788535031847,59.3835668789809,59.5337898089172,60.6056687898089,59.9573248407643,61.1400955414013,60.2014649681529,60.6008598726115,60.5538853503185,58.9166560509554,61.1829299363057,59.2741082802548,59.4936305732484,59.769872611465,60.331974522293,61.1719108280255,60.8428343949045,59.5264012738853,60.7681847133758,61.1693630573248,60.9347452229299,60.6674522292994,60.0016878980892,60.4112101910828,59.5227070063694,59.775796178344,60.9238535031847,59.2277070063694,59.8812420382166,60.0852547770701,59.7945222929936,58.8564968152866,59.8442356687898,60.818025477707), c(61.8938853503185,60.7552866242038,59.7002866242038,61.228821656051,60.052101910828,60.3055732484076,60.8815286624204,60.5428025477707,60.8645859872611,59.7182484076433,61.2398089171975,60.776050955414,59.8643630573248,60.3888853503185,59.4732484076433,60.1390445859873,60.3177707006369,61.456178343949,59.6733439490446,61.2214968152866,60.9405095541401,59.8352547770701,59.6148407643312,60.0186624203822,60.9722929936306,58.8043312101911,59.9575159235669,59.9752229299363,60.9656687898089,61.2833121019108,59.9390445859873,59.9889171974522,60.523152866242,60.2733439490446,60.1566878980892,60.6633757961783,59.3705095541401,59.7494585987261,62.2259872611465,59.7665605095541,61.3925477707006,59.7166560509554,60.9784713375796,59.9785031847134,58.8865605095541,59.6827070063694,59.7918152866242,59.53,59.3862101910828,59.5486942675159,58.8472611464968,61.0959554140127,59.8466560509554,60.2991719745223,60.3483757961783,60.8065286624204,59.2248407643312,58.6994585987261,59.4504777070064,60.2963057324841,61.1114649681529,59.4582165605096,59.3286624203822,60.1983439490446,59.6457006369427,62,59.3928662420382,61.3519108280255,58.4563057324841,60.3962101910828,60.0098407643312,61.6078662420382,59.9799363057325,60.9818789808917,60.4972929936306,60.1370063694268,59.8911464968153,59.0443312101911,60.6795541401274,60.151050955414,60.6231210191083,59.6601910828025,60.4752229299363,59.9043949044586,60.4008280254777,60.5853821656051,60.7919426751592,60.3977070063694,59.242898089172,60.4311146496815,60.3363694267516,59.8975159235669,60.2490445859873,59.2555732484076,59.6961146496815,59.3297452229299,60.5776114649682,60.6912101910828,59.869872611465,59.6552229299363,59.9648407643312,61.1055732484076,59.5303184713376,60.6385668789809,58.9341719745223,61.3296178343949,61.1029617834395,57.7058280254777,59.8567515923567,59.7017834394904,59.7698407643312,60.2184076433121,60.5599681528662,59.7645541401274,60.5258598726115,59.7073566878981,60.6190127388535,60.1522929936306,60.4466560509554,60.3121656050955,60.101050955414,60.2567515923567,61.9561146496815,60.446974522293,59.9451592356688,60.7714012738854,59.3455414012739,59.2587898089172,58.9526114649682,59.703152866242,59.8583121019108,59.9092993630573,59.9724522292994,59.9716560509554,59.7279299363057,61.1229299363057,59.9135668789809,60.6745541401274,60.2013694267516,60.6663375796178,60.1371656050955,60.4999681528662,59.8127707006369,59.9609872611465,59.5594904458599,60.5675159235669,59.8429617834395,60.7856369426752,60.4230573248408,59.0755732484076,60.1667515923567,61.1944585987261,59.0157006369427,59.8873248407643,59.5155414012739,60.0366242038217,60.0283439490446,60.793025477707,59.1199681528662,59.6312420382166,60.3364649681529,59.8104458598726,59.3143949044586,58.8073885350318,60.5829299363057,61.2062101910828,59.5791401273885,60.6329299363057,59.573025477707,59.9530573248408,60.6166242038217,60.0546815286624,60.1849363057325,60.8491082802548,58.2073248407643,60.8361146496815,60.7074522292994,60.3665605095541,60.9569108280255,59.7416878980892,61.2163057324841,60.0374522292994,59.4464331210191,59.7243312101911,59.69,60.919076433121,60.9208280254777,60.4207006369427,61.4015923566879,60.1770063694267,59.8596496815287,59.6578343949045,60.0611146496815,60.0079617834395,61.0314649681529,60.4982165605096,59.576178343949,60.1444904458599,59.9501592356688,60.8068152866242), c(61.046178343949,58.1761146496815,60.4333757961783,59.9696815286624,59.3815286624204,60.9741082802548,59.6559554140127,60.5732484076433,60.6894267515924,61.044203821656,59.931178343949,59.4819426751592,58.6553184713376,61.1898407643312,60.5426114649682,59.3907643312102,60.0437579617834,60.1094267515924,60.0064331210191,59.8281210191083,59.5013694267516,60.8798407643312,60.6855414012739,61.5238853503185,60.7260828025478,59.248949044586,60.5508917197452,59.9325477707006,59.5301910828025,60.0527388535032,60.9431210191083,59.1145541401274,59.2801910828025,60.1677707006369,59.5994585987261,59.2320063694267,60.3118789808917,60.801847133758,60.8154140127389,60.1263375796178,60.7790127388535,60.1875477707006,60.2964968152866,60.3666878980892,59.6014012738854,61.0240127388535,60.7969426751592,59.245,60.663152866242,61.3126433121019,60.447898089172,59.3614649681529,59.2055095541401,60.1053821656051,59.9242675159236,60.2578025477707,60.8513694267516,58.3081847133758,58.5672611464968,59.1809872611465,60.1503184713376,60.0743630573248,60.1732165605096,60.2839171974522,61.1309872611465,60.0924203821656,60.3432165605096,59.4116878980892,60.4738853503185,59.0579299363057,59.8163057324841,60.0550318471338,60.0014649681529,59.5484076433121,60.3057643312102,60.4140445859873,60.5958598726115,61.2854140127389,60.2399044585987,60.5053503184713,59.824203821656,60.989203821656,59.6955732484076,60.0785987261146,59.0173248407643,59.6819426751592,60.3176114649682,60.7818152866242,59.7049681528662,60.0686942675159,60.8742675159236,59.0914649681529,61.4695541401274,60.552101910828,59.4002547770701,60.3410828025478,60.7012738853503,60.5144904458599,59.6560191082803,60.4788535031847,60.3645222929936,59.4120700636943,60.2292993630573,59.2909554140127,59.9278662420382,58.9183757961783,60.2322292993631,61.551974522293,60.5312738853503,59.2037898089172,60.1787898089172,60.8143312101911,60.4057961783439,61.0727707006369,60.2409872611465,59.8076114649682,59.1655095541401,61.3667515923567,59.8884394904459,59.8824203821656,59.4906687898089,61.0455414012739,60.0213375796178,60.9354140127389,59.6150955414013,61.0712738853503,61.2024203821656,59.6272929936306,60.7886942675159,60.5985987261147,60.4888535031847,60.1143312101911,59.2643312101911,59.4061146496815,60.3850318471338,58.9592993630573,61.0555095541401,59.2156369426752,60.155,60.0606369426752,60.0939171974522,58.7500955414013,59.9883439490446,60.0471337579618,58.9571656050955,59.6201592356688,60.0616560509554,59.7668152866242,61.4127070063694,59.6583121019108,59.2770382165605,60.0632165605096,59.9720382165605,59.0078662420382,59.2098407643312,61.5252229299363,60.9706050955414,59.1827070063694,59.9828025477707,60.4334394904459,59.7533439490446,60.0336942675159,60.9295541401274,59.7282484076433,60.7632165605096,61.6702866242038,60.0409872611465,59.979872611465,61.3007643312102,61.0803821656051,59.2177388535032,59.4621656050955,60.8806369426752,61.0148089171974,59.5683121019108,60.5049681528662,60.4552229299363,58.6230891719745,59.7050318471338,60.2346815286624,60.2906369426752,60.2460828025478,59.8796815286624,60.2814012738854,61.1729617834395,59.3175796178344,59.8741401273885,60.6749363057325,59.0128662420382,60.0768789808917,60.1215923566879,57.8424203821656,61.1960191082803,60.3628343949045,60.7782484076433,60.6828662420382,61.0566560509554,60.2485350318471,60.138949044586,60.0508280254777) ) %>% purrr::reduce(c)) simSDoM <- data.frame(mean = list( c(59.7588917430597,59.8944572094188,60.9839626434119,60.6798705486915,60.8186566467587,61.3597763982235,61.3284138172637,59.7676940404699,60.859957043136,60.5522953907898,59.2465098115763,59.736084569419,59.6703449661941,60.5341051180542,59.981715401832,59.2583855398623,58.2742138433096,59.0000491944237,59.993064581743,59.4378147840095,60.5203993169088,60.5667380455007,60.8173806526032,61.5913769404935,61.3447937970333,59.5747256946318,59.5399288286923,59.8583660752289,59.6600509515479,60.4275189460079,59.7850291563314,59.5518338793789,59.7080226655715,59.8723685228513,60.0563231210755,60.1353815384324,59.9283894509478,59.9183090262782,59.2432831418853,60.2066397330036,60.2863576130474,59.7591450253998,59.5761111067485,60.5876970464061,61.4218357568107,59.8096538210289,60.4721746153591,60.4150526974107,60.6542676410745,59.650737535696,58.9918626840407,60.1250389594842,59.6361596688968,59.7750191226738,60.4191095966401,60.1811966701731,60.612957417785,59.4808238591511,59.0778988078306,59.7649094683586,59.3523828958804,61.5627235155007,60.2183661928891,59.2266614099336,59.7673516131503,59.7881866357501,58.9695926346687,59.5726643294009,59.8365024679704,60.8272655121895,59.1635455376999,60.0419604688849,59.6540319465268,59.6214231539207,60.1598315111993,59.179052421691,58.7589988223075,59.4338470239698,59.9862207687815,61.2217907526621,61.1277775410672,59.6754525164382,60.3759972761418,60.5615520432254,59.9384634610461,60.5603865539692,60.4391429957572,60.7123289179478,58.9491405308596,60.284985512851,59.7314863029287,60.4174047489251,59.2268861170776,60.6839764550678,60.4050125792139,61.5147382465856,60.0161605821625,60.4175394527646,60.0530031909177,59.8157068384971,59.286003432833,59.8719610178585,59.6871394547651,61.2471924403752,59.5297355700745,59.2356054008505,60.0859683065028,59.7961305123925,60.063813575257,60.2182480606133,59.3793196822151,61.5480145634206,59.8384810316507,60.6221731107875,60.6493078975424,59.0756830765886,60.7899499535498,59.7957779215393,60.4525853588511,60.3850147778723,59.7201021080432,60.3438907519421,59.7819180333054,59.8792451059189,59.988230447349,59.1860137400892,60.2550012874431,61.2929311624079,60.5628573302067,59.1826217612414,60.4099314693025,59.5292945933308,60.6848136608785,60.7735639196712,60.1171341832897,59.0859636294269,61.310205891744,61.3117154488175,60.0264879206908,60.5229985078491,58.122719789604,60.7895506724737,60.465635083026,60.127547624846,60.7154186123334,59.6821349488305,59.9994426812713,58.9574896721071,60.8643233781579,59.4374577800657,59.7511369625001,60.2620789123672,60.6460355215115,60.3463349515004,59.6197782776479,59.4466726295615,60.1408352137871,60.5744233335575,60.3996098256486,60.3586720298543,60.0074677254119,59.8836445537428,60.0699670935439,59.9548314586602,60.4640504863488,60.1103165539961,60.6906751917531,59.8572469159198,59.7488330940743,59.9070675495667,60.0910167461119,59.9023036559428,58.9798503451708,59.3004342612168,60.0971524581755,61.4714866370756,60.1348144238285,60.3732409413317,59.7772383145772,58.7695058923113,60.2407462690037,60.360641714887,59.6158725376674,59.6623444856176,60.5203044017352,59.6356343813199,58.9975516737764,58.5172275321097,60.8112896466016,60.0472692038476,60.3528902828765,59.7379948149309,59.6501742836214,59.4473737389464,60.1428795090969,60.1816292424458,60.8073625081934,59.7944352981859,59.1940678916639,60.8032742919017), c(59.530666874188,60.8884875156738,60.3575019404329,58.2810282608276,59.7034138688096,59.6850247006623,60.3460982569558,59.6459319164848,59.861431682497,60.5762661024429,60.0218004870194,59.8388467877816,59.9981603667657,59.5523892943964,59.8162004503622,60.2648261972851,61.6075982875652,59.5798479359515,61.2576454575129,60.4887726980084,60.2503289548239,60.0093891096938,60.7936085323536,61.1964728390723,60.1746037549553,60.1741769862031,59.5328941172477,59.6993208847916,59.1165998053535,59.4801273142816,59.4691223833074,59.4374685818685,60.7586829901746,60.3802276881013,61.2127579826396,61.3346338142009,60.7003763395411,60.9231264371872,58.5716307968546,60.4104787563856,60.2862698941946,60.4094165855767,59.6588461397033,58.9971297559393,59.9452505950082,60.519371644557,59.5845079333314,60.3993456140089,60.4507442187073,59.944112517794,60.2295034470762,59.5307353226377,60.2615568054985,60.4413461576593,59.3746352210159,60.5362299908142,60.6422496741627,60.2175932900429,59.0520530990458,60.397391735439,59.3945927065191,61.5071007430539,59.7208916852417,59.9326375001195,60.3903810605155,61.094873535985,59.9126253658811,60.0658256005568,59.6153729634227,59.3077306234341,60.9243896929552,60.602398584734,61.0682035003042,59.9524876999678,59.4986441191596,61.2517394636542,59.2714438489891,60.8212307029339,59.8204229624046,60.5989476767813,60.6273893537046,60.4376189408063,60.1586695179006,60.0513411375454,59.9890012770559,59.798552745548,59.5076268984696,60.36310918324,59.8719110481694,59.6617326691388,59.1191684223771,60.7666398711106,60.9825761743266,61.5087807233399,60.8125078200741,59.3286575774533,60.2314310452719,60.6970502117498,60.4610938707992,60.5227167785604,59.6537106565027,59.8658095076567,60.8986691092576,59.4675371376698,58.9832252805817,61.7522278865898,59.8225846710637,60.581100515679,59.6741786847289,59.7875527590939,59.5480060387495,60.274691896586,60.4979831112505,60.4303178356921,59.9431817266602,59.6302758821538,58.6405411375313,60.4362418807884,61.4562792770302,62.1487940834251,60.3854224676051,59.8302359309698,58.9114677323573,60.4332614474346,60.2465691931376,60.2654121079381,59.9506331601825,60.0711305225423,59.4272054203397,59.1305167849909,59.4749509029891,59.4745076022608,59.4953613664656,59.7486457155227,58.9803159170114,59.7379619726717,60.3582725488226,60.2806678019711,60.5048632954895,61.3895120495584,60.0784392661994,60.242258915747,61.5469028337006,60.4845609984882,60.4404695094447,60.6913648911077,60.1529653544604,60.8063808709262,59.4678982336154,59.4969366754253,59.1576130767396,60.0247539252398,59.6669194177906,59.1107321697064,60.771227784674,60.6782405530447,58.302352582313,59.282183083531,60.5523054441995,60.543360627896,60.208827459354,60.5428664321082,59.3630452349092,61.2847734444728,61.7218974396462,59.8393415067177,60.2763466918324,60.0756587505893,59.7428699760569,59.5910928750614,61.1059589570225,60.3214450082731,60.8345382762938,60.5894185923354,60.0648474389448,59.6829324804307,60.5430168283516,58.9443018947845,59.7483731362293,60.1060064579155,59.4967428412274,59.3482385234188,59.7105329915118,60.2777396818449,60.4265601150724,60.5643543927587,60.1602595073521,61.3480720048332,60.1050585138139,60.2935878507021,60.183484364727,60.0242209101817,59.7308944941635,60.8258978331436,60.7128139597231,59.776573505904,60.0132827722362,60.8486754945663,60.8491253222014,61.4390318381143), c(60.0096095495964,58.6809996705825,60.2756937799215,59.8823504414667,59.6118587591167,59.7120924059262,60.8663589803706,59.7538683932212,60.0343700693273,60.5427836971993,59.5328298504406,59.662517929128,59.3813896381686,60.7358712169759,60.3474946170839,59.4522575912185,60.762926611552,59.0399571328298,59.2183454264477,59.6835405321251,60.5559459727678,60.297728466055,60.7333817820875,59.8985793582704,60.1792994429298,59.5626453599132,60.626418944268,60.5269561247936,59.9757649334274,61.6085124238053,58.2495043140016,59.5137122658008,59.6163254425697,59.164182715705,60.4912825741827,59.6648100509728,61.1563226803055,59.4200234843674,60.4156809754187,59.7448498088947,60.3291391626157,59.5343782077219,60.6577123248963,60.5060697927544,60.3222602151583,60.3671763592725,59.9922553722583,61.2132801441289,60.2516715442386,60.4511431325814,60.7131773584482,60.9537966714909,61.1961047142451,59.3022463945896,59.8950779398287,60.4951148380698,59.0365999371635,59.8127181744942,60.0793798228761,59.4027938735997,59.5942379432556,60.2951266300762,59.9274979403639,59.9568431103847,58.8146675145915,60.2767600133241,59.2761845252668,60.441841012917,60.328523203378,59.9120375221231,61.1725696323549,59.6604126133944,60.6734160102807,61.229321960302,59.442054178748,59.642594963821,58.9299762336235,60.031991026814,60.685745787374,59.3572270744115,60.5476535358467,60.4813167354353,59.236145320708,60.3600323241234,60.7078693671994,59.7591472953061,60.1504996653717,59.1812835177357,60.5607595370552,60.2345623444139,60.6298799216303,59.4926994689967,59.6905239170842,61.0976606150953,60.5635454152301,59.2085051604724,59.9981560961669,59.7062669225262,60.6843165380039,59.927908450648,59.8027418481433,59.8323550900404,59.3582149932976,59.9168574137478,60.9053147522123,60.2353093646606,59.7751161538951,59.6531941068942,59.8749393096718,61.2431361527973,60.2672095592502,59.6571593332474,59.9642497954376,60.8454958843117,59.8976588053327,59.9969521070266,59.57260773092,62.0563829947083,60.5678626231672,59.768857336524,59.3415296119674,59.5219268211849,60.6328789474846,60.2044012083854,59.6830084930018,59.911712097604,59.9216908224711,60.088826594236,60.3598932183402,60.0852959495549,60.0630865389422,61.0920660361794,61.0032338455556,60.3967245885856,59.6649955062087,61.2509865552296,60.020012372724,60.7747050382667,59.3170234261691,59.7480758199113,60.2955055694806,59.1787904357197,60.5436646304922,60.2876005767972,60.7362239019336,60.1991633519744,59.3758782585434,60.6970015922837,61.2804244547162,59.4937434905902,60.3813335200885,60.9570947271601,59.8842279383554,59.8935591141508,60.2393815421066,59.8037745550141,59.8149758677998,61.1790695188317,61.463941549278,59.4833543725617,59.0759673341495,60.7769394847369,60.7108642192232,59.7394297591228,60.4010354795505,59.1755955153769,61.5188675563559,60.0408478702982,60.1005086046771,61.1353317604818,61.2562764937003,58.6246281154295,59.5218384239944,59.8667284377105,60.7335456295911,60.5220854055418,61.245093169961,60.4143795187427,59.9154961445522,61.2441570237443,60.5014861205114,58.929559983521,60.35265358197,59.5586768996659,59.3654175144267,60.4744337935364,59.2284670131124,60.1175438079164,59.9381473695702,59.658646102782,59.5308097298363,60.596919866747,60.0597820210964,59.6027932272816,60.2711238836619,60.1297842296562,59.9446120081984,60.6400057333987,60.88900382297,59.5697007760127), c(61.3261290139958,60.8120941007976,59.3389746199269,59.8864940319875,59.9702343046591,61.1546533117204,59.6217245635421,61.6591045060493,59.5585870345448,59.4787239833723,60.9664204910843,60.4149219268725,60.0891122905905,61.5448742225568,60.1492506225949,60.5295286653395,59.3993984174103,58.744658711481,59.3968359097341,61.0891514450465,60.7553997784106,60.4596315769758,60.6437635889136,60.6063487569981,60.5342784442188,60.5296857665087,59.9900894563879,60.6428159464162,59.8830013887129,59.4032360129865,60.1841506599384,60.0821657235679,59.7392402552358,60.2513260249844,59.5864660781688,59.9169856137467,60.5643014396155,59.6429367915281,59.8223724022059,61.2268219254029,58.873707973003,59.6485332338723,60.0407082565955,59.4658421165957,59.3177477793316,60.7415593931066,61.0437677676188,59.8432046765302,60.7296871871978,59.9470065636748,60.8919176665152,59.6885560234063,61.3307973388718,60.9942405710121,60.3823550096939,59.4921228250216,59.5571965753596,61.2993314884712,61.2658292506548,60.4007817156422,58.8114319349615,59.9093203917245,59.97032100163,61.0092619371867,59.1908258121854,59.5985106549561,60.1026401326151,60.8787332566329,59.1138678554328,60.0300896815409,60.2435081699687,61.2205565420449,59.3006712561574,59.7713888198321,58.8617140997569,59.8307197077579,59.1095895604376,60.7648038247214,59.2163661864549,61.4600727571819,59.9740222941699,60.4552729938783,61.2673514022465,62.2629426668024,61.022812676353,60.6462007005899,61.3835303379889,59.0074561291754,59.9214326873602,59.753420847834,60.4319588778558,60.6698907532607,60.1664846925084,60.7211351114956,60.4102842127074,59.3936547242943,60.3143163089017,60.8437555256814,59.8457753093843,58.5349140247802,59.3736882493877,60.5258782747811,59.58297439159,61.0942878332925,60.002631582667,60.3165510560565,59.7079988997994,60.5513510598373,60.4410542744449,60.9651081771602,59.5240768940464,60.849629170599,59.8808791936893,59.1688225750905,58.885871379653,60.234530268955,59.3710571182874,58.9114936325948,60.5636996745379,60.7470014170316,59.6882410897874,60.080805856823,61.1575222812582,60.331719168621,59.4438708561795,60.0579476006431,59.6298184656509,60.7125888400735,60.7322820847289,60.1099919112391,60.9203431075061,59.308315209583,59.6987850997316,59.7982679524458,59.124278111387,60.1720278730685,59.8575380277764,59.251390302563,59.6785737578727,59.370029212945,60.2781008819024,59.6902966993148,61.36368616623,60.7474767488787,59.9798875780049,60.6254500038286,60.0034605356412,59.6027466120976,59.1622926031632,59.5353328745795,60.5470379965997,60.0611438169625,60.0028460431322,59.3516351590905,59.9109083254828,60.8316117546808,59.7559841561232,59.9476064924199,59.9400885001734,59.0500403893681,59.6710350951886,59.9439835250382,59.3683848671757,59.1396935052354,59.7820587660652,59.6591214069358,59.394811315389,59.9622327357061,59.6680121113749,61.0316334017118,60.1278222980278,61.0647528832959,58.5406299098882,59.7182256242613,60.7124665823383,61.8336216741092,60.3137994535497,60.8250267882948,60.0845781131773,60.9096445623922,60.7022893557548,59.5942495262014,60.5345575808119,61.8208396091076,60.1901406056897,60.130479458639,59.7016353378152,59.1992928543209,61.4262172243993,60.6306764447324,59.2596371883028,58.7730085441379,60.5120639328772,60.3502685634136,59.6354573027548,59.6739488323224,60.6555863696654,60.9699673091905,61.5647138129864,59.4537323234602), c(60.6695815521804,59.6441998352113,61.3491463755832,60.0887023847572,59.5908328427489,60.2954671127551,59.7991036444437,59.814113997127,59.5663933951994,60.353348127578,59.1792707562573,60.2506125550034,59.6323523448602,60.5757335460023,60.1186549921193,60.0168194745208,60.6925921999031,60.6180652576061,61.5362381150017,59.9157820431914,59.7562749585094,60.6384983432627,60.7919493115937,60.3581780073885,59.8206743082405,57.8946289399936,60.2163514513746,60.2033341308216,59.7506066895417,59.905055855178,58.4025223626292,59.441548670785,59.2760492029892,59.8824445613063,60.5449737433193,60.1855608750121,61.8664088087641,60.2668269760888,59.6675279929039,59.5628740863026,60.1929355129432,59.9936055768661,60.4370670389749,60.1953983905953,59.9152052450626,59.0285715051758,61.5309610033415,59.1781938299306,60.4820425561825,60.0761943604693,59.6408200367892,60.5810652611315,61.1058262580893,59.6250477462056,60.017691160235,61.027898366119,60.4088877428535,60.7756928425459,60.302296337597,60.5748770753937,59.3698407705395,61.2974621958253,60.0963904911743,60.3582251832494,60.0773750863895,59.4287714250451,59.8006534698138,59.4571929040289,61.258143036526,60.2049933279903,58.3693532527488,60.0783209477314,60.0753207235338,60.9833693308873,60.8515860154156,60.0910197822717,62.1725226242798,60.1167023775651,60.2816060310067,59.6015835023149,59.1665103709205,60.2702628229201,58.6952473335314,60.088174174346,60.1388511216964,60.5038609941364,60.3475093703317,60.3651612785382,60.913456572941,60.9422100153358,59.687748471595,61.4721377185418,60.1765480046176,59.2466754913399,60.4667444447107,59.2198360847605,59.5247342181647,61.2157354136748,59.5915842603391,59.7266613816319,59.0973007973808,60.516601986903,59.9167450373914,60.2515403496572,59.7882971646563,60.2527563689263,58.889754207679,59.083108095208,60.0865147955744,60.7785446362905,59.7993004339763,60.3328253484169,58.6176297109174,60.3243143301882,60.0376619799519,60.0981575810723,60.6930049240127,59.995982536232,60.6414871445766,61.1144898083219,59.8575340051311,60.279202770733,59.4894660206417,59.7338850124031,59.2445168038706,59.9303799933449,59.6316649560908,60.5008947059161,58.3423571080556,59.6315347194301,60.600815452492,59.6779702262296,60.1166380745228,60.194057709357,59.1831202807502,59.6378063443035,60.1276630862186,60.090385190253,61.1696002097434,61.6078119319733,59.6123426719362,59.0880082602978,60.2432838741042,59.3112373498669,60.3743925316228,59.2872882554498,57.890958257317,59.3546293778389,60.05548941192,59.4680791919355,60.743841310564,59.5697643380717,60.2967104777372,59.9505381495463,59.2813372378942,59.6319397289762,60.2464975161653,60.9449745648837,58.9181037327687,60.8914820067583,61.2036564084059,60.1633656214146,59.8695218511589,59.7380098710844,59.6193059894016,60.6105946698555,59.727075265483,60.7206666593913,61.1024292586005,59.6149679474762,59.5809335734944,61.781705892107,59.7377516106666,57.9934829921399,60.0197174234106,60.9118273974453,60.6428368519589,60.7845280939168,60.1894389243614,60.3766569795719,60.2615032531037,61.8425219683731,59.7509185445018,61.1077454045702,60.2564631255193,58.9267960140798,61.022763387646,60.9373971199212,60.6200531637601,60.1381002633885,59.7687420333368,60.7366648057754,60.4593818314934,61.4351981119079,60.3690834583071,60.3736088133981,59.8189452373423,59.5687863298831,59.5771759107271,61.353196959761) ) %>% purrr::reduce(c)) # This code finds the confidence interval from a simulated sampling distribution. simSDoM <- arrange(simSDoM, desc(mean)) simSDoM$mean[25] simSDoM$mean[975] # Modify to find the confidence interval from the bootstrapped sampling distribution (bootSDoM). simSDoM <- arrange(simSDoM, desc(mean)) simSDoM$mean[25] simSDoM$mean[975] # This code finds the confidence interval from a simulated sampling distribution. simSDoM <- arrange(simSDoM, desc(mean)) simSDoM$mean[25] simSDoM$mean[975] # Modify to find the confidence interval from the bootstrapped sampling distribution (bootSDoM). bootSDoM <- arrange(bootSDoM, desc(mean)) bootSDoM$mean[25] bootSDoM$mean[975] ex() %>% { check_output_expr(., "bootSDoM$mean[25]") check_output_expr(., "bootSDoM$mean[975]") } success_msg("Nice job!")
Have you changed the variable to bootSDoM?
DataCamp: ch10-9

[1] 61.51474

[1] 58.81467

[1] 61.40159

[1] 58.66962

The two sets of confidence intervals are very close! When we use simulation, we get a confidence interval of 58.8 to 61.5, and when we use bootstrapping, we get a confidence interval of 58.7 to 61.4. The numbers you got with your random simulations and bootstrapping may be a little different, but are probably pretty close.

Responses