Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: Random assignment


From   dario.consonni@unimi.it
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: Random assignment
Date   Sat, 27 Dec 2003 00:02:10 +0100

I think you meant:

replace y=uniform()<=`p' if y==.

Dario Consonni

----- Original Message -----
From: "FEIVESON, ALAN H. (AL) (JSC-SK) (NASA)" <alan.h.feiveson@nasa.gov>
Date: Wednesday, December 24, 2003 10:18 pm
Subject: st: RE: Random assignment

> Here's one way - suppose your dichotomous variable is y:
> 
> summ y
> local p=r(mean)  
> replace y=uniform<=`p' if y==.
> 
> Al Feiveson
> 
> 
> 
> -----Original Message-----
> From: celdjt@umich.edu [mailto:celdjt@umich.edu]
> Sent: Wednesday, December 24, 2003 12:40 PM
> To: statalist@hsphsun2.harvard.edu
> Subject: st: Random assignment
> 
> 
> I have a data set with 50 missing values for a dichotomous 
> variable, coded 
> 1 and 0; I would like to recode the 50 missing values to non-
> missing, 
> inserting 1 and 0's on a random basis proportionate to their 
> presence in 
> the overall data set. Any porcedure for this sort of thing in 
> stata. 
> Thanks.
> 
> *
> *   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/
> *
> *   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/
> 

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index