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

st: impute >31vars


From   Kit Baum <baum@bc.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: impute >31vars
Date   Thu, 18 Nov 2004 13:24:13 -0500

The answer, like so much else in computation, relates to a power of 2:

impute.ado:
/* vm is coded m.v. pattern for x */
gen long `vm' = 0 if `touse'
scalar `bit' = 1
foreach var of local rhs {
replace `vm' = `vm' + `bit'*(!missing(`var'))
scalar `bit' = `bit' * 2
}
The missing value pattern stores the pattern for as many variables as there are bits in a 4-byte word, namely 32. Stata does not support a 'long long' integer type, and it would not be feasible to store as a floating point value (e.g. double). If I wanted to rewrite this code to deal with the limitation, I'd have to keep track of more than one longword. That is certainly feasible, but Nick Cox's question applies.

Kit Baum, Boston College Economics
http://ideas.repec.org/e/pba1.html

*
* 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