R Questions In these questions you are going to be creating some sample distribu
ID: 3206161 • Letter: R
Question
R Questions
In these questions you are going to be creating some sample distributions!
R1. IQ scores are a (supposed) measure of intelligence. The test is designed so that scores are normally distributed with a mean of 100 with a standard deviation of 15. You can simulate asking 50 people their IQ (a sample of size 50) by doing: mean = 100, sd = 15)
Find the mean IQ score for this sample of 50. Now find the mean IQ for a few new samples of 50. Why do you get different answers? [reason for different answers]
R2. Now, write code that creates 1000 different samples of 50 people’s IQ scores. For each sample, calculate the mean, and then make a histogram of the 1000 means. We have our first sampling distribution! What general shape is it supposed to be? Where should it be centered? With what spread? [code, rough sketch of the histogram, answers]
R3. Does the shape of the histogram (from R2) change if we start with a population that is shaped differently? In R2, we started with IQ scores, which are N(100,15). This time we will start with a uniform distribution on the interval [-30, 30]. Generate 1000 samples of size 50 from this distribution, find the mean of each sample, and make a histogram of the 1000 means. Does the shape of your histogram seem to depend on the shape of the population you are sampling from? [code, sketch of histogram, answer]
R4. What should the spread of the histogram from R3 be? Give an exact result. You can check if your answer is correct by finding the standard deviation of the means from R3. [work, answer]
Explanation / Answer
Result:
R Questions Q1 answered.
In these questions you are going to be creating some sample distributions!
R1. IQ scores are a (supposed) measure of intelligence. The test is designed so that scores are normally distributed with a mean of 100 with a standard deviation of 15. You can simulate asking 50 people their IQ (a sample of size 50) by doing: mean = 100, sd = 15)
Find the mean IQ score for this sample of 50. Now find the mean IQ for a few new samples of 50. Why do you get different answers? [reason for different answers]
R code:
oneSample = rnorm(50, mean = 100, sd = 15)
summary(oneSample)
Sample2 = rnorm(50, mean = 100, sd = 15)
summary(Sample2)
Sample3 = rnorm(50, mean = 100, sd = 15)
summary(Sample3)
Sample4 = rnorm(50, mean = 100, sd = 15)
summary(Sample4)
Sample5 = rnorm(50, mean = 100, sd = 15)
summary(Sample5)
Sample6 = rnorm(50, mean = 100, sd = 15)
summary(Sample6)
R output:
oneSample = rnorm(50, mean = 100, sd = 15)
> summary(oneSample)
Min. 1st Qu. Median Mean 3rd Qu. Max.
62.28 90.71 99.64 100.20 111.10 130.00
> Sample2 = rnorm(50, mean = 100, sd = 15)
> summary(Sample2)
Min. 1st Qu. Median Mean 3rd Qu. Max.
62.30 89.13 98.32 99.81 110.60 142.10
> Sample3 = rnorm(50, mean = 100, sd = 15)
> summary(Sample3)
Min. 1st Qu. Median Mean 3rd Qu. Max.
61.85 90.85 98.41 98.36 105.90 128.70
> Sample4 = rnorm(50, mean = 100, sd = 15)
> summary(Sample4)
Min. 1st Qu. Median Mean 3rd Qu. Max.
72.6 91.4 101.7 101.1 110.8 129.5
> Sample5 = rnorm(50, mean = 100, sd = 15)
> summary(Sample5)
Min. 1st Qu. Median Mean 3rd Qu. Max.
68.64 93.21 101.40 103.10 113.50 147.60
> Sample6 = rnorm(50, mean = 100, sd = 15)
> summary(Sample6)
Min. 1st Qu. Median Mean 3rd Qu. Max.
71.57 89.07 95.46 98.86 109.60 138.70
We generated 50 random draws from the normal distribution with different seed. Setting with the different seed means locking in the sequence of “random” (they are pseudorandom) numbers that R gives different sample means.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.