rstandard.zlm {complexlm}R Documentation

Standardized Residuals from Ordinary or Robust Linear fits with Complex Variables

Description

Generates a vector of residuals from the given complex linear model that are normalized to have unit variance. Similar to stats::rstandard, which this function calls if given numeric input.

Usage

## S3 method for class 'zlm'
rstandard(model, lever = zhatvalues(model), ...)

Arguments

model

An object of class "zlm", "rzlm", "lm", or "rlm". Can be complex or numeric.

lever

A list of leverage scores with the same length as model$residuals. By default zhatvalues is called on model.

...

Other parameters. Only used if model is numeric; in which case they are passed to stats::rstandard.

Details

The standardized residuals are calculated as,

r' = r / ( s \sqrt{1 - lever} )


Where r is the residual vector and s is the residual standard error for "zlm" objects or the robust scale estimate for "rzlm" objects.

Value

A complex vector of length equal to that of the residuals of model. Numeric for numeric input.

Note

This is a much simpler function than stats::rstandard. It cannot perform leave-one-out cross validation residuals, or anything else not mentioned here.

See Also

stats::rstandard, stats::rstandard.lm,

Examples

set.seed(4242)
n <- 8
slop <- complex(real = 4.23, imaginary = 2.323)
interc <- complex(real = 1.4, imaginary = 1.804)
e <- complex(real=rnorm(n)/6, imaginary=rnorm(n)/6)
xx <- complex(real= rnorm(n), imaginary= rnorm(n))
tframe <- data.frame(x = xx, y= slop*xx + interc + e)
fit <- lm(y ~ x, data = tframe, weights = rep(1,n))
rstandard(fit)

[Package complexlm version 1.1.2 Index]