Question

In: Statistics and Probability

Stata command for running an RDD with 2 treamtents and cut-off lines

Stata command for running an RDD with 2 treamtents and cut-off lines

Solutions

Expert Solution

// Before program participation 
set seed 2
set obs 1000
range x_obs -1 1 1000
g y_pre = x_obs^3 + rnormal()

tw scatter y_pre x_obs, msize(small) mcolor(gs10) ///
    || lfit y_pre x_obs, range(-.35 .35) lcolor(black) lw(thick) ///
        xline(0, lpattern(-)) ///
        yt("Outcome variable (Y)") ///
        xt("Assignment variable (X)") ///
        t("Before program participation") ///
        legend(off)  ///
        xline(-.35 .35, lp(-) lc(gs10)) ///
        text(-4.5 -.35 "{it:-h}") ///
        text(-4.5 +.35 "{it:h}")

// After program participation 
set seed 2
local tau = 1.25
cap drop y_post
g y_post= x +`tau' + rnormal() if x=0

tw scatter y_post x_obs, msize(small) mcolor(gs10) yl(-4(2)4) ///
     || lfit y_post x_obs if inrange(x_obs, -.35, 0), ///
        range(-.35 0 ) lcolor(black) lw(thick) ///
     || lfit y_post x_obs if inrange(x_obs, 0, .35), ///
        range(0  .35 ) lcolor(black) lw(thick) ///
        xline(0, lpattern(-)) ///
        yt("Outcome variable (Y)") ///
        xt("Assignment variable (X)") ///
        t("After program participation") ///
        legend(off) ///
        text(.9 0.05 "{&tau}", size(*2)) ///
        xline(-.35 .35, lp(-) lc(gs10)) ///
        text(-4.5 -.35 "{it:-h}") ///
        text(-4.5 +.35 "{it:h}")

Related Solutions

 how to run a t-test using STATA step by step?(command)
 how to run a t-test using STATA step by step?(command)
What's the command for testing the significance of the treatment effect in STATA. (treatment: anykids; expansion:...
What's the command for testing the significance of the treatment effect in STATA. (treatment: anykids; expansion: post 93)
Without using the regress command in Stata, how may one compute the slope and the intercept...
Without using the regress command in Stata, how may one compute the slope and the intercept of the regression line given data in .dta format?
1. Try running the deadlock simulator using the following command: java deadlock a 2 2 Explain...
1. Try running the deadlock simulator using the following command: java deadlock a 2 2 Explain why a deadlock does not occur. 2. There are two additional process command files ("b0.dat" and "b1.dat") in the distribution. Run the deadlock simulator with this command: java deadlock b 2 1 1 What happens? Now try this: java deadlock b 2 1 2 Why does the first command result in a deadlock but the second does not? Explain your answer in terms of...
The end of a stopped pipe is to be cut off so that the pipe will...
The end of a stopped pipe is to be cut off so that the pipe will be open. If the stopped pipe has a total length L, what fraction of L should be cut off so that the fundamental mode of the resulting open pipe has the same frequency as the fifth harmonic (n=5) of the original stopped pipe? Express your answer in terms of L.
Compare Scoring Methods and Cut-off Score Methods
Compare Scoring Methods and Cut-off Score Methods
Conceptualize the cut off region and a saturation region of a BJT.
Conceptualize the cut off region and a saturation region of a BJT.
• Develop an "Echo" command that returns the parameters on different lines. Example: For input "$...
• Develop an "Echo" command that returns the parameters on different lines. Example: For input "$ Java Echo Hello world!" The answer will be: "Hello world ! ” using java programming language
Q1: Design a 9th order low-pass filter with cut-off ?? /2 using the Hanning window. a)...
Q1: Design a 9th order low-pass filter with cut-off ?? /2 using the Hanning window. a) Plot its frequency response. b) Express the Input/ Output relation. c) let ??[??]{ 0    ??or ??=0,1,2…..,10 {1 ??or ??=11,12,…..30 Calculate ??=????. Plot and comment on the shape of y. Q2: Design a 9th order high-pass filter with cut-off ??/ 4 using the Hanning window. a) Plot the frequency response. b) Express the Input/ Output relation. c) let ??[??]={ 0    ??or ??=0,1,2…..,10 {1...
Design a 9th order low-pass filter with cut-off ??/ 2 using the Hanning window. a) Plot...
Design a 9th order low-pass filter with cut-off ??/ 2 using the Hanning window. a) Plot its frequency response. b) Express the Input/ Output relation. c) let ??[??] = { 0           ?????? ?? = 0,1,2…..,10 1    , ?????? ?? = 11,12,…..30        Calculate ?? = ?? ? ?. Plot and comment on the shape of y.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT