Question: index
index <- ChickWeight$Diet == "3"
pre_data <- subset(ChickWeight[index, ], Time == 20, select = weight)$weight
post_data <- subset(ChickWeight[index, ], Time == 21, select = weight)$weight
cbind(pre_data, post_data)
Perform a one-sided, paired t-test on the above Time == 20 and Time == 21 paired data. You are to 'manually' implement the test, rather than use t.test(), but you can use t.test() to confirm your work. You should be able to match the t-statistic and associated p-value and 95% confidence interval of t.test().
Please bear in mind that our "alternative" hypothesis is weight gain from day 20 to 21, that we are using paired data, and that our confidence interval will extend to positive infinity.
Provide a screenshot of the console output with the t-statistic, p-value, the critical t-statistic for our desired confidence and the 95% confidence interval. How you do this is up to you, but one (1) method would be to create a list. The code below would create and output such a list assuming that the relevant values had been named "t_stat," "p_value," "crit_t" and "lower_ci."
list("t statistic" = t_stat,
"p-value" = p_value,
"critical t" = crit_t,
"conf interval" = list(lower = lower_ci, upper = "Inf"))
Also, provide all R code using RStudio
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
