A loess smooth is applied to the square roots of the standardized
deviance residuals. The inverses of values from the smooth, raised
to the power of
lambda, are then used as prior weights to
update the model. A value of
lambda that is a little more
than 2.0 has often worked well.
scaleLocAdjust(x, lambda = 2, span = 0.75)
Model fitted using
Power of smooth of square roots of absolute values of residuals, to try for values whose inverses will be used as weights
span parameter for use in smoothing the square root of standardized deviance residuals.
This function is primarily for experimental use, in investigating possible ways to model a dispersion factor that varies with the fitted value.
A list, with elements
Model updated to use the newly calculated weights
The dispersion estimates that correspond to the updated
model are obtained by dividing the dispersion value given
summary() for the updated model by the (prior) weights
supplied when the model was updated. The approach for obtaining
varying dispersion estimates is used because, empirically, it
has been found to work well for at least some sets of data. In
particular, there seems no obvious theoretical basis for the
lambda. In the example given, used because the
data is publicly available, the method has limited success.
1 2 3 4 5 6 7 8
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) ## Check range of indicated prior weights range(ROYALFix[]) ## Range of updated dispersion estimates range(summary(ROYALFix[])[['dispersion']]/ROYALFix[])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.