I got the dataset from… The data originaly came from… There were X rows and Y columns in the dataset. The names of the columns were
names(ChickWeight)
## [1] "weight" "Time" "Chick" "Diet"
Here is what each means:
library(yarrr)
First, I calculated the average weight of chickens at each time point.
# TASK 9
aggregate(weight ~ Time, data = ChickWeight, FUN = mean)
## Time weight
## 1 0 41.06000
## 2 2 49.22000
## 3 4 59.95918
## 4 6 74.30612
## 5 8 91.24490
## 6 10 107.83673
## 7 12 129.24490
## 8 14 143.81250
## 9 16 168.08511
## 10 18 190.19149
## 11 20 209.71739
## 12 21 218.68889
I found that the mean weight at time 0 was 41.06. The mean weight at time 21 was 218.69.
Next, I created a pirate plot of the distibution of weights at each time
### TASK 8
pirateplot(dv.name = "weight",
iv.name = "Time",
data = ChickWeight,
main = "Chicken Weights over Time")
The plot clearly shows that the chickens got heavier over time. The standard deviation of weights appeared to increase as well.
To see if the relationship was significant, I conducted a correlation test between time and weight:
### Task 4
cor.test(ChickWeight$Time, ChickWeight$weight)
##
## Pearson's product-moment correlation
##
## data: ChickWeight$Time and ChickWeight$weight
## t = 36.725, df = 576, p-value < 2.2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.8109073 0.8599481
## sample estimates:
## cor
## 0.8371017
There was a significant positive correlation between time and weight, r = 0.84, t(576) = 36.73, p < .01.
blah blah blah blah