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]
st: Generate random missing values within a set of variables
From
Sofia Ramiro <[email protected]>
To
<[email protected]>
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/