Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error r(900) - no room to add variables, up to 2048 variables are allowed, but I'm only using 45 variables

    Hi. I'm trying to run the xthdidregress twfe command on a dataset with 1650 observations, but only 45 variables using Stata version BE 18. However, I keep running into the error below and I don't understand why. Can someone please help me? Thanks.

    Code:
    
    xthdidregress twfe (rate_con_avg7day rate_test_avg7day) (stepone), group (state
    > num )
    note: variable _did_cohort, containing cohort indicators formed by treatment
          variable stepone and group variable statenum, was added to the dataset.
    no room to add more variables
        Up to 2,048 variables are allowed with this version of Stata.  Versions are
        available that allow up to 120,000 variables.
    r(900);
    
    .

  • #2
    Originally posted by Scott Rick View Post
    . . . I keep running into the error below and I don't understand why. Can someone please help me?
    It seems to be generating interim indicator variables that might exceed your limit.

    According to the note it gave you, you might want to try
    Code:
    contract stepone statenum if !missing(stepone, statenum), zero
    count
    in order to see whether that's the source of the trouble.

    Comment


    • #3
      Joseph Coveney Hi Joseph. Thanks for that. The count is 70, so that still doesn't make sense. right? Could there be any other sources of trouble here?

      Comment


      • #4
        Dear Scott,

        If possible, could you please send a copy of your data and do-file to [email protected] for us to look at the issue more closely.

        If you look at the methods and formulas section, you can see that to fit the model interactions between time fixed effects, cohort fixed effects, and covariates are generated. Additionally, we are generating panel-level means. Depending on the number of time periods and cohorts this number of variables can exceed the system limits. The other methods (ra, ipw, and aipw) are less sensitive to this. However, it seems that, even if the estimator returns results, the number of time periods per cohort implies you are estimating a large number of parameters.

        Comment


        • #5
          Enrique Pinzon (StataCorp) Thanks, that makes sense. Unfortunately, I cannot share the data due to a NDA, but I can share this - the panel variable has 35 unique values (i.e. 35 cohorts) with ~45 time periods per cohort. While the dataset has a total of 45 variables, the code below employs only 5 variable - one outcome variable, one covariate, a treatment variable, and the panel and time variables.

          Code:
            
           xthdidregress twfe (rate_con_avg7day rate_test_avg7day) (stepone), group (state > num ) note: variable _did_cohort, containing cohort indicators formed by treatment       variable stepone and group variable statenum, was added to the dataset. no room to add more variables     Up to 2,048 variables are allowed with this version of Stata.  Versions are     available that allow up to 120,000 variables. r(900);

          Comment


          • #6
            Hi Scott,

            I would suggest that you use the -ra- estimator instead of the -twfe- estimator. I can see how you can exceed the system limits with the number of cohorts and time periods you mention.

            Comment


            • #7
              Thanks Enrique Pinzon (StataCorp)

              Comment

              Working...
              X