Learn R Programming

TexMix (version 0.5.3)

summary.lmHetero: Function: Summerize lmHetero model estimates

Description

summary.lmHetero provides relevant summary information of a heteroscedastic regression model estimated by lmHetero.

Usage

# S3 method for lmHetero
summary(object, ...)

Arguments

object

An object of S3-class lmHetero.

...

Currently not in use.

Value

the input 'object' is returned silently.

Details

Regression tables for the estimate regression coefficients and the coefficients of the weights model are provided as well as a maximum likelihood ratio test is performed against a model, which assumes homoscedasticity.

Examples

Run this code
# NOT RUN {
library(sp)
data(tractShp)
validTractShp <- tractShp[!is.na(tractShp$BUYPOW), ]         # Remove 2 tracts with NA's
## Population at risk
totPop <- validTractShp$MALE+validTractShp$FEMALE

## H0 model
mod.lm <- mod.lmH <- lmHetero(PERCAPINC~PCTNOHINS+PCTMINOR+PCTUNIVDEG+PCTWHITE,
                              data=validTractShp)
summary(mod.lm)

## Preferred function call
mod.lmH <- lmHetero(PERCAPINC~PCTNOHINS+PCTMINOR+PCTUNIVDEG+PCTWHITE|log(totPop),
                    data=validTractShp)
summary(mod.lmH)

## Alternative function call
mod.lmH <- lmHetero(PERCAPINC~PCTNOHINS+PCTMINOR+PCTUNIVDEG+PCTWHITE, hetero=~log(totPop),
                    data=validTractShp)
summary(mod.lmH)

## Use estimated weights as input for weighted lm
mod.lmW <- lm(PERCAPINC~PCTNOHINS+PCTMINOR+PCTUNIVDEG+PCTWHITE, weights=mod.lmH$weights,
              data=validTractShp)
summary(mod.lmW)
hist(weighted.residuals(mod.lmW))

# }

Run the code above in your browser using DataLab