-1
$\begingroup$

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?

$\endgroup$

migrated from stackoverflow.com Apr 28 at 13:35

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

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

To test the normality assumption I would recommend to use the Shapiro-Wilk test in your case. (if you have more than 30 observations)

shapiro.test(ins(data.lm))

In order to check the homoskedasticity assumption the Bartlett and Levene test are appropriate tools.

bartlett.test(count ~ spray, data = InsectSprays)
leveneTest(count ~ spray, data = InsectSprays)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy