Question
data(ChickWeight) # Create T | F vector indicating observations with Diet == 3 index
data(ChickWeight)
# Create T | F vector indicating observations with Diet == "3"
index <- ChickWeight$Diet == "3"
# Create vector of "weight" for observations where Diet == "3" and Time == 20
pre <- subset(ChickWeight[index, ], Time == 20, select = weight)$weight
pre
# Create vector of "weight" for observations where Diet == "3" and Time == 21
post <- subset(ChickWeight[index, ], Time == 21, select = weight)$weight
post
# The pre and post values are paired, each pair corresponding to an individual chick.
cbind(pre, post)
Perform a one-sided, paired t-test on the Time == 20 and Time == 21 paired data.
provide t_stat," "p_value," "crit_t" and "lower_ci."
You are to 'manually' implement the test, rather than use t.test(), but you can use t.test() to confirm your work.
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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started