Announcement

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

  • Estimate Store Returning an Error

    I am trying to use loop to run regression over different subsamples as defined by another variable. The variable I am using to subset regressions is a string variable. However, while running the loop the estimate store returns with a error saying "11 Invalid Name".

    The 11 above is part of the first value of the string variable. The string contains values such as 11, 21, 22, 23, 31-33 and so on.

    Below is the screenshot of the code.

    Click image for larger version

Name:	Screenshot 2023-02-12 at 7.39.52 PM.png
Views:	1
Size:	342.4 KB
ID:	1701326

  • #2
    The estimates store command requires an argument that follows the guidlines for a Stata name, as described in Section 11.3 of the Stata Userf's Guide PDF included in your Stata installation and accessible from Stata's Help menu.

    In this case, your problem is that a name must begin with a letter (either upper case or lower case) or an underscore. "11" does not. You can solve this problem, for example
    Code:
    estimates store sector`i'
    so that the estimate names will be sector11 and so on.

    Comment

    Working...
    X