chapter 3: 1-3, 5, 7-9, 10, 11, 16, 17. For 10-17, list steps 1-5 of DOE

  1. An experimenter has conducted a single-factor experiment with four levels of the factor, and each factor level has been replicated six times. The computed value of the F-statistic is \(F_0\) = 5.81. Find bounds on the p-value.
pf(5.81, 3, 17,lower.tail=FALSE)
## [1] 0.006360579
  1. An experimenter has conducted a single-factor exeriment with six levels of the factor, and each factor level has been replicated three times. The computed value of the F-statistic is \(F_0\) = 5.81. Find bounds on the P-value.
pf(5.81, 5, 13,lower.tail=FALSE)
## [1] 0.004933094
  1. An experimenter has conducted a single-factor completely randomized design with five levels of the factor and five replicates. The computed value of the F-statistic is 4.87. Find bounds on the P-value.
pf(4.87, 4, 21,lower.tail=FALSE)
## [1] 0.006155146
  1. The mean square for error in the ANOVA provides an estimate of X (a) The variance of the random error
    1. The variance of an individual treatment average
    2. The standard deviation of an individual observation
    3. None of the above
  2. A computor ANOVA output is shown below. Fill in the blanks. You may give bounds on the P-value.
SS_t <- 196.04
SS_f <- 36.15
SS_e <- SS_t - SS_f
DF_t <- 19
DF_f <- 3
DF_e <- DF_t - DF_f
MS_f <- SS_f / DF_f
MS_e <- SS_e / DF_e
F <- MS_f / MS_e
P <- pf(F, DF_f, DF_e, lower.tail = FALSE)
# missing values
SS_e
## [1] 159.89
DF_e
## [1] 16
MS_f
## [1] 12.05
MS_e
## [1] 9.993125
F
## [1] 1.205829
P
## [1] 0.3395233
  1. A computor ANOVA output is shown below. Fill in the blanks. You may give bounds on the P-value.
SS_t2 <- 1174.24
SS_e2 <- 186.53
SS_f2 <- SS_t2 - SS_e2
DF_t2 <- 29
DF_e2 <- 25
DF_f2 <- DF_t2 - DF_e2
MS_f2 <- 246.93 
MS_e2 <- SS_e2 / DF_e2
F2 <- MS_f2 / MS_e2
P2 <- pf(F2, DF_f2, DF_e2,lower.tail=FALSE)
# missing values
SS_f2
## [1] 987.71
DF_f2
## [1] 4
MS_e2
## [1] 7.4612
F2
## [1] 33.09521
P2
## [1] 1.184655e-09
  1. Is this study really a designed experiment? Does it establish a cause-and-effectlink between chocolate consumption and depression? How would the study have to be conducted to establish such a cause-and-effect link?

    1. Problem: Does PEMF usage effect BMD loss?
    2. Factor of Interest: The IV is the PEMF time per day. with 3 catagorical levels: 1hrs, 42hrs, 4hrs.
    3. Response Variable: THe DV is the BMD (Bone Mineral Density) and it is continuous.
    4. Choice of Design: The design is experimental, the DV is cont., we care about mean differences, and are using more than 2 levels, so use ANOVA.
    5. Analysis: The data below was collected over 16 weeks, patients and the times worn were randomly selected, it was double-blind, and sham-controlled.
sham <- c(4.51,7.95,4.97,3.00,7.97,2.23,3.95,5.64,9.45,6.52,4.96,6.10,7019,4.03,2.72,9.19,5.17,5.70,5.85,6.45)
PEMF1 <- c(5.32,6.00,5.12,7.08,5.48,6.52,4.09,6.28,7.77,5.68,8.47,4.58,4.11,5.72,5.91,6.89,6.99,4.98,9.94,6.38)
PEMF2 <- c(4.73,5.81,5.69,3.86,4.06,6.56,8.34,3.01,6.71,6.51,1.70,5.89,6.55,5.34,5.88,7.50,3.28,5.38,7.30,5.46)
PEMF4 <- c(7.03,4.65,6.65,5049,6.98,4.85,7.26,5.92,5.58,7.91,4.90,4.54,8.18,5.42,6.03,7.04,5.17,7.60,7.90,7.91)
PEMF <- data.frame(cbind(PEMF1,PEMF2,PEMF4))
stack <- stack(PEMF)
# aov(PEMF~sham, data= stack) I could not get the ANOVA function to work 
    1. Problem: Does the mixing technique affect the strength of the cement?
    2. Factor of Interest: The IV is the mixing technique. There are 4 techniques being tested.
    3. Response Variable: The DV is the strength of the cement. It is continuous.
    4. Choice of Design: The design is experimental, the DV is continuous, mean differences matter, and there are 4 levels. ANOVA should be used.
    5. Analysis: The experiment was completely randomized.
mt <- c(1,2,3,4)
ts1 <- c(3129, 3000, 2865, 2890)
ts2 <- c(3200, 3300, 2975, 3150)
ts3 <- c(2800, 2900, 2985, 3050)
ts4 <- c(2600, 2700, 3600, 2765)
ts <-data.frame(cbind(ts1,ts2,ts3,ts4))
stacked <- stack(ts)
# aov(ts~mt,data=stacked) I could not get the ANOVA function to work
  Conclusion:
    1. Problem: Does the dosage level of the drug affect bioactivity of the drug?
    2. Factor of Interest: The IV is the dosage level of the drug. They tested 3 different levels: 20g, 30, 40g.
    3. Response Variable: The DV is the bioactivity of the drug. The DV is continuous.
    4. Choice of Design: The design is experimental, the DV is continuous, mean differences matter, and there are 3 levels. ANOVA should be used.
    5. Analysis: The experiment was randomized and single-factored.
dosage <- c(20,30,40)
ob20 <- c(24,28,37,30)
ob30 <- c(37,44,31,35)
ob40 <- c(42,47,52,38)
ob <- data.frame(cbind(ob20,ob30,ob40))
stacked2 <-stack(ob)
# aov(ob~dosage, data=stacked2) I could not get the ANOVA function to work
    1. Problem: Does the type of car affect the time it is rented for?
    2. Factor of Interest: The V is the type of car. It is catagorical with 4 levels: Subcompact, Midsize, Compact, Full size.
    3. Response Variable: The DV isthe rental contract length. It is continuous.
    4. Choice of Design: Since the DV is continuous, and the mean difference matter the test should be ANOVA.
    5. Analysis:
car <- c("subcompact", "Compat", "Midsize", "Full size")
sub <- c(3,5,3,7,6,5,3,2,1,6)
comp<- c(1,3,4,7,5,6,3,2,1,7)
mid <- c(4,1,3,5,7,1,2,4,2,7)
full<- c(3,5,7,5,10,3,4,7,2,7)
observe <- data.frame(cbind(sub,comp,mid,full))
stack2 <- stack(observe)
# aov(observe~car, data= stack2) I could not get the ANOVA function to work

Derivation of ANOVA Equation

\(\sum_{1}^N (Y_{ij} - \bar{Y_{..}})^2\) => \(\sum_{1}^N Y_{ij}^2 - 2\bar{Y_{..}}\sum_{0}^n Y_{ij} + N\bar{Y_{..}}^2\) => \(\sum_{1}^N Y_{ij}^2 - 2\bar{Y_{..}}N\bar{Y_{..}} + N\bar{Y_{..}}^2\) => \(\sum_{1}^N Y_{ij}^2 - N\bar{Y_{..}}^2\) => \(\sum_{i=0}^I Y_{ij}^2 - \frac{\bar{Y_{..}}^2}{N}\)