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

st: impute >31vars

From   Kit Baum <[email protected]>
To   [email protected]
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:

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

* For searches and help try:

© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index