I was interested in setting e(sample) manually in a program. Does
anyone have any suggestion?
I saw a prior post on this issue, and they suggested just removing
from the dataset all the observations that are not in e(sample). In
my context this is not all that practical.
I am including my program below (with e(sample)) below.
Richard
capture program drop panova
program define panova, rclass
version 9.0
syntax varname [if] [, NONOPTION]
marksample touse
capture drop jdrug
egen jdrug = mean(drug) if `touse', by(jud)
sum jdrug if obs2 == 1 & `touse', detail
return scalar x = r(p75)-r(p25)
end
permute drug "panova" r(x), reps(100) strata(id3) saving(permanova)
*
* 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/