Announcement

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

  • Can't get r(singleresults) after estat firststage

    Hello. I am using Stata 13, and want to use the simulate command to run a 2SLS regression many times, drawing random samples with replacement, and obtaining the first-stage R^2 and F-statistic as matrices to be saved after the simulate command (or, since the output is stored as variables, to designate each entry in each matrix as an observation for a R^2 or F-stat "variable", respectively).

    However, a trial run to obtain these statistics was unsuccessful: the Stata manual states that after ivregress, estat firststage stores them in a matrix called r(singleresults). If I delete "single" and replace it with "multi", it has no problem returning Shea's partial R^2 statistics, but it claims not to be able to find the r(singleresults) matrix. If I specify the , first option after ivregress, the first-stage regression has no problem returning the first-stage R^2 and F-statistics. ivregress by itself doesn't store these statistics after estimation, so I'm a bit stuck as to how to retrieve them if not via the estat firststage postestimation command. Is there an alternative way of storing these statistics, or is this due to some other problem that can be fixed with a patch of some sort?

    Thanks in advance.

  • #2
    What happens if you type -return list- after the -estat firststage- command. Is the matrix r(singleresults) there?

    If it is listed, then the matrix is being generated, and there is some problem with the way you are referencing it. If r(singleresults) is not there, and only r(multiresults) is listed, then the r(singleresults) matrix is not being generated for some reason. I don't know enough about the ivregress command to say why that might be. I'm sure someone here knows, but you would have to tell us more about how you are using the command. You should post some example code, showing what you typed and the error that you receive.

    If you want to bypass this problem all together, you could just get the results from a regular -regress- command. Run the first-stage regression manually, and get the R^2 and F-stat from those results. Just make sure you don't have missing data that causes your sample to change between the two commands.

    Mike

    Comment


    • #3
      try estat firststage, all

      This should give you what you need.

      Comment


      • #4
        I have the same problem
        estat firststage, all
        local fs=r(mineig)
        display "`fs'"
        But donĀ“t work

        Comment

        Working...
        X