checkDisp: Reproduce data for the linear model scale-location diagnostic...

Description Usage Arguments Value Examples

View source: R/checkDisp.R

Description

The values returned are those used for plot(x.lm, which=3), where x.lm is a linear model or a generalized linear model. Plot the object returned to assess how successful the weights, determined using the function scaleLocAdjust, have been in adjusting for heterogenous variances.

Usage

1
checkDisp(x, span = 0.75)

Arguments

x

Model fitted using lm() or glm()

span

span parameter for use in smoothing the square root of standardized deviance residuals.

Value

A data frame, with:

linpred

Predicted values, on the scale of the linear predictor

absrSmooth

Smoothed values of the square roots of absolute values of standardised deviance residuals.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
royal <- subset(qra::codling1988, Cultivar=="ROYAL")
royal.glm <- glm(cbind(dead,total-dead)~ct, data=royal,
                 family=quasibinomial(link='cloglog'))
royalFix <- qra::scaleLocAdjust(royal.glm, lambda=2)
## Check range of indicated prior weights
range(royalFix[[2]])
## Range of updated dispersion estimates
range(summary(royalFix[[1]])[['dispersion']]/royalFix[[2]])
xy <- qra::checkDisp(royalFix[[1]])
plot(xy)

qra documentation built on Oct. 29, 2021, 9:06 a.m.