Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

st: Generate random missing values within a set of variables


From   Sofia Ramiro <sofiaramiro@hotmail.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Generate random missing values within a set of variables
Date   Sun, 15 Apr 2012 13:06:08 +0100

Dear all, 

I have 6 variables (without missings) and I would like to randomly generate one missing value in one of the 6 variables per line/observation (and then in another set of variables randomly generate 2 missing values per line/observation - 2 out of the 6 variables). 
I know that with the runiform command we manage to choose observations randomly within one variable (so I could generate random missing values within one variable), but how can I choose randomly one variable out of the 6 to be transformed into missing and make sure that one of them is being transformed per observation?

I appreciate your help.

Thanks!

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