Announcement

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

  • Prediction after estimation empty due to missings.

    Hello!

    I have time series survey data and want to analyze the effects of a policy that was introduced late 2000.
    The pre period is hence from 1996-early 2000, the post period omits late 2000 and runs from 2001-today.
    I then want to compare the effects of the 2008 financial crisis to the 2000 stock market bubble, relative to the pre-policy period.

    I hence want to use the four years after 2007 (2008-2011) to predict 2001-2004.
    I then want to compare the 2001-2004 prediction to the actual responses.

    The difference should then be driven by the policy.

    This is the dummy crisis08:

    Code:
    gen crisis08 = 0
    replace crisis08 = 1 if year > 2007 & year < 2012
    replace crisis08 = . if year > 2011
    replace crisis08 = . if year > 2000 & year < 2008
    replace crisis08 = . if dateq == yq(2000, 4)
    The estimation should hence only compare 1996-2000 with 2008-2011. The years in between are treated as missings.

    Code:
    reg dv crisis08 age male urban educ married working, vce(robust)
    predict pred_values if inrange(year, 2001, 2004)
    gen diff = dv - pred_values if inrange(year, 2001, 2004)
    summarize diff if inrange(year, 2001, 2004)
    After running this code "pred_values" is empty, as in the estimation crisis08 omits the years 2001-2004.

    I tried to fix it like this:

    Code:
    gen post08 = 0
    replace post08 = 1 if year > 2007
    and then:

    Code:
    reg dv post08 $c if !inrange(year, 2001, 2007), vce(robust)
    predict pred_values if inrange(year, 2001, 2004)
    gen diff = dv - pred_values if inrange(year, 2001, 2004)
    summarize diff if inrange(year, 2001, 2004)
    Is this the correct approach?

    Thank you!
Working...
X