Need assistance on a part of a project i am doing. This is what it is being aske
ID: 3326011 • Letter: N
Question
Need assistance on a part of a project i am doing. This is what it is being asked to do "Construct a sampling distribution for the pulses of females in the class. Randomly take groups of size n=4 with replacement and record the mean of each group. The more random samples you do, the better you see the illustration of the central limit theorem, but at least 30 samples of size n=4. After you're done with the process you should have another column: the entries for the means of the pulses of females. Very important, you should have at least 30 samples in the last columns otherwise the data analysis will not work."
Here is the data collected:
Thanks in advance!!!
Name Pulse #1 Pulse #2 Pulse #3 Brooke Henderson 75 79 74 Stefanie Nava 78 78 108 Hannah Caballes 66 66 78 Jocel Angeles 78 78 76 Chloe Hinzman 91 86 96 Kessia Forro 74 68 73 Micaela Hager 74 67 76 McKenna Hinzman 87 84 81 Faith Duarte 85 63 92 Juliette Le Bon De Lapointe 65 77 n/a Jacqueline Muniz 74 74 n/a Ashley Stahl 70 65 65 Rosa Olague 80 60 65 Makenzie Lynch 50 61 n/a Paige Monyeur 79 81 64 Regina Paz Navarro 63 63 63 Brenda Torres 58 66 64 Helena Syed 66 66 70 Nikita Baranov 82 79 82 Carleigh Norris 64 74 88 Leen Azmeh 56 63 61 Emily Resberg 67 68 63 Rebekah Sterns 51 73 57 Caroline Jensen 83 78 68 Laine Wilson 56 68 73 Rhiannon Bendal 70 52 59 Kirstin Merril 74 74 78 Angela Sims 86 90 n/a Brooke Gehrke 79 76 82 Nicole Buechler 97 76 85 April Preciado 84 77 80Explanation / Answer
95% Confidence interval: [46.64677,56.94768]
Find the R-code for the solution BELOW. Sorry to send incomplete answer before. Sent by mistake.
-------------
dats = read.csv(file = "dats.csv", header = TRUE, sep = ",")
colnames(dats) = c("name","p1","p2","p3")
dats$p1 = as.numeric(dats$p1)
dats$p2 = as.numeric(dats$p2)
dats$p3 = as.numeric(dats$p3)
## Get mean pulse of the females
l = list()
for(i in 1:nrow(dats))
{
l[i] = (dats$p1[i] + dats$p2[i] + dats$p3[i])/3
}
dats$mnp = l
rm(l)
## Get the 30 4-sized samples
k = list()
kj = list()
for(j in 1:30)
{
k = as.list(sample(x = dats$mnp, size = 4, replace = TRUE))
kj[[j]] = k
}
samp_data = kj
rm(kj)
rm(k)
## Get mean pulse of the 30 4-sized samples
s1 = as.array(samp_data[[1]])
for(j in 2:30)
{
s2 = as.array(samp_data[[j]])
s1 = rbind(s1,s2)
}
rm(s2)
samp_final = as.data.frame(s1, row.names = FALSE)
rm(s1)
colnames(samp_final) = c("s1","s2","s3","s4")
## Get mean pulse of the samples
l = list()
for(i in 1:nrow(samp_final))
{
if(i == 1)
l[i] = (samp_final$s1[i]$s1 + samp_final$s2[i]$s1 + samp_final$s3[i]$s1 + samp_final$s4[i]$s1)/4
else
l[i] = (samp_final$s1[2]$s2 + samp_final$s2[i]$s2 + samp_final$s3[i]$s2 + samp_final$s4[i]$s2)/4
}
samp_final$means = l
# 95% confidence interval => 2-tailed, alpha levels of 0.025 and 0.975 => Z-critical = -1.64 and +1.64
Zcrit = 1.64
mean_samp_means = mean(as.numeric(l))
var_samp_means = var(as.numeric(l))
sd_samp_means = sqrt(var_samp_means)
CIlower = mean_samp_means - Zcrit*sd_samp_means
CIupper = mean_samp_means + Zcrit*sd_samp_means
## => Confidence interval: [46.64677,56.94768] -- [ANSWER]
----------
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.