You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

Stata中xtoverid命令报错‘varlist not allowed’求助

Fixing the 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:

  1. First, fit your fixed effects model with xtreg (this is the model xtoverid will 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 xtoverid will reference.

  2. Run xtoverid without adding any variables—it pulls all necessary info from the previous xtreg output automatically:

    xtoverid
    

    That’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

火山引擎 最新活动