View source: R/regression_models_for_clustered_data.R
Linear regression with clustered data | R Documentation |
Linear regression with clustered data.
cluster.lm(y, x, id)
y |
The dependent variable, a numerical vector with numbers. |
x |
A matrix or a data.frame with the indendent variables. |
id |
A numerical variable with 1, 2, ... indicating the subject. Unbalanced design is of course welcome. |
A linear regression model for clustered data is fitted. For more information see Chapter 4.21 of Hansen (2019).
A list including:
be |
The (beta) regression coefficients. |
becov |
Robust covariance matrix of the regression coefficients. |
seb |
Robust standard errors of the regression coefficients. |
Michail Tsagris.
R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.
Hansen, B. E. (2022). Econometrics.
gee.reg, fe.lmfit, wild.boot
y <- rnorm(200)
id <- sample(1:20, 200, replace = TRUE)
x <- rnorm(200, 3)
cluster.lm(y, x, id)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.