Day 13 - 09/18/2024

Interactions, effects & other interpretations

library(tidyverse)
url <- "https://raw.githubusercontent.com/jlacasa/stat705_fall2024/main/classes/data/lotus_part2.csv"
dd <- read.csv(url)

dd %>% 
  filter(species %in% c("A")) %>% 
  ggplot(aes(doy, crown_g))+
  geom_point(aes(fill = trt), shape = 21, size =3.5)+
  scale_fill_manual(values = c("#DB504A", "#43AA8B"))+
  labs(x = "Day of the Year", 
       y = "Crown biomass (g)", 
       fill = "Treatment")+
  theme_classic()+
  theme(aspect.ratio = 1)

Notation

m <- lm(crown_g ~ trt + doy, data = dd)
summary(m)

Call:
lm(formula = crown_g ~ trt + doy, data = dd)

Residuals:
     Min       1Q   Median       3Q      Max 
-0.40020 -0.13449 -0.00894  0.09488  0.78319 

Coefficients:
             Estimate Std. Error t value Pr(>|t|)    
(Intercept) -1.359492   0.137887  -9.859  1.6e-15 ***
trtflood    -0.030954   0.043359  -0.714    0.477    
doy          0.009197   0.000692  13.291  < 2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.1967 on 81 degrees of freedom
Multiple R-squared:  0.6861,    Adjusted R-squared:  0.6784 
F-statistic: 88.53 on 2 and 81 DF,  p-value: < 2.2e-16
m <- lm(crown_g ~ trt * doy, data = dd)
summary(m)

Call:
lm(formula = crown_g ~ trt * doy, data = dd)

Residuals:
     Min       1Q   Median       3Q      Max 
-0.35287 -0.13701 -0.01415  0.09433  0.73550 

Coefficients:
               Estimate Std. Error t value Pr(>|t|)    
(Intercept)  -1.5809069  0.1908532  -8.283 2.25e-12 ***
trtflood      0.4123418  0.2706453   1.524    0.132    
doy           0.0103322  0.0009681  10.673  < 2e-16 ***
trtflood:doy -0.0022714  0.0013692  -1.659    0.101    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.1946 on 80 degrees of freedom
Multiple R-squared:  0.6966,    Adjusted R-squared:  0.6852 
F-statistic: 61.21 on 3 and 80 DF,  p-value: < 2.2e-16

Notation for designed experiments

m <- lm(crown_g ~ trt * factor(doy), data = dd)
summary(m)

Call:
lm(formula = crown_g ~ trt * factor(doy), data = dd)

Residuals:
     Min       1Q   Median       3Q      Max 
-0.39578 -0.07140 -0.01645  0.07160  0.63792 

Coefficients:
                          Estimate Std. Error t value Pr(>|t|)    
(Intercept)              1.282e-01  5.038e-02   2.544   0.0129 *  
trtflood                 1.346e-16  7.125e-02   0.000   1.0000    
factor(doy)194           1.928e-01  6.171e-02   3.124   0.0025 ** 
factor(doy)237           8.372e-01  7.125e-02  11.750   <2e-16 ***
trtflood:factor(doy)194 -1.594e-02  9.426e-02  -0.169   0.8662    
trtflood:factor(doy)237 -1.806e-01  1.008e-01  -1.793   0.0769 .  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.1745 on 78 degrees of freedom
Multiple R-squared:  0.7619,    Adjusted R-squared:  0.7467 
F-statistic: 49.92 on 5 and 78 DF,  p-value: < 2.2e-16