Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Dummy variable from imputed variable


From   Eric Booth <[email protected]>
To   [email protected]
Subject   Re: st: Dummy variable from imputed variable
Date   Mon, 25 Jan 2010 17:29:04 -0600

>

>

Tim seems to be asking how to grab the 90th percentile after imputations are run or variables 
are created in a way where that 90 percentile point is not consistent each time the do-file is run. 
One way to do this is to use -sum, d- with the saved scalars for the percentiles, ex:

*--------begin
clear
sysuse auto
sum price, d
di "`r(p10)'"     //10 percentile
di "`r(p90)'"     //90 percentile
gen dummy = 1 if inrange(price,`r(p10)', `r(p90)')
recode dummy (.=0)
tab price dummy
*---------end

~ Eric

__
Eric A. Booth
Public Policy Research Institute
Texas A&M University
[email protected]
Office: +979.845.6754
Fax: +979.845.0249
http://ppri.tamu.edu


On Jan 25, 2010, at 4:50 PM, Tim Malacarne wrote:

> Hello,
> 
> Does anyone know how to create a dummy variable based on percentile ranges of a multiply imputed variable using Stata 11?  I have imputed income and want to create dummies representing ranges of the income distribution for each imputation, but I've been unable to find a way to vary the cut points with for the different imputations.
> 
> I can use "mi passive: generate dummy if inc>x & inc<y" to create dummies in each imputation, but as each imputation has a different value for its 90 %, this isn't ideal.
> 
> Thanks a lot,
> Tim
> 
> 
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/





*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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