Monday, January 16, 2023

Data Normality Review in R


 



##########################################################################


height.aov<- lm(height ~ Treatment*varities + replication,

                     data=height)

anova(height.aov)

height.rout <- resid(height.aov, type = "pearson")

summary(height.rout)

height.rout[which(abs(height.rout)>2.5)]

shapiro.test(residuals(height.aov)) 

par(mfrow=c(2,2))

plot(fitted.values(height.aov), resid(height.aov, type = "pearson"), 

     col="blue");abline(h=0)

hist(residuals(height.aov))

qqnorm(residuals(height.aov));qqline(residuals(height.rlme))

qqPlot(residuals(height.aov), dist= "norm", col=palette()[1], 

       ylab="Residual Quantiles", main="Normal Probability Plot", 

       pch=19)




############################################################################

No comments:

Post a Comment