# Testing normality for residuals

I have an Randomized block design experimental set up and a data consisting of species abundance. I would like to test for normality of the residuals, as in unexplained variance due tot the blocks.

I am new to statitstics. To find the resisuals I understand I need to create a linear model (lm()). But from the examples I have found online, it only works with one parameter/column (like an environmental variable), right? How do I deal with my data? Do I need to use the diversity function?

## migrated from stackoverflow.comApr 28 at 13:35

This question came from our site for professional and enthusiast programmers.

• You can perform a linear regression on one dependent (y) variable and one or several independent variables, e.g. lm(y ~ x1 + x2 + x3). – Roman Luštrik Apr 28 at 9:47

shapiro.test(ins(data.lm))

bartlett.test(count ~ spray, data = InsectSprays)