The code developed during the study entitled “Morphological responses of shoots and fine roots to weed control in Abies sachalinensis and Picea jezoensis seedlings”(ID:JRES-D-24-00134) is briefly summarized.Note the descriptions can be updated at any time and there is concern that they may contain redundant code. The data developed during is is available from the corresponding author on reasonable request.
E-mail: sugai922 at affrc.go.jp
data<-read.csv(“JFR_JRES_D_24_00134.csv”)
dim(data) # [1] 24 29
target_variables <- names(data)[6:29]
results <- list() #Define the list to store the data
for(var in target_variables) {
lm_formula <- as.formula(paste(var, “~ wc+sp+plot+wc:sp+plot:wc”))
lm_model <- lm(data = data, lm_formula)
anova_result <- Anova(lm_model,type=3)
results[[var]] <- anova_result
}
m1<-glm(data=data,bn~wc+sp+plot+wc:sp+plot:wc,family=poisson(link=“log”)) #bn:shoot no.
m2<-glm(data=data,pn~wc+sp+plot+wc:sp+plot:wc,family=poisson(link=“log”)) #pn:pioneer root no.
Anova(m1,test=“F”,type=3)
Anova(m2,test=“F”,type=3)
Tips: When performing ANOVA for a split-plot design using the glm function in R, it should be noted that the F-value for the first-order effect is calculated as the ratio of the mean square of the first-order effect to the mean square of the second-order error. From the initial results calculated by the model, the F-value for the first-order effect need to be recalcurated using the mean square of the first-order error (Mizuguchi 2011, J.Weed.Sci.Tech,56:24-34).