Generation

generate functionTue, 21 Mar 2023

A large agricultural company produces two species of grass and would like to know which type to grow in Northern Ontario. They would also like to know which of their three fertilizers is most effective for that grass. The company conducts an experiment in a large patch of soil in Northern Ontario. The patch is divided into 30 regions, and 5 are randomly selected for each grass/fertilizer combination. After several months, you determine the number of blades of grass per square inch in each region. The data is given in the file “Grass.csv”. HINT: type of species and type of fertilizer are given as numerical values and you must convert them to categories. the headers in the csv file are Species, Fertilizer, Blades Conduct a two-way analysis of variance at the 𝛼 = 0.05 level. Print a summary of the completed ANOVA table. Interpret the results in terms of the hypotheses.

data <- read.csv("Grass.csv") data <- data[data$Species != 0,] data <- data[data$Fertilizer != 0,] data$Species <- as.factor(data$Species) data$Fertilizer <- as.factor(data$Fertilizer) mod <- aov(Blades ~ Species * Fertilizer, data = data) summary(mod)

Questions about programming?Chat with your personal AI assistant