Photosynthesis in aquatic plants is often inhibited due to the salinity of the water. Some plants such as Cymodocea nodosa seagrass appear to thrive in waters with high salinity. To determine the stress of Cymodecea nodosa seagrass seedlings in four levels of salinity (05PSU, 11PSU, 18PSU, and 36PSU), with two levels of spermidine (YES, NO), plant stress was determined by taking the ratio of \(F_v/F_m\) of four vessels each with two Cymodecea nodosa seagrass seedlings that were randomly assigned to the eight treatments. \(F_v\) is the variable fluorescence, and \(F_m\) is the maximal fluorescence. The ratio \(F_v/F_m\) is stored under the variable name fluorescence in the SEAGRASS.csv file. The treatment structure is a 2 \(\times\) 4 factorial experiment with 32 experimental units, where an experimental unit is a vessel containing two Cymodecea nodosa seagrass seedlings. The data stored at (https://raw.github.com/alanarnholt/Data/master/SEAGRASS.csv) is part of a larger study by Elso, Garc-Jim’enez, and Robaina (2012). Plants not under stress typically have \(F_v/F_m\) values between 0.7 and 0.8. Salinity for this study was recorded in practical salinity units (PSU), where 36PSU corresponds to typical ocean salinity.

Q1

Download the SEAGRASS.csv file using the source_data() function from the repmis package and store the results in an object named SEAGRASS.

A1

SEAGRASS <- repmis::source_data("https://raw.github.com/alanarnholt/Data/master/SEAGRASS.csv")
Downloading data from: https://raw.github.com/alanarnholt/Data/master/SEAGRASS.csv 

SHA-1 hash of the downloaded data file is:
58d3636d52e812be37ef6d7b14f4bd25baf79ccc
head(SEAGRASS)
  fluorescence spermidine salinity
1    0.6541250         NO    05PSU
2    0.5437917         NO    05PSU
3    0.5454167         NO    05PSU
4    0.5878333         NO    05PSU
5    0.7058750        YES    05PSU
6    0.6670000        YES    05PSU
str(SEAGRASS)
'data.frame':   32 obs. of  3 variables:
 $ fluorescence: num  0.654 0.544 0.545 0.588 0.706 ...
 $ spermidine  : Factor w/ 2 levels "NO","YES": 1 1 1 1 2 2 2 2 1 1 ...
 $ salinity    : Factor w/ 4 levels "05PSU","11PSU",..: 1 1 1 1 1 1 1 1 2 2 ...

Q2

Find the mean and standard deviation of fluorescence for the 8 treatment combinations. Does it appear that plants are more stressed without spermidine and at lower levels of salinity?

A2

with(data = SEAGRASS, 
     tapply(fluorescence, list(spermidine, salinity), mean)
     )
        05PSU     11PSU     18PSU     36PSU
NO  0.5827917 0.7074583 0.7736958 0.7818125
YES 0.6700104 0.7239271 0.8026875 0.7990209
with(data = SEAGRASS, 
     tapply(fluorescence, list(spermidine, salinity), sd)
     )
         05PSU      11PSU      18PSU      36PSU
NO  0.05174214 0.06391753 0.01106553 0.00976514
YES 0.02473667 0.04936795 0.02479287 0.01492331

Yes, the plants that have the lowest mean fluorescence values have the lowest salinity concentrations and do not have spermidine.

Q3

Are the assumptions for a factorial model satified with this data?

A3

SEAGRASS.mod <- aov(fluorescence ~ spermidine*salinity, data = SEAGRASS)
library(car)
qqPlot(SEAGRASS.mod, envelope = FALSE, distribution = "norm")

shapiro.test(rstandard(SEAGRASS.mod))

    Shapiro-Wilk normality test

data:  rstandard(SEAGRASS.mod)
W = 0.9603, p-value = 0.2791
leveneTest(SEAGRASS.mod)
Levene's Test for Homogeneity of Variance (center = median)
      Df F value Pr(>F)
group  7  0.8973 0.5243
      24               

Neither the qqPlot nor the Shapiro-Wilk normality test suggest any deviations from normality with respect to the error terms of the factorial model stored in SEAGRASS.mod. The Levene’s test of homogeneity of variance finds insufficient evidence to suggest variances are not equal. The assumptions for a factorial model appear to be satisfied.

Q4

Create interaction plots for the factors spermidine and salinity. Based on your graphs, is there interaction between spermidine and salinity?

A4

library(ggplot2)
ggplot(data = SEAGRASS, aes(x = salinity, y = fluorescence, color = spermidine,
                            group = spermidine, linetype = spermidine)) +
  stat_summary(fun.y = mean, geom = "point") +
  stat_summary(fun.y = mean, geom = "line") + 
  theme_bw()

ggplot(data = SEAGRASS, aes(x = spermidine, y = fluorescence, color = salinity,
                            group = salinity, linetype = salinity)) +
  stat_summary(fun.y = mean, geom = "point") +
  stat_summary(fun.y = mean, geom = "line") + 
  theme_bw()

The lines in the second graph cross suggesting a small amount of interaction may be present.

Q5

Write the hypotheses to test the main effects and the interaction for a 2 factor factorial design.

A5

Q6

Test the hypotheses from Q4.

A6

SEAGRASS.mod <- aov(fluorescence ~ spermidine*salinity, data = SEAGRASS)
SR <- summary(SEAGRASS.mod)
SR
                    Df  Sum Sq Mean Sq F value   Pr(>F)    
spermidine           1 0.01123 0.01123   8.270  0.00832 ** 
salinity             3 0.14379 0.04793  35.285 5.83e-09 ***
spermidine:salinity  3 0.00680 0.00227   1.668  0.20044    
Residuals           24 0.03260 0.00136                     
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Based on the p-value of 0.0083219 there is evidence to suggest some effect levels of spermidine are not zero. Based on the p-value of 5.829994810^{-9} there is evidence to suggest some effect levels of salinity are not zero. Based on the p-value of 0.2004416 there is not sufficient evidence to suggest any effect interactions are not zero.

Q7

Create and plot 99% family wise confidence intervals for the pairwise differences of the factors spermidine and salinity using the function TukeyHSD(). Interpret your confidence intervals.

A7

plot(TukeyHSD(SEAGRASS.mod, which = c("spermidine", "salinity"), conf.level = 0.99))

We can be 99% confident that adding spermidine reduces (increases the value of fluorescence) plant stress. We can be 99% confident that all pair-wise levels of salinity except 36PSU and 18PSU are significantly different in the amount of stress they produce on Cymodecea nodosa seagrass seedlings.

Q8

Compute the means and the effects for the variables spermidine and salinity in the factorial model using the function model.tables().

A8

model.tables(SEAGRASS.mod, type = "means", se = TRUE, 
             cterms = c("spermidine", "salinity"))
Tables of means
Grand mean
          
0.7301755 

 spermidine 
spermidine
    NO    YES 
0.7114 0.7489 

 salinity 
salinity
 05PSU  11PSU  18PSU  36PSU 
0.6264 0.7157 0.7882 0.7904 

Standard errors for differences of means
        spermidine salinity
           0.01303  0.01843
replic.         16        8
model.tables(SEAGRASS.mod, type = "effects", se = TRUE, 
             cterms = c("spermidine", "salinity"))
Tables of effects

 spermidine 
spermidine
       NO       YES 
-0.018736  0.018736 

 salinity 
salinity
   05PSU    11PSU    18PSU    36PSU 
-0.10377 -0.01448  0.05802  0.06024 

Standard errors of effects
        spermidine salinity
          0.009214 0.013031
replic.         16        8

Q9

Assume the true means for the eight treatments are:

# MEANS <- c(0.65, 0.68, 0.71, 0.74, 0.77, 0.78, 0.79, 0.80)
# MEANS <- c(0.6, 0.68, 0.74, 0.78, 0.68, 0.74, 0.78, 0.81)
# MEANS <- c(0.6, 0.70, 0.72, 0.73, 0.77, 0.8, 0.79, 0.8)
MEANS <- c(0.6, 0.68, 0.75, 0.78, 0.70, 0.75, 0.79, 0.8)
M <- matrix(MEANS, byrow = TRUE, nrow = 2)
dimnames(M) <- list(c("NO", "YES"), c("05PSU", "11PSU", "18PSU", "36PSU"))
M
    05PSU 11PSU 18PSU 36PSU
NO    0.6  0.68  0.75  0.78
YES   0.7  0.75  0.79  0.80

Compute the power for testing differences in salinity if there are n = 6 measurements per treatment assuming \(\sigma = 0.05, \sigma = 0.1,\) and \(\sigma = 0.15\) for the seedlings ratio \(F_v/F_m\).

A9

A function is written to find \(\lambda\) for each value of \(\sigma\) and then return the power for \(H_0: \beta_i = 0\) for all \(i\) versus \(H_1: \beta_i \neq 0\) for some \(i\) assuming \(n = 6\).

alpha <- 0.05
n <- 6
a <- 2
b <- 4
Sigma <- 0.05
PowerH1 <- numeric(3)
for(i in 1:3){
Y <- rep(MEANS, each = n)
Tsper <- factor(rep(rep(c("NO", "YES"), each = n), b))
Tsali <- factor(rep(c("05PSU","11PSU","18PSU","36PSU"), each = n*a))
NDF <- data.frame(Y, Tsper, Tsali)
summary(aov(Y ~ Tsper*Tsali, data = NDF))
SShypTsali <- summary(aov(Y ~ Tsper*Tsali, data = NDF))[[1]][2, 2]
lambdaTsali <- SShypTsali/Sigma^2
critF2 <- qf(1 - alpha, b-1, a*b*(n-1))
PowerH1[i] <- pf(critF2, b-1, a*b*(n-1), lambdaTsali, lower = FALSE) 
Sigma <- Sigma + 0.05
}
PowerH1
[1] 0.9999998 0.9122272 0.5593670

With 6 observations per treatment, the power to detect differences in the specified means assuming \(\sigma = 0.05, 0.10,\) and \(0.15\) are 0.9999998, 0.9122272, and 0.559367, respectively.

Q10

Assuming the standard deviation for all seedlings fluorescence ratio \(F_v/F_m\) is \(\sigma = 0.1\), find the minimum \(n\) per treatment group needed to have a power of at least 0.80 to detect differeces in spermidine.

A10

alpha <- 0.05
npg <- 1
PowerH2 <- 0
a <- 2
b <- 4
Sigma <- 0.1
while(PowerH2 < 0.80){
  npg <- npg + 1
  Y <- rep(MEANS, each = npg)
  Tsper <- factor(rep(rep(c("NO", "YES"), each = npg), b))
  Tsali <- factor(rep(c("05PSU","11PSU","18PSU","36PSU"), each = npg*a))
  NDF <- data.frame(Y, Tsper, Tsali)
  summary(aov(Y ~ Tsper*Tsali, data = NDF))
  SShypTsper <- summary(aov(Y ~ Tsper*Tsali, data = NDF))[[1]][1, 2]
  lambdaTsper <- SShypTsper/Sigma^2
  critF2 <- qf(1 - alpha, b-1, a*b*(npg-1))
  PowerH2 <- pf(critF2, b-1, a*b*(npg-1), lambdaTsper, lower = FALSE)  
}
c(npg, lambdaTsper, PowerH2)
[1] 31.0000000 11.1987500  0.8045788

One needs 31 experimental units per treatment to be able to detect differences in spermidine with a power of at least 0.80.

References

Elso, M Zarranz, P Garc-Jim’enez, and RR Robaina. 2012. “Endogenous Polyamine Content and Photosynthetic Performance Under Hypo-Osmotic Conditions Reveal Cymodocea Nodosa as an Obligate Halophyte.” Aquat. Biol. 17 (1). Inter-Research Science Center: 7–17. doi:10.3354/ab00454. http://dx.doi.org/10.3354/ab00454.