Announcement

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

  • #16
    I will guess that your yeargroup variable takes values from 1 to 12. So when you adapted my code to match your data, where I wrote
    Code:
    forvalues sm = 0/1 {
    which corresponded to the two values that the variable smsa could take in the example data I used to demonstrate the process (lacking any example of your data), why did you change it to
    Code:
    forvalues sm = 0/12{
    instead of
    Code:
    forvalues sm = 1/12 {
    which would correspond to the values that the variable yeargroup takes in your data?

    Of course, that was a guess. Perhaps yeargroup takes some entirely different set of values; you have not said what values it takes. The important thing is that to have the set of regressions run separately for each value of yeargroup the for command you use to construct the loop (forvalues in this case) has to include what those values actually are. The first time through the loop the keep command became
    Code:
    keep if yeargroup==0
    and no observations were kept.
    Last edited by William Lisowski; 03 May 2021, 12:20.

    Comment

    Working...
    X