Multiple linear regression in R [closed]
want to improve this question? update the question to focus on just one problem when edit it .
Closed 2 years ago .
improve this questionHello, I'm with data ( https://drive.google.com/open?id=1JdgsnJn5VrkL8j1BsfWzqYW9fMGXND6U ) of an entirely randomized experiment, in which the growth was evaluated of a fungus in response to the application of different doses (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 repetitions each.
Since I have no domain of R, I would like to know what the appropriate script to perform the ANOVA, the regression and generate the graphs already adjusted for each situation.
Sincerely
1 answers
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 fit. In your example data, residues do not follow Normal distribution, among other things. You can try a generalized linear model: it is rotated in R using the function glm
, which uses the same formula syntax, but with the Additional 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 on the author's website: https://ms.mcmaster.ca / ~ bolker / emdbook /