In: Statistics and Probability
R programming
a. obtain the dataset ChickWeight
b. obtain the mean weight at 16 days for all chicks on that
diet
# The R code is :
A=data.frame(ChickWeight) #Attaching the dataset ChickWeight in
a dataframe named A
A
wt=A$weight[Time==16] #Inserting the weights of each chick at the
16th day
wt
mean(wt) #calculating the mean of all those weights which give the
overall mean weight at 16 days for all chicks on that diet
The output is attached below: