Matlab Replication of OLS regression with clustered standard errors Stata-command [closed]

耗尽温柔 提交于 2020-04-07 08:46:16

问题


A newbie question: I want to replicate the following Stata code in Matlab:

    reg logbid1 logmiles photos photos2 options logfdback negpct cont*, cluster(sellername_id)
estimates store m1, title((1))

This represents an Hedonic regression with clustered standard errors (the clustervariable "sellername_id" is a variable with more than 40,000 different seller ids). I have attached an image of the Stata output table to this post: Stata Output Table

With the following fitlm-function I can replicate the same beta coefficients in Matlab, but not Standard Errors:

hed_reg_test=fitlm([constant,logmiles,photos,photos2,options,logfdback,negpct,cont_carmodel,cont_week,cont_year],logbid1)

This is, because fitlm does not allow me to cluster the standard errors based on sellername_id, as far as I understand. I have also attached an image of my Matlab output to this post: Matlab Output

Does anyone know a function in Matlab that allows me to replicate the Stata Code above?

来源:https://stackoverflow.com/questions/60934294/matlab-replication-of-ols-regression-with-clustered-standard-errors-stata-comman

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!