Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: Randomly assigning certain percentage of observations within groups


From   wanhaiyou <[email protected]>
To   [email protected]
Subject   Re: st: Randomly assigning certain percentage of observations within groups
Date   Wed, 1 Jan 2014 22:31:56 +0800 (GMT+08:00)

Hi Sabbatini,

Try:
cumul hosp, g(g) eq
recode g (min/0.66=1)(0.66/0.83=2)(0.83/max=3)

HTH


> -----原始邮件-----
> 发件人: "Sabbatini, Amber" <[email protected]>
> 发送时间: 2014-01-01 20:49:45 (星期三)
> 收件人: "[email protected]" <[email protected]>
> 抄送: 
> 主题: st: Randomly assigning certain percentage of observations within groups
> 
> Hi Statalisters!  I have national hospital data of over 22 million visits
> to the emergency room within 961 hospitals.  I want to create 3 new
> indicator variables for low, moderate and high acuity visits and randomly
> assign a percentage of patients with specific diagnoses within each
> hospital to these acuity groups.
> 
> For example, for patients with a urinary tract infection, I wish to assign
> 66% of the patients within each hospital to the low group, 17% of the
> patients within each hospital to the moderate group, and
>  17% of the patients within each hospital to the high group.  I also want
> Stata to pick which patients it assigns within each hospital randomly to
> reduce bias and evenly distribute patients on their other characteristics
> (age, gender, etc).
> 
> Any ideas how this might be accomplished?
> 
> Thanks,
> 
> Amber Sabbatini, MD MPH
> Clinical Lecturer 
> University of Michigan
> 
> **********************************************************
> Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues 
> 
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/


--
Bests,

wanhaiyou

Hunan University


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index