Creation of R markdown: August 2, 2022

Dataset CSV File image: excel to csv dataset image

Objective:

Biochar, also known as charcoal, is used as soil amendment in agriculture to assist with plant growth. This study will focus on both the shoot and root system of the plant. Plant growth will be measured by weight (g) of each system.

-Shoot: everything above ground
-Shallow Roots: grow horizontal, conserve water when rains
-Deep Roots: grow deep into ground to obtain water

The dataset above shows a complete randomized design of 32 plants grown under three main factors: wheat varieties, soil type, and biochar treatment. There are four replicates for each combination of those factors (total: 8 different treatments). Considering the combination of the three main factors, can plant growth be seen in each type of environment in regards to the five variables of interest?

3 Main Factors
-Wheat Varieties: 76 or 1RS
-Soil Type: soil or soil-sand
-Biochar Treatment: present or absent

5 Variables of Interest:
-Shoot Weight
-Shallow Shoot Weight
-Deep Shoot Weight
-Total Root Weight
-Root:Shoot Ratio

Question: Which combination(s) of main factors will successfully encourage overall plant growth?

To analyze plant growth levels based on the combination and interaction of the main factors, I decided to use three-way ANOVA to demonstrate the effect of how each combination will affect the overall plant growth.

#load all necessary packages
library(ggplot2)
library (nortest)
library (pastecs)
library(emmeans)
library(MASS) #for Box-Cox transformation
library(readr)
#load the data
biochar <- read_csv ("/Users/milliewang/Desktop/biochar_study_data.csv")
## Rows: 41 Columns: 10
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (4): type, Wheat, Soil, Biochar
## dbl (6): rep, shoot weight, shallow root weight, deep root weight, total roo...
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
spec(biochar)
## cols(
##   rep = col_double(),
##   type = col_character(),
##   Wheat = col_character(),
##   Soil = col_character(),
##   Biochar = col_character(),
##   `shoot weight` = col_double(),
##   `shallow root weight` = col_double(),
##   `deep root weight` = col_double(),
##   `total root weight` = col_double(),
##   `root to shoot ratio` = col_double()
## )
# Use the attach() command to make columns accessible individually
attach(biochar)
#Cleaning Data
#clean column name to replace name in dataframe and avoid error in str2lang(x)
colnames(biochar) [9] <- "Total_Root_Weight"
colnames(biochar) [10] <- "Root_to_Shoot_Ratio"

Checking for Interaction Significance

To visualize whether the main factors are dependent to the variable in question, I used an interaction plot between the three main factors for each variable to check for any interaction effects. If the lines cross or will cross then the graph suggests that there is an interaction effect. When there is statistically significant interactions, main effects cannot be interpreted without considering the interaction.

par(mfrow=c(1,3)) # 3 figures arranged in 1 rows and 3 columns
interaction.plot(biochar$Biochar, biochar$Wheat, biochar$'shoot weight')
interaction.plot(biochar$Wheat, biochar$Soil, biochar$'shoot weight')
interaction.plot(biochar$Soil, biochar$Biochar, biochar$'shoot weight')

There is a slight interaction between Biochar and Wheat.
There is an interaction between Wheat and Soil.
There is an interaction between Soil and Biochar.

par(mfrow=c(1,3))
interaction.plot(biochar$Biochar, biochar$Wheat, biochar$'shallow root weight')
interaction.plot(biochar$Wheat, biochar$Soil, biochar$'shallow root weight')
interaction.plot(biochar$Soil, biochar$Biochar, biochar$'shallow root weight')

There is an interaction between Biochar and Wheat.
There is an interaction between Wheat and Soil.
There is an interaction between Soil and Biochar.

par(mfrow=c(1,3))
interaction.plot(biochar$Biochar, biochar$Wheat, biochar$'deep root weight')
interaction.plot(biochar$Wheat, biochar$Soil, biochar$'deep root weight')
interaction.plot(biochar$Soil, biochar$Biochar, biochar$'deep root weight')

There is an interaction between Biochar and Wheat.
There is an interaction between Wheat and Soil.
There is an interaction between Soil and Biochar.

par(mfrow=c(1,3))
interaction.plot(biochar$Biochar, biochar$Wheat, biochar$'Total_Root_Weight')
interaction.plot(biochar$Wheat, biochar$Soil, biochar$'Total_Root_Weight')
interaction.plot(biochar$Soil, biochar$Biochar, biochar$'Total_Root_Weight')

There is an interaction between Biochar and Wheat.
There is an interaction between Wheat and Soil.
There is an interaction between Soil and Biochar.

par(mfrow=c(1,3))
interaction.plot(biochar$Biochar, biochar$Wheat, biochar$'Root_to_Shoot_Ratio')
interaction.plot(biochar$Wheat, biochar$Soil, biochar$'Root_to_Shoot_Ratio')
interaction.plot(biochar$Soil, biochar$Biochar, biochar$'Root_to_Shoot_Ratio')

There is a slight interaction between Biochar and Wheat.
There is an interaction between Wheat and Soil.
There is an interaction between Soil and Biochar.

Three-Way ANOVA and Post-Hoc Test

To see whether there is signifigant significant interaction(s) between the main factors, I fit a three-way ANOVA model with the interaction terms and checked the model assumption. Each time I reduced the model, I took out a factor interaction that is not deemed significant (p-value > 0.05).

Post-Hoc test is done after I got the final reduced model. If the interaction is significant, it is inappropriate to interpret the main effects without considering the interaction. Instead, I compared the effects of a factor at each level of the other factor. However, if the interaction is insignificant, I compared the main effects.

Shoot Weight

ShootWeightModel <- aov(biochar$'shoot weight' ~ Biochar * Wheat * Soil, data=biochar)
par(mfrow=c(2,2))
plot(ShootWeightModel)

anova(ShootWeightModel) 
## Analysis of Variance Table
## 
## Response: biochar$"shoot weight"
##                    Df  Sum Sq Mean Sq  F value    Pr(>F)    
## Biochar             1  0.0385  0.0385   0.1875   0.66885    
## Wheat               1  0.0893  0.0893   0.4347   0.51596    
## Soil                1 24.6578 24.6578 120.0968 7.985e-11 ***
## Biochar:Wheat       1  0.0005  0.0005   0.0026   0.95997    
## Biochar:Soil        1  0.3938  0.3938   1.9182   0.17880    
## Wheat:Soil          1  1.6974  1.6974   8.2673   0.00833 ** 
## Biochar:Wheat:Soil  1  0.1116  0.1116   0.5437   0.46806    
## Residuals          24  4.9276  0.2053                       
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Assumptions failed -> need transformation
#Determine the lamda value of BOX Cox transformation
par(mfrow=c(1,1))
boxcox(biochar$'shoot weight'~ Biochar * Wheat * Soil, data=biochar)

#Lamda hat approximately equals to -1 and the 1/x transformation is chosen
transformModel <- 1/(biochar$'shoot weight') 
# fit the model again using the transformed data
ShootWeightModel2 <- aov(transformModel ~ Biochar * Wheat * Soil, data=biochar)
# don't forget to check and make sure model assumption are satisfied again after transformation
par(mfrow=c(2,2))
plot(ShootWeightModel2) 

anova(ShootWeightModel2)
## Analysis of Variance Table
## 
## Response: transformModel
##                    Df  Sum Sq Mean Sq  F value    Pr(>F)    
## Biochar             1 0.00041 0.00041   0.2065  0.653639    
## Wheat               1 0.00248 0.00248   1.2537  0.273923    
## Soil                1 0.36277 0.36277 183.2268 9.933e-13 ***
## Biochar:Wheat       1 0.00019 0.00019   0.0964  0.758910    
## Biochar:Soil        1 0.00505 0.00505   2.5502  0.123362    
## Wheat:Soil          1 0.03076 0.03076  15.5343  0.000611 ***
## Biochar:Wheat:Soil  1 0.00109 0.00109   0.5489  0.465971    
## Residuals          24 0.04752 0.00198                       
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# reduced model cont... b/c there is no significant 3-way interaction
# don't forget to check and make sure model assumption
ShootWeightModel3 <- aov(transformModel ~ Biochar*Wheat + Biochar*Soil + Wheat*Soil, data=biochar)
par(mfrow=c(2,2))
plot(ShootWeightModel3) 
anova(ShootWeightModel3)
ShootWeightModel4 <- aov(transformModel ~ Biochar*Soil + Wheat*Soil, data=biochar)
par(mfrow=c(2,2))
plot(ShootWeightModel4) 
anova(ShootWeightModel4)
ShootWeightModel5 <- aov(transformModel ~ Biochar + Wheat*Soil, data=biochar)
par(mfrow=c(2,2))
plot(ShootWeightModel5) 
anova(ShootWeightModel5)
ShootWeightModel6 <- aov(transformModel ~ Wheat*Soil, data=biochar)
par(mfrow=c(2,2))
plot(ShootWeightModel6) 

anova(ShootWeightModel6)
## Analysis of Variance Table
## 
## Response: transformModel
##            Df  Sum Sq Mean Sq  F value    Pr(>F)    
## Wheat       1 0.00248 0.00248   1.2811 0.2672973    
## Soil        1 0.36277 0.36277 187.2259 6.343e-14 ***
## Wheat:Soil  1 0.03076 0.03076  15.8733 0.0004385 ***
## Residuals  28 0.05425 0.00194                       
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

ShootWeightModel6 is the final reduced model for Shoot Weight. There is a significant interaction.
Reduced Model: ‘shoot weight’ ~ Wheat*Soil

# compare the effect of Wheat at each level of Soil vice versa
emmeans(ShootWeightModel6, list(pairwise ~ Wheat|Soil)) 
## $`emmeans of Wheat | Soil`
## Soil = soil:
##  Wheat emmean     SE df lower.CL upper.CL
##  1RS    0.245 0.0156 28    0.213    0.276
##  76     0.289 0.0156 28    0.257    0.321
## 
## Soil = soil-sand:
##  Wheat emmean     SE df lower.CL upper.CL
##  1RS    0.520 0.0156 28    0.488    0.551
##  76     0.440 0.0156 28    0.408    0.472
## 
## Confidence level used: 0.95 
## 
## $`pairwise differences of Wheat | Soil`
## Soil = soil:
##  2        estimate    SE df t.ratio p.value
##  1RS - 76  -0.0444 0.022 28  -2.017  0.0534
## 
## Soil = soil-sand:
##  2        estimate    SE df t.ratio p.value
##  1RS - 76   0.0796 0.022 28   3.618  0.0012
emmeans(ShootWeightModel6, list(pairwise ~ Soil|Wheat))
## $`emmeans of Soil | Wheat`
## Wheat = 1RS:
##  Soil      emmean     SE df lower.CL upper.CL
##  soil       0.245 0.0156 28    0.213    0.276
##  soil-sand  0.520 0.0156 28    0.488    0.551
## 
## Wheat = 76:
##  Soil      emmean     SE df lower.CL upper.CL
##  soil       0.289 0.0156 28    0.257    0.321
##  soil-sand  0.440 0.0156 28    0.408    0.472
## 
## Confidence level used: 0.95 
## 
## $`pairwise differences of Soil | Wheat`
## Wheat = 1RS:
##  2                  estimate    SE df t.ratio p.value
##  soil - (soil-sand)   -0.275 0.022 28 -12.493  <.0001
## 
## Wheat = 76:
##  2                  estimate    SE df t.ratio p.value
##  soil - (soil-sand)   -0.151 0.022 28  -6.858  <.0001

By comparing levels of Wheat|Soil and Soil|Wheat (p-value is about ≤ 0.05), there is not a noticeable difference in sprout weight when using either wheat varieties in soil or soil-sand. Unlike wheat varieties, soil type is considered a significant factor when looking at sprout weight. Thus, the type of soil a plant is in will affect the shoot weight.

Shallow Root Weight

ShallowRootWeightModel <- aov(biochar$'shallow root weight' ~ Biochar * Wheat * Soil, data=biochar)
par(mfrow=c(2,2))
plot(ShallowRootWeightModel)

anova(ShallowRootWeightModel)
## Analysis of Variance Table
## 
## Response: biochar$"shallow root weight"
##                    Df  Sum Sq  Mean Sq F value   Pr(>F)   
## Biochar             1 0.27195 0.271953 10.8334 0.003076 **
## Wheat               1 0.06753 0.067528  2.6900 0.114021   
## Soil                1 0.23633 0.236328  9.4143 0.005274 **
## Biochar:Wheat       1 0.00113 0.001128  0.0449 0.833905   
## Biochar:Soil        1 0.06213 0.062128  2.4749 0.128767   
## Wheat:Soil          1 0.02475 0.024753  0.9861 0.330615   
## Biochar:Wheat:Soil  1 0.03445 0.034453  1.3725 0.252889   
## Residuals          24 0.60248 0.025103                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# reduced model cont... b/c there is no significant 3-way interaction
# don't forget to check and make sure model assumption
ShallowRootWeightModel2 <- aov(biochar$'shallow root weight' ~ Biochar*Wheat + Biochar*Soil + Wheat*Soil, data=biochar)
par(mfrow=c(2,2))
plot(ShallowRootWeightModel2)
anova(ShallowRootWeightModel2)
ShallowRootWeightModel3 <- aov(biochar$'shallow root weight' ~ Biochar*Soil + Wheat*Soil, data=biochar)
par(mfrow=c(2,2))
plot(ShallowRootWeightModel3)
anova(ShallowRootWeightModel3)
ShallowRootWeightModel4 <- aov(biochar$'shallow root weight' ~ Biochar*Soil + Wheat, data=biochar)
par(mfrow=c(2,2))
plot(ShallowRootWeightModel4)
anova(ShallowRootWeightModel4)
ShallowRootWeightModel5 <- aov(biochar$'shallow root weight' ~ Biochar + Wheat + Soil, data=biochar)
par(mfrow=c(2,2))
plot(ShallowRootWeightModel5)
anova(ShallowRootWeightModel5)
ShallowRootWeightModel6 <- aov(biochar$'shallow root weight' ~ Biochar + Soil, data=biochar)
par(mfrow=c(2,2))
plot(ShallowRootWeightModel6)

anova(ShallowRootWeightModel6)
## Analysis of Variance Table
## 
## Response: biochar$"shallow root weight"
##           Df  Sum Sq  Mean Sq F value   Pr(>F)   
## Biochar    1 0.27195 0.271953  9.9520 0.003725 **
## Soil       1 0.23633 0.236328  8.6483 0.006371 **
## Residuals 29 0.79247 0.027326                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

ShallowRootWeightModel6 is the final reduced model for Shallow Root Weight. There is no significant interaction.
Reduced Model: ‘shallow root weight’ ~ Biochar+Soil

#interaction is not significant -> compare the main effects
TukeyHSD(ShallowRootWeightModel6)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = biochar$"shallow root weight" ~ Biochar + Soil, data = biochar)
## 
## $Biochar
##            diff        lwr       upr     p adj
## yes-no 0.184375 0.06484187 0.3039081 0.0037246
## 
## $Soil
##                     diff        lwr         upr     p adj
## soil-sand-soil -0.171875 -0.2914081 -0.05234187 0.0063709

When comparing the main effects, both Biochar and Soil are significant factors in the growth of Shallow Root given the p-values are both ≤ 0.05. This can conclude that with the biochar treatment present in both soil types will show the increase in shallow root weight.

Deep Root Weight

DeepRootWeightModel <- aov(biochar$'deep root weight'~ Biochar * Wheat * Soil, data=biochar)
par(mfrow=c(2,2))
plot(DeepRootWeightModel)

anova(DeepRootWeightModel)
## Analysis of Variance Table
## 
## Response: biochar$"deep root weight"
##                    Df  Sum Sq  Mean Sq F value  Pr(>F)  
## Biochar             1 0.30811 0.308113  5.4363 0.02844 *
## Wheat               1 0.14045 0.140450  2.4781 0.12854  
## Soil                1 0.02420 0.024200  0.4270 0.51969  
## Biochar:Wheat       1 0.00281 0.002813  0.0496 0.82561  
## Biochar:Soil        1 0.21451 0.214513  3.7848 0.06352 .
## Wheat:Soil          1 0.00980 0.009800  0.1729 0.68123  
## Biochar:Wheat:Soil  1 0.00361 0.003613  0.0637 0.80283  
## Residuals          24 1.36025 0.056677                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# assumptions failed -> need transformation
# determine the lamda value of BOX Cox transformation
par(mfrow=c(1,1))
boxcox(biochar$'deep root weight'~ Biochar * Wheat * Soil, data=biochar)

# lamda hat approximately equals to 0.5 and the sqrt transformation is chosen
transformModel3 <- sqrt(biochar$'deep root weight') 
# fit the model again using the transformed data
DeepRootWeightModel2 <- aov(transformModel3 ~ Biochar * Wheat * Soil, data=biochar)
# don't forget to check and make sure model assumption are satisfied again after transformation
par(mfrow=c(2,2))
plot(DeepRootWeightModel2) 

anova(DeepRootWeightModel2)
## Analysis of Variance Table
## 
## Response: transformModel3
##                    Df  Sum Sq  Mean Sq F value  Pr(>F)  
## Biochar             1 0.11288 0.112884  5.0656 0.03384 *
## Wheat               1 0.07763 0.077629  3.4835 0.07425 .
## Soil                1 0.00139 0.001389  0.0623 0.80495  
## Biochar:Wheat       1 0.00171 0.001705  0.0765 0.78442  
## Biochar:Soil        1 0.08650 0.086504  3.8818 0.06045 .
## Wheat:Soil          1 0.00547 0.005468  0.2454 0.62486  
## Biochar:Wheat:Soil  1 0.00378 0.003785  0.1698 0.68391  
## Residuals          24 0.53483 0.022284                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# reduced model cont... b/c there is no significant 3-way interaction
# don't forget to check and make sure model assumption
DeepRootWeightModel3 <- aov(transformModel3 ~ Biochar*Wheat + Biochar*Soil + Wheat*Soil, data=biochar)
par(mfrow=c(2,2))
plot(DeepRootWeightModel3) 
anova(DeepRootWeightModel3)
DeepRootWeightModel4 <- aov(transformModel3 ~ Biochar*Soil + Wheat*Soil, data=biochar)
par(mfrow=c(2,2))
plot(DeepRootWeightModel4) 
anova(DeepRootWeightModel4)
DeepRootWeightModel5 <- aov(transformModel3 ~ Biochar*Soil + Wheat, data=biochar)
par(mfrow=c(2,2))
plot(DeepRootWeightModel5) 
anova(DeepRootWeightModel5)
DeepRootWeightModel6 <- aov(transformModel3 ~ Biochar*Soil, data=biochar)
par(mfrow=c(2,2))
plot(DeepRootWeightModel6) 

anova(DeepRootWeightModel6)
## Analysis of Variance Table
## 
## Response: transformModel3
##              Df  Sum Sq  Mean Sq F value  Pr(>F)  
## Biochar       1 0.11288 0.112884  5.0701 0.03237 *
## Soil          1 0.00139 0.001389  0.0624 0.80457  
## Biochar:Soil  1 0.08650 0.086504  3.8853 0.05867 .
## Residuals    28 0.62341 0.022265                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

DeepRootWeightModel6 is the final reduced model for Deep Root Weight. There is a significant interaction.
Reduced Model: ‘deep root weight’ ~ Biochar*Soil

#interaction is significant -> compare the effect of Biochar at each level of Soil vice versa
emmeans(DeepRootWeightModel6, list(pairwise ~ Biochar|Soil))
## $`emmeans of Biochar | Soil`
## Soil = soil:
##  Biochar emmean     SE df lower.CL upper.CL
##  no       0.664 0.0528 28    0.556    0.772
##  yes      0.886 0.0528 28    0.778    0.994
## 
## Soil = soil-sand:
##  Biochar emmean     SE df lower.CL upper.CL
##  no       0.754 0.0528 28    0.646    0.863
##  yes      0.769 0.0528 28    0.661    0.877
## 
## Confidence level used: 0.95 
## 
## $`pairwise differences of Biochar | Soil`
## Soil = soil:
##  2        estimate     SE df t.ratio p.value
##  no - yes  -0.2228 0.0746 28  -2.986  0.0058
## 
## Soil = soil-sand:
##  2        estimate     SE df t.ratio p.value
##  no - yes  -0.0148 0.0746 28  -0.198  0.8442
emmeans(DeepRootWeightModel6, list(pairwise ~ Soil|Biochar))
## $`emmeans of Soil | Biochar`
## Biochar = no:
##  Soil      emmean     SE df lower.CL upper.CL
##  soil       0.664 0.0528 28    0.556    0.772
##  soil-sand  0.754 0.0528 28    0.646    0.863
## 
## Biochar = yes:
##  Soil      emmean     SE df lower.CL upper.CL
##  soil       0.886 0.0528 28    0.778    0.994
##  soil-sand  0.769 0.0528 28    0.661    0.877
## 
## Confidence level used: 0.95 
## 
## $`pairwise differences of Soil | Biochar`
## Biochar = no:
##  2                  estimate     SE df t.ratio p.value
##  soil - (soil-sand)  -0.0908 0.0746 28  -1.217  0.2337
## 
## Biochar = yes:
##  2                  estimate     SE df t.ratio p.value
##  soil - (soil-sand)   0.1172 0.0746 28   1.570  0.1276

By comparing levels of Biochar|Soil and Soil|Biochar (p-value ≤ 0.05), the only significant factor is seen with the pairwise difference of Biochar|Soil between soil and biochar. There is a difference in deep root weight depending on whether biochar is used in soil vs soil-sand. Thus, having biochar in soil will have a bigger effect on deep root weight than in soil-sand even if both combinations supports deep root weight increase.

Total Root Weight

TotalRootWeightModel <- aov(biochar$'Total_Root_Weight' ~ Biochar * Wheat * Soil, data=biochar)
# 4 figures arranged in 2 rows and 2 columns
par(mfrow=c(2,2))
plot(TotalRootWeightModel)

anova(TotalRootWeightModel)
## Analysis of Variance Table
## 
## Response: biochar$Total_Root_Weight
##                    Df  Sum Sq Mean Sq F value   Pr(>F)   
## Biochar             1 1.15900 1.15900 10.2850 0.003776 **
## Wheat               1 0.40275 0.40275  3.5740 0.070824 . 
## Soil                1 0.41178 0.41178  3.6541 0.067943 . 
## Biochar:Wheat       1 0.00750 0.00750  0.0666 0.798579   
## Biochar:Soil        1 0.50753 0.50753  4.5038 0.044335 * 
## Wheat:Soil          1 0.06570 0.06570  0.5831 0.452561   
## Biochar:Wheat:Soil  1 0.06038 0.06038  0.5358 0.471268   
## Residuals          24 2.70452 0.11269                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# reduced model cont... b/c there is no significant 3-way interaction
# don't forget to check and make sure model assumption
TotalRootWeightModel2 <- aov(biochar$'Total_Root_Weight' ~ Biochar*Wheat + Biochar*Soil + Wheat*Soil, data=biochar)
par(mfrow=c(2,2))
plot(TotalRootWeightModel2)
anova(TotalRootWeightModel2)
TotalRootWeightModel3 <- aov(biochar$'Total_Root_Weight' ~ Biochar*Soil + Wheat*Soil, data=biochar)
par(mfrow=c(2,2))
plot(TotalRootWeightModel3)
anova(TotalRootWeightModel3)
TotalRootWeightModel4 <- aov(biochar$'Total_Root_Weight' ~ Biochar*Soil + Wheat, data=biochar)
par(mfrow=c(2,2))
plot(TotalRootWeightModel4)
anova(TotalRootWeightModel4)
TotalRootWeightModel5 <- aov(biochar$'Total_Root_Weight' ~ Biochar*Soil, data=biochar)
par(mfrow=c(2,2))
plot(TotalRootWeightModel5)

anova(TotalRootWeightModel5)
## Analysis of Variance Table
## 
## Response: biochar$Total_Root_Weight
##              Df Sum Sq Mean Sq F value   Pr(>F)   
## Biochar       1 1.1590 1.15900 10.0134 0.003726 **
## Soil          1 0.4118 0.41178  3.5576 0.069684 . 
## Biochar:Soil  1 0.5075 0.50753  4.3849 0.045435 * 
## Residuals    28 3.2409 0.11575                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

TotalRootWeightModel5 is the final reduced model for Total Root Weight. There is a significant interaction.
Reduced Model: ‘Total_Root_Weight’ ~ Biochar*Soil

# interaction is significant -> compare the effect of Biochar at each level of Soil vice versaa
# compare the effect of Biochar at each level of Soil vice versa
emmeans(TotalRootWeightModel5, list(pairwise ~ Biochar|Soil)) 
## $`emmeans of Biochar | Soil`
## Soil = soil:
##  Biochar emmean   SE df lower.CL upper.CL
##  no        1.14 0.12 28    0.895     1.39
##  yes       1.77 0.12 28    1.527     2.02
## 
## Soil = soil-sand:
##  Biochar emmean   SE df lower.CL upper.CL
##  no        1.17 0.12 28    0.920     1.41
##  yes       1.29 0.12 28    1.049     1.54
## 
## Confidence level used: 0.95 
## 
## $`pairwise differences of Biochar | Soil`
## Soil = soil:
##  2        estimate   SE df t.ratio p.value
##  no - yes   -0.632 0.17 28  -3.718  0.0009
## 
## Soil = soil-sand:
##  2        estimate   SE df t.ratio p.value
##  no - yes   -0.129 0.17 28  -0.757  0.4554
emmeans(TotalRootWeightModel5, list(pairwise ~ Soil|Biochar))
## $`emmeans of Soil | Biochar`
## Biochar = no:
##  Soil      emmean   SE df lower.CL upper.CL
##  soil        1.14 0.12 28    0.895     1.39
##  soil-sand   1.17 0.12 28    0.920     1.41
## 
## Biochar = yes:
##  Soil      emmean   SE df lower.CL upper.CL
##  soil        1.77 0.12 28    1.527     2.02
##  soil-sand   1.29 0.12 28    1.049     1.54
## 
## Confidence level used: 0.95 
## 
## $`pairwise differences of Soil | Biochar`
## Biochar = no:
##  2                  estimate   SE df t.ratio p.value
##  soil - (soil-sand)   -0.025 0.17 28  -0.147  0.8842
## 
## Biochar = yes:
##  2                  estimate   SE df t.ratio p.value
##  soil - (soil-sand)    0.479 0.17 28   2.814  0.0088

By comparing levels of Biochar|Soil and Soil|Biochar (p-value is about ≤ 0.05), biochar treatment in both soil types greatly affects the total root weight. However, biochar treatment seems more effective in soil instead of soil-sand for the overall total root weight.

Root to Shoot Ratio

RootToShootRatioModel <- aov(biochar$'Root_to_Shoot_Ratio' ~ Biochar * Wheat * Soil, data=biochar)
# 4 figures arranged in 2 rows and 2 columns
par(mfrow=c(2,2))
plot(RootToShootRatioModel)

anova(RootToShootRatioModel)
## Analysis of Variance Table
## 
## Response: biochar$Root_to_Shoot_Ratio
##                    Df  Sum Sq Mean Sq F value    Pr(>F)    
## Biochar             1 0.09643 0.09643 12.2479  0.001844 ** 
## Wheat               1 0.06575 0.06575  8.3510  0.008050 ** 
## Soil                1 0.35424 0.35424 44.9928 6.145e-07 ***
## Biochar:Wheat       1 0.00001 0.00001  0.0013  0.971988    
## Biochar:Soil        1 0.05750 0.05750  7.3030  0.012438 *  
## Wheat:Soil          1 0.04441 0.04441  5.6404  0.025889 *  
## Biochar:Wheat:Soil  1 0.02182 0.02182  2.7714  0.108963    
## Residuals          24 0.18896 0.00787                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# reduced model cont... b/c there is no significant 3-way interaction
# don't forget to check and make sure model assumption
RootToShootRatioModel2 <- aov(biochar$'Root_to_Shoot_Ratio'~ Biochar*Wheat + Biochar*Soil + Wheat*Soil, data=biochar)
par(mfrow=c(2,2))
plot(RootToShootRatioModel2)
anova(RootToShootRatioModel2)
RootToShootRatioModel3 <- aov(biochar$'Root_to_Shoot_Ratio'~ Biochar*Soil + Wheat*Soil, data=biochar)
par(mfrow=c(2,2))
plot(RootToShootRatioModel3)

anova(RootToShootRatioModel3)
## Analysis of Variance Table
## 
## Response: biochar$Root_to_Shoot_Ratio
##              Df  Sum Sq Mean Sq F value    Pr(>F)    
## Biochar       1 0.09643 0.09643 11.8944  0.001931 ** 
## Soil          1 0.35424 0.35424 43.6942 5.199e-07 ***
## Wheat         1 0.06575 0.06575  8.1100  0.008488 ** 
## Biochar:Soil  1 0.05750 0.05750  7.0922  0.013110 *  
## Soil:Wheat    1 0.04441 0.04441  5.4776  0.027209 *  
## Residuals    26 0.21079 0.00811                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

RootToShootRatioModel3 is the final reduced model for Root to Shoot Ratio. There is a significant interaction.
Reduced Model: ‘Root_to_Shoot_Ratio’ ~ Biochar* Soil + Wheat* Soil

# interaction is significant -> compare the effect of a factor at each level of the other factor
# compare the effect of Biochar at each level of Soil vice versa
emmeans(RootToShootRatioModel3, list(pairwise ~ Biochar|Soil)) 
## $`emmeans of Biochar | Soil`
## Soil = soil:
##  Biochar emmean     SE df lower.CL upper.CL
##  no       0.282 0.0318 26    0.217    0.348
##  yes      0.477 0.0318 26    0.411    0.542
## 
## Soil = soil-sand:
##  Biochar emmean     SE df lower.CL upper.CL
##  no       0.577 0.0318 26    0.512    0.643
##  yes      0.603 0.0318 26    0.537    0.668
## 
## Results are averaged over the levels of: Wheat 
## Confidence level used: 0.95 
## 
## $`pairwise differences of Biochar | Soil`
## Soil = soil:
##  2        estimate    SE df t.ratio p.value
##  no - yes   -0.195 0.045 26  -4.322  0.0002
## 
## Soil = soil-sand:
##  2        estimate    SE df t.ratio p.value
##  no - yes   -0.025 0.045 26  -0.556  0.5832
## 
## Results are averaged over the levels of: Wheat
emmeans(RootToShootRatioModel3, list(pairwise ~ Soil|Biochar))
## $`emmeans of Soil | Biochar`
## Biochar = no:
##  Soil      emmean     SE df lower.CL upper.CL
##  soil       0.282 0.0318 26    0.217    0.348
##  soil-sand  0.577 0.0318 26    0.512    0.643
## 
## Biochar = yes:
##  Soil      emmean     SE df lower.CL upper.CL
##  soil       0.477 0.0318 26    0.411    0.542
##  soil-sand  0.603 0.0318 26    0.537    0.668
## 
## Results are averaged over the levels of: Wheat 
## Confidence level used: 0.95 
## 
## $`pairwise differences of Soil | Biochar`
## Biochar = no:
##  2                  estimate    SE df t.ratio p.value
##  soil - (soil-sand)   -0.295 0.045 26  -6.557  <.0001
## 
## Biochar = yes:
##  2                  estimate    SE df t.ratio p.value
##  soil - (soil-sand)   -0.126 0.045 26  -2.791  0.0097
## 
## Results are averaged over the levels of: Wheat
# compare the effect of Wheat at each level of Soil vice versa
emmeans(RootToShootRatioModel3, list(pairwise ~ Wheat|Soil)) 
## $`emmeans of Wheat | Soil`
## Soil = soil:
##  Wheat emmean     SE df lower.CL upper.CL
##  1RS    0.388 0.0318 26    0.322    0.453
##  76     0.371 0.0318 26    0.306    0.437
## 
## Soil = soil-sand:
##  Wheat emmean     SE df lower.CL upper.CL
##  1RS    0.673 0.0318 26    0.607    0.738
##  76     0.507 0.0318 26    0.442    0.573
## 
## Results are averaged over the levels of: Biochar 
## Confidence level used: 0.95 
## 
## $`pairwise differences of Wheat | Soil`
## Soil = soil:
##  2        estimate    SE df t.ratio p.value
##  1RS - 76   0.0162 0.045 26   0.359  0.7227
## 
## Soil = soil-sand:
##  2        estimate    SE df t.ratio p.value
##  1RS - 76   0.1652 0.045 26   3.669  0.0011
## 
## Results are averaged over the levels of: Biochar
emmeans(RootToShootRatioModel3, list(pairwise ~ Soil|Wheat))
## $`emmeans of Soil | Wheat`
## Wheat = 1RS:
##  Soil      emmean     SE df lower.CL upper.CL
##  soil       0.388 0.0318 26    0.322    0.453
##  soil-sand  0.673 0.0318 26    0.607    0.738
## 
## Wheat = 76:
##  Soil      emmean     SE df lower.CL upper.CL
##  soil       0.371 0.0318 26    0.306    0.437
##  soil-sand  0.507 0.0318 26    0.442    0.573
## 
## Results are averaged over the levels of: Biochar 
## Confidence level used: 0.95 
## 
## $`pairwise differences of Soil | Wheat`
## Wheat = 1RS:
##  2                  estimate    SE df t.ratio p.value
##  soil - (soil-sand)   -0.285 0.045 26  -6.329  <.0001
## 
## Wheat = 76:
##  2                  estimate    SE df t.ratio p.value
##  soil - (soil-sand)   -0.136 0.045 26  -3.019  0.0056
## 
## Results are averaged over the levels of: Biochar

By comparing levels of Biochar|Soil, Soil|Biochar, Wheat|Soil, and Soil|Wheat (p-value is about ≤ 0.05), the presence of biochar within the soil types dratically affects the root to shoot ratio of the plant. Soil type also plays a factor and can be seen when there is a greater difference in ratio when soil and biochar is used then soil-sand and biochar. Similarly, wheat varieties in certain soil types will also affect the root to shoot ratio.

Conclusion:

Based on the finding from above, the combination(s) that will successfully encourage overall plant growth will need the inclusion of the biochar treatment. Overall plant growth would be more visable when used in tandem with soil instead of soil-sand. However, that will not be the case with shoot weight. Wheat does not seem to play a big factor in the combination because both varieties of wheat is seen to grow.

Problem with data
Due to only having only four replicates for each combination of those factors (total: 8 different treatments), the small dataset can run into the problem of over fitting and it does not represent the data population. In this project: By using a stepwise three-way ANOVA procedure and by focusing mainly on p-values to select “statistically signifiant” terms when reducing the model can bring in a bias.