Multiple Linear Regression in R [closed]

1

Hello, I have data ( link ) from a completely randomized experiment, where the (0.25, 0.50, 0.75, and 1.00) of different fungicides (4 natural + 1 chemical + control) with water). In total there were 24 treatments x 4 replications each.

Since I do not have a R domain, I would like to know the appropriate script to perform the ANOVA, the regression and generate the graphs already adjusted for each situation.

Sincerely

    
asked by anonymous 14.09.2018 / 19:39

1 answer

3
dados <- read.table('IVCM.txt', header = TRUE)

regLin <- lm(IVCM ~ TRAT * RE, dados)
# o asterisco na fórmula indica que é para calcular também a interação
# você pode usar "+" no lugar se quiser o cálculo sem interação

summary(regLin)  # resumo do modelo

anova(regLin)  # tabela ANOVA

par(mfrow=c(2,2)); plot(regLin)  # gráficos de avaliação

Remember to check the model assumptions and the setting. In their example data, the waste does not follow Normal distribution, among other things. You can try a generalized linear model: it is run in R by using the glm function, which uses the same formula syntax, but with the addition of specifying the probability function.

An excellent guide to linear models in R is Chapter 9 of the book Ecological Models and Data in R. It is available in PDF from the author's website: link

    
14.09.2018 / 22:13