Presentation is loading. Please wait.

Presentation is loading. Please wait.

Model diagnostics Tim Paine, modified from Zarah Pattison’s slides

Similar presentations


Presentation on theme: "Model diagnostics Tim Paine, modified from Zarah Pattison’s slides"— Presentation transcript:

1 Model diagnostics Tim Paine, modified from Zarah Pattison’s slides

2 When conducting any statistical analysis it is important to evaluate how well the model fits the data and that the data meet the assumptions of the model. For linear models: Residuals are independently drawn from a normal distribution with a mean of 0 and a constant variance. Residuals: the distance of the data points from the fitted regression line

3 Constancy of variance A residual plot is a graph that shows the residuals on the vertical axis and the fitted values of the response on the horizontal axis. If the points in a residual plot are randomly dispersed around the horizontal axis, a linear regression model is appropriate for the data

4 QQ PLOTS Test for normality
Ranked samples from our distribution plotted against a similar no. of ranked quantiles taken from a ND 1,6,9 good I find them of little use.

5 Constancy of variance Constant variance means that when you plot the residuals against the predicted values, the variance of the error of the predicted values should be constant. See that the length of the red lines are all the same. Synonym: homoscedasticity Antonym: heteroscedasticity

6 Ideal examples : Residuals versus fitted value plots

7 Residuals appear exhibit homogeneity, normality, and independence
Residuals appear exhibit homogeneity, normality, and independence. However, the variation in residuals associated with the predictor variable Month suggests a problem with heterogeneity

8 Sop <- lmer(log(subnatcov+1) ~
loi + P + ss + channel.slope + domnatcov + iapcov*avmoisture+iapcov*cov + (1|river )+ (1|trans), data=finalscale, REML=FALSE)

9

10

11

12 Try a square root transformation

13 Sop <- lmer(sqrt(subnatcov+1) ~
loi + P + ss + channel.slope + domnatcov + iapcov*avmoisture+iapcov*cov + (1|river )+ (1|trans), data=finalscale, REML=FALSE)

14

15

16


Download ppt "Model diagnostics Tim Paine, modified from Zarah Pattison’s slides"

Similar presentations


Ads by Google