Last chance! 50% off unlimited learning
Sale ends in
weighted.residuals(obj, drop0 = TRUE)
TRUE
, drop all cases with
weights == 0
.drop0 = TRUE
) or the number of
observations, otherwise.lm
fit are the raw residuals weights
as specified in lm
's call. Dropping cases with weights zero is compatible with
influence
and related functions.residuals
, lm.influence
, etc.## following on from example(lm)
all.equal(weighted.residuals(lm.D9),
residuals(lm.D9))
x <- 1:10
w <- 0:9
y <- rnorm(x)
weighted.residuals(lmxy <- lm(y ~ x, weights = w))
weighted.residuals(lmxy, drop0 = FALSE)
Run the code above in your browser using DataLab