Question 1

Question 1a

There are 71 observations in chickwts.

my_chickwts <- chickwts
my_chickwts$feed <- factor(my_chickwts$feed, levels = c("linseed", "casein", "horsebean", "meatmeal", "soybean", "sunflower"))

mean_chickgrowth <- by(my_chickwts$weight, my_chickwts$feed, mean)
sd_chickgrowth <- by(my_chickwts$weight, my_chickwts$feed, sd)
n_chicks <- by(my_chickwts$weight, my_chickwts$feed, length)
cbind(n_chicks, mean_chickgrowth, sd_chickgrowth)
##           n_chicks mean_chickgrowth sd_chickgrowth
## linseed         12         218.7500       52.23570
## casein          12         323.5833       64.43384
## horsebean       10         160.2000       38.62584
## meatmeal        11         276.9091       64.90062
## soybean         14         246.4286       54.12907
## sunflower       12         328.9167       48.83638

Question 1b

chickgrowth_anova = aov(weight ~ feed, data = my_chickwts)
summary(chickgrowth_anova)
##             Df Sum Sq Mean Sq F value   Pr(>F)    
## feed         5 231129   46226   15.37 5.94e-10 ***
## Residuals   65 195556    3009                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

There is a significant difference (p-value much less than 0.01) between the supplements.

Question 1c

plotmeans(my_chickwts$weight ~ my_chickwts$feed)

Question 1d

TukeyHSD(chickgrowth_anova)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = weight ~ feed, data = my_chickwts)
## 
## $feed
##                            diff         lwr       upr     p adj
## casein-linseed       104.833333   39.079175 170.58749 0.0002100
## horsebean-linseed    -58.550000 -127.513543  10.41354 0.1413329
## meatmeal-linseed      58.159091   -9.072873 125.39106 0.1276965
## soybean-linseed       27.678571  -35.683721  91.04086 0.7932853
## sunflower-linseed    110.166667   44.412509 175.92082 0.0000884
## horsebean-casein    -163.383333 -232.346876 -94.41979 0.0000000
## meatmeal-casein      -46.674242 -113.906207  20.55772 0.3324584
## soybean-casein       -77.154762 -140.517054 -13.79247 0.0083653
## sunflower-casein       5.333333  -60.420825  71.08749 0.9998902
## meatmeal-horsebean   116.709091   46.335105 187.08308 0.0001062
## soybean-horsebean     86.228571   19.541684 152.91546 0.0042167
## sunflower-horsebean  168.716667   99.753124 237.68021 0.0000000
## soybean-meatmeal     -30.480519  -95.375109  34.41407 0.7391356
## sunflower-meatmeal    52.007576  -15.224388 119.23954 0.2206962
## sunflower-soybean     82.488095   19.125803 145.85039 0.0038845

Casein and sunflower seed treatments yield a statistically significant different weight response to linseed.

Question 1e

Assuming that chicken weight gain is worth $0.93 per pound, what is the additional profit per chicken fed casein or sunflower seeds?

Additional profit per chicken fed casein = weight gain / grammes per pound * revenue per pound - (cost of casein feed - cost of linseed feed) = 104.8333 /453.592 * 0.93 - (0.41 - 0.22) = 0.0411181

Additional profit per chicken fed sunflower : 110.1667/453.592 * 0.93 - (0.30 - 0.22) = 0.1458749

Both casein and sunflower feeds are more cost-effective ways of growing chickens, yielding an extra 4 cents and 15 cents respectively. Sunflower seeds is the most cost-effective feed.

Question 2

Question 2a

table(CO2$Type, CO2$Treatment)
##              
##               nonchilled chilled
##   Quebec              21      21
##   Mississippi         21      21

The design is balanced, having identical numbers in each treatment ‘arm’.

Question 2b

uptake_aov <- aov(uptake ~ Treatment * Type, data = CO2)
summary(uptake_aov)
##                Df Sum Sq Mean Sq F value   Pr(>F)    
## Treatment       1    988     988  15.416 0.000182 ***
## Type            1   3366    3366  52.509 2.38e-10 ***
## Treatment:Type  1    226     226   3.522 0.064213 .  
## Residuals      80   5128      64                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
interaction.plot(CO2$Treatment, CO2$Type, CO2$uptake)

The main effect of ‘Treatment’, with a significant p-value of much less than 0.01, is to reduce carbon dioxide uptake of plants. The main effecty of ‘Type’ is that plants in Quebec have a higher carbon dioxide uptake than the plants in Mississippi.

The interaction effect between Treatment and Type is not significant (p > 0.05), although visually on the interaction plot, there appears to be an interaction effect, with a lesser reduction in CO2 uptake when plants in Quebec are chilled compared to plants in Mississippi.

Question 2c

missisippi_uptake <- aov(uptake ~ Treatment,
                         data = subset(CO2, CO2$Type == "Mississippi"))
summary(missisippi_uptake)
##             Df Sum Sq Mean Sq F value   Pr(>F)    
## Treatment    1   1079  1079.2   30.29 2.36e-06 ***
## Residuals   40   1425    35.6                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

With a p-value much less than 0.05, there is a significant decrease in CO2 uptake when grass is chilled in Mississippi. Cooler temperatures for plants might reduce the biological activity and metabolism of those plants, which includes photosynthesis which takes up carbon dioxide. This might particularly be the case for plants which are accustomed to warmer temperatures, such as those grown in Mississippi.