wgain | R Documentation |
Weight gain data from 68 first year students during their first 12 weeks in college
wgain
A data frame with three columns and 68 rows:
Student number, 1 to 68.
Initial weight in kilogram
Final weight in kilogram
summary(wgain)
plot(wgain$initial, wgain$final)
abline(0, 1, col="red")
plot(wgain$initial, wgain$final, xlab="Wt in Week 1",
ylab="Wt in Week 12", pch="*", las=1)
abline(0, 1, col="red")
title("A scatter plot of the weights in Week 12 against
the weights in Week 1")
# 95% Confidence interval for mean weight gain
x <- wgain$final - wgain$initial
mean(x) + c(-1, 1) * qt(0.975, df=67) * sqrt(var(x)/68)
# t-test to test the mean difference equals 0
t.test(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.