Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 205423

How to create an linear model output with clustered (by firms) standard error in R

$
0
0

[https://1drv.ms/u/s!ArUNQ8J4vgGqhe8IAVP0ulapoEv4uQ?e=wRMEWN][1]

m1_1 <- lm(ROA ~ fam_ownership + lag_investment + dual_class + age + crisis
           , na.action=na.exclude,
           data) 

m1_2 <- lm(ROA ~ fam_ownership + fam_ownership_squared + lag_investment + dual_class + age+crisis, 
           na.action=na.exclude,
           data)

m1_3 <- lm(ROA ~ fam_ownership + fam_ownership_squared + lag_investment + dual_class + age +crisis
           + as.factor(industry) + +as.factor(year),  na.action=na.exclude,
           data)

m1_4 <- lm(ROA ~ fam_ownership + famfirm50 + lag_investment + dual_class + age+crisis
           + as.factor(industry)+as.factor(year), na.action=na.exclude,
           data) 


stargazer(m1_1,m1_2,m1_3,m1_4, type="html", dep.var.labels=c("ROA"), intercept.bottom = FALSE,
          out="OLS1")

I have provided my data frame as well as my R code above.

I am trying to cluster standard errors on firm level.

firm id = gvkey

I have tried the miceadds package but I was not capable of executing it properly.

In the end I want to create an linear regression output including clusterd standard errors on firm level.

Thank you so much!!!


Viewing all articles
Browse latest Browse all 205423

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>