Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: gsample


From   Marcello Pagano <[email protected]>
To   [email protected]
Subject   st: gsample
Date   Thu, 06 Dec 2007 11:02:58 -0500

Hello,
I would like to use gsample sampling command for cross validation of my regression discontinuity as suggested bu Austin Nichols in “Causal inference with observational data”.
The idea is to randomly choose placebo cut off points and test continuity of the forcing variable and the outcome variable. Now Nichols suggests generating random samples from the data. When using the gsample command stata suggests that mm_sample() is required asks me to install moremata. Having installed moremata the same problems occurs again. What could be the problem. I’m using stata 10.0 and my code looks as follows:

ssc install gsample, replace
gsample 100, wor gen(pick)
levelsof x2co if pick==1, loc(p)
foreach val of local p {
cap drop newz
g newz=x2co-‘val’
bootstrap r(d), reps(1000): discont y znew
bootstrap r(d), reps(1000): discont x2co znew}

Does anyone have an idea what goes wrong with using gsample?
Thank You in advance,
Torsten Santavirta
Helsinki School of Economics
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index