Announcement

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

  • RD Regression with multiple thresholds

    Hello all,
    I currently try to set up an RD-regression with 10 thresholds. For a single threshold the regression should be as follows:
    Code:
    gen Ntilde1000 = wpop / 1000
    gen logNtilde1000 = ln(Ntilde1000)
    gen Gtilde1000 = exptot / 1000
    gen logGtilde1000 = ln(Gtilde1000)
     
    rdrobust logGtilde1000 logNtilde1000 if logNtilde1000 >= -0.15 & logNtilde1000 <= 0.15, c(0) p(3) kernel(epanechnikov) h() vce(nn)
    I managed to set up the loops for the generation of the necessary variables:
    Code:
    foreach i in 1000 2000 3000 5000 10000 20000 30000 50000 100000 200000 {
         gen Ntilde`i' = wpop / `i'
         gen logNtilde`i' = ln(Ntilde`i')
    }
    foreach t in 1000 2000 3000 5000 10000 20000 30000 50000 100000 200000 {
         gen Gtilde`t' = exptot / `t'
         gen logGtilde`t' = ln(Gtilde`t')
    }
    As a next step I have to set up an RD-regression for all 10 thresholds. I tried to create a loop for this as well:
    Code:
    foreach i of logGtilde`i' {
         foreach t of logNtilde`t' {
               if `i' == `t'
         rdrobust i t if logNtilde`t' >= -0.15 & logNtilde`t' <= 0.15, c(0) p(3) kernel(epanechnikov) h() vce(nn)
    }
    }
    Unfortunately, the loop is not working. Stata is still very new to me, so maybe someone knows how to fix it. My goal is to have something like this:
    Code:
    rdrobust logGtilde1000 logNtilde1000 if logNtilde1000 >= -0.15 & logNtilde1000 <= 0.15, c(0) p(3) kernel(epanechnikov) h() vce(nn)
     
    rdrobust logGtilde2000 logNtilde2000 if logNtilde2000 >= -0.15 & logNtilde2000 <= 0.15, c(0) p(3) kernel(epanechnikov) h() vce(nn)
     
    rdrobust logGtilde3000 logNtilde3000 if logNtilde3000 >= -0.15 & logNtilde3000 <= 0.15, c(0) p(3) kernel(epanechnikov) h() vce(nn)
    …
    Even if it would work, would I get a single value (including a p-value)?

    I would appreciate your help a lot!! Best, Kathrin

    Last edited by Kathrin Me; 21 Sep 2021, 10:33.

  • #2
    As long as the 1000/2000/etc is the the same for all variables, then use this:
    Code:
    foreach i in 1000 2000 3000 5000 10000 20000 30000 50000 100000 200000 {
        rdrobust logGtilde`i' logNtilde`i' if logNtilde`i' >= -0.15 & logNtilde`i' <= 0.15, c(0) p(3) kernel(epanechnikov) h() vce(nn)
    }
    Don't think you'll get a single p-value across 10 regressions. Possibly use test after each regression and accum, but not sure that's valid here.

    Comment


    • #3
      Thank you George! I managed inbetween

      Comment

      Working...
      X