het.lmfit: Heteroscedastic linear models for large scale data

View source: R/regression_models.R

Heteroscedastic linear models for large scale dataR Documentation

Heteroscedastic linear models for large scale data

Description

Heteroscedastic linear models for large scale data.

Usage

het.lmfit(x, y, type = 1)

Arguments

x

The design matrix with the data, where each column refers to a different sample of subjects. You must supply the design matrix, with the column of 1s. This function is the analogue of lm.fit and .lm.fit.

y

A numerical vector with the response variable.

type

The type of regression to be fit in order to find the weights. The type 1 is described in Wooldridge (2012, page 287), whereas type 2 is described in page Wooldridge (2012, page 287).

Details

We have simply exploitted R's powerful function and managed to do better than .lm.fit which is a really powerful function as well. This is a bare bones function as it returns only two things, the coefficients and the residuals. .lm.fit returns more and lm.fit even more and finally lm returns too much. The addition is that we allow for estimation of the regression coefficients when heteroscedasticity is present.

Value

A list including:

be

The beta coefficients.

residuals

The residuals of the linear model(s).

Author(s)

Michail Tsagris.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

References

Introductory Econometrics. A modern approach. Mason, South-Western Cengage Learning, 5th Edition.

Draper, N.R. and Smith H. (1988). Applied regression analysis. New York, Wiley, 3rd edition.

See Also

covrob.lm, cls, cluster.lm, lm.parboot, cor_test, lm.drop1

Examples

x <- cbind(1, matrix( rnorm( 100 * 4), ncol = 4 ) )
y <- rnorm(100)
a <- het.lmfit(x, y) 
x <- NULL

Rfast2 documentation built on Aug. 8, 2023, 1:11 a.m.