Scales the estimates of a fitted in scale-invariant fits.

Description

Scales the estimates of a fitted object. Each column of the model matrix is divided by the maximum absolute value of the column and the model is re-fitted using the new model matrix.

Usage

1

Arguments

fitted

a glm-like fitted object with linear predictor that supports the method model.matrix.

Details

scale.fit should only be used when the inferences using the model that fitted corresponds to, are invariant on the scale of the parameters (e.g. a GLM). In other words, scaleFit should only affect the estimated parameters and not the fit and the inferences made.

Value

An object of the same class as fitted.

Side Effects

Causes creation of the matrix .the.scaled. and the vector .the.offs. in the global environment if they do not already exist, otherwise their values are updated. This is done in order to ensure that the fitting procedure that resulted fitted will find these quantities.

Author(s)

Ioannis Kosmidis <email: ioannis@stats.ucl.ac.uk>

Examples

1
2
3
4
5
6
7
8
## Begin Example
y <- rpois(100,1)
x <- rnorm(100,0,0.2)*1e+6
m1 <- glm(y ~ -1 + x, family = poisson)
m2 <- scaleFit(m1)
## m1 and m2 are the same fits but on a different scale
sum(abs(m1$fitted-m2$fitted))
## End Example