Pages

Showing posts with label epicalc. Show all posts
Showing posts with label epicalc. Show all posts

Friday, June 24, 2011

Test for homogeneity of variance: Bartlett test

First an important assumption: that the normal distribution is followed by the data.
Null hypothesis for this test is that the variances are equal in the groups.
So if, p value less than 0.05, null hypothesis is rejected and interpretation being that the variances are not equal (or homodescacity is absent).

In case, the normality assumption is violated, then we can go for Levene test.

For further discussion using R: http://wiki.stdout.org/rcookbook/Statistical%20analysis/Homogeneity%20of%20variance

Test for normality: Shapiro Wilk test

In order to test the normality of the distribution pattern of a variable, we can use the Shapiro Wilk test. The null hypothesis is that: There is no difference in the distribution of the given data and a normal distribution curve (or in other words the data is normally distributed).
So if the P value is less than 0.05, means that the null hypothesis is rejected or in other words, there is a difference in the distribution of the given data and a normal distribution curve or the given data is not normally distributed.

For this type of data which is not normally distributed, it is time to go for a non parametric test.

Note: Shapiro Wilk can be used to test the normality of residuals in a linear regression model. In R using the epicalc package, it can be done as: shapiro.test(lm(age ~ case.factor)$residuals). In this example, age is the numerical variable and case.factor is the categorical variable as cases and controls and lm stands for linear model.