wls | R Documentation |
wls()
takes an OLS model and re-estimates it using a weighted least squares
approach. Weighted least squares is often a "textbook" approach to dealing with the presence of
heteroskedastic standard errors, for which the weighted least squares estimates are compared
to the OLS estimates of uncertainty to check for consistency or potential inferential implications.
wls(mod)
mod |
a fitted OLS model |
The function should be robust to potential model specification oddities (e.g. polynomials
and fixed effects). It also should perform nicely in the presence of missing data, if and only
if na.action = na.exclude
is supplied first to the offending OLS model supplied to the function
for a weighted least squares re-estimation.
wls()
returns a new model object that is a weighted least squares re-estimation
of the OLS model supplied to it.
Steven V. Miller
M1 <- lm(mpg ~ ., data=mtcars)
M2 <- wls(M1)
summary(M2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.