In: Math
1)code in R
data = read.csv("../Documents/Tutoring/Software/random data/test_Score.csv")
colnames(data) [1:2] = c("student","test_Score")
#install.packages("dplyr")
library(dplyr)
data %>% group_by(year) %>% summarise(mean_Score =
mean(test_Score),sd_Score = sd(test_Score),n_Score = n())
%>%
mutate(se_Score = sd_Score/sqrt(n_Score), lower.ci_Score =
mean_Score - qt(1 - (0.05 / 2), n_Score - 1) * se_Score,
upper.ci_Score =
mean_Score + qt(1 - (0.05 / 2), n_Score - 1) * se_Score)
95% confidence interval are in columns lower.ci_Score and upper.ci_Score
we are 95% confident that actual mean lies in this confidence interval
Does each confidence interval include the population mean for all years? Explain why or why not.
No, we are 95% confident only,
Please post next question
+ mutate(se_Score = sd_score/sqrt(n_Score), Tower.ci_Score = mean_Score - qt(- (0.05 / 2), n_Score - 1) * se_score, upper.ci_Score = mean_Score + qt(1 - (0.05 / 2), n_Score - 1) * se_Score) # A tibble: 10 x 7 year mean_Score sd_Score n_Score se_Score lower.ci_Score upper.ci_Score <int> <db7> <db7> <int> <db7> <db7> <db7> 2002 59.6 5.03 210 0.347 58.9 60.3 2003 59.8 5.18 218 0.351 59.1 60.5 2004 60.0 6.67 189 0.485 59.1 61.0 2005 60.4 4.98 217 0.338 59.7 61.0 2006 59.6 4.88 0.337 58.9 60.3 2007 59.9 4.86 190 0.353 59.2 60.6 2008 60.2 5.29 201 0.373 59.4 60.9 2009 58.5 5.59 0.386 57.7 59.2 2010 58.6 5.28 0.362 57.8 59.3 10 2011 60.1 4.88 293 0.285 59.5 60.7 210 210 212