cps <- read.table("http://s3.amazonaws.com/assets.datacamp.com/production/course_1276/datasets/cps_ch3.csv", header = T, sep = ";") # compute the t statistic by hand and assign it to tstat # use tstat to accept or reject the null # compute the t statistic by hand and assign it to tstat tstat <- (mean(cps$ahe12)-23.5)/(sd(cps$ahe12)/sqrt(length(cps$ahe12))) # use tstat to accept or reject the null tstat > qnorm(0.95) test_object("tstat") test_or({ test_function_result("qnorm") },{ test_student_typed("1-pnorm(tstat)") },{ test_student_typed("pnorm(tstat, lower.tail = F)") }) test_or(test_output_contains("T"), test_output_contains("F"))