Announcement

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

  • #16
    If I eliminate the original data_store_x3, I immediately get a message variable data_store_x3 not found so I had to keep that.
    Yes, that's correct. Apologies for my error.

    But I have another question. How can I get the usual ANOVA to display showing RSS, etc, over all itertions?
    The -regress- command does not display RSS. I'm not sure exactly what you have in mind with "etc.", perhaps MSS and df? In any case, those aren't generally considered of much interest in regression (as opposed to ANOVA--which is not applicable to your continuous predictors). But if you want RSS and MSS you will find them in e(), just as you found e(rmse). And since your model includes only continuous predictors, df is always 1, so you don't have to think about that one.

    Going forward, please be sure to use code delimiters when posting your code, so that it aligns well and preserves indentation. If you are not actually indenting your code, I strongly recommend you develop that habit. Unindented code with nested loops is very difficult for others to read, even if you know what its structure is. And, frankly, if you come back to this code in a few weeks after not looking at it, you will find it difficult to read as well.

    Comment


    • #17
      If I eliminate the original data_store_x3, I immediately get a message variable data_store_x3 not found so I had to keep that.



      Yes, that's correct. Apologies for my error.
      Actually, I retract that response. The code in #13 to which I responded with the suggestion of eliminating the variable data_store_x3 was different from what you are running in #15. In #13, the variables data_store_x3, data_store_x3, and data_store_con are created in those -gen- statements but they are never later -replaced- or used in any other way in the rest of the code. In that code, each time through the loop you created new variables data_store_x3_50, data_store_x3_500, etc. So the original data_store_x3, etc. variables were superfluous. But in the code in #15, you do not create new variables to store the regression results with different numbers of observations: here you actually do -replace- the values of data_store_x3, data_store_x2, and data_store_cons inside the loop, so you do need the initializations of those variables with -gen- before the loop.

      So your observation is correct with respect to your changed code, but my observation was correct with respect to the original code it responded to.

      Comment

      Working...
      X