Stata中xtoverid命令报错‘varlist not allowed’求助
varlist not allowed Error with xtoverid in Stata Hey there! As a fellow Stata learner who’s stumbled through similar missteps, let’s break down this error and get your robust Hausman test working smoothly.
What does varlist not allowed actually mean?
This error is Stata’s way of saying: "You gave me variables I don’t need here!" Unlike xtreg where you have to specify your regression variables, xtoverid is a post-estimation command—it relies entirely on the results of the last panel regression you ran. You don’t need to retype your model variables when using it.
Step-by-Step Correct Workflow
Here’s how to run the robust Hausman test properly:
First, fit your fixed effects model with
xtreg(this is the modelxtoveridwill use as its baseline):xtreg s_roa1 s_roa c_roa, fe i(year)Make sure this command runs without errors first—it needs to generate the model results that
xtoveridwill reference.Run
xtoveridwithout adding any variables—it pulls all necessary info from the previousxtregoutput automatically:xtoveridThat’s it! This will perform the robust Hausman test comparing your fixed effects model to the random effects alternative.
Why Your Original Command Failed
The syntax for xtoverid is straightforward:
xtoverid [, options]
By including s_roa1 s_roa c_roa in your command, you added a variable list that xtoverid doesn’t accept. Stata saw this as invalid input and threw the varlist not allowed error.
内容的提问来源于stack exchange,提问作者TTT




