Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

het.lmfit

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 or a numerical matrix.

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

Examples

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

Rfast2

A Collection of Efficient and Extremely Fast R Functions II

v0.0.9
GPL (>= 2.0)
Authors
Manos Papadakis, Michail Tsagris, Stefanos Fafalios and Marios Dimitriadis.
Initial release
2021-03-21

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.