问题
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