Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: RE: -impute- variable creates only type 'float'


From   Richard Williams <[email protected]>
To   [email protected], Stata List <[email protected]>
Subject   Re: st: RE: RE: -impute- variable creates only type 'float'
Date   Tue, 15 Jul 2008 22:55:15 -0500

At 08:25 PM 7/15/2008, Hewan Belay wrote:
Dear Richard,

- making the impute.ado adjustment as you suggested sounded like a logical step. I did it, but it would refuse to recognise my newly created impute2.ado for some reason, though I saved it in the same folder as where impute.ado was located. By the way, looking at the ado file, I now see why -set type double, permanently- doesn't do the trick... because the ado file asks for new vars to be created as float, and the -set- just gives guidelines for new vars for which the type is not explicitly specified.
Yet another idea occurs to me:

sysuse auto, clear
clonevar xrep78 = rep78
impute xrep78 price mpg headroom, gen(tempvar)
replace xrep78 = tempvar if missing(xrep78)
drop tempvar

If rep78 was double precision, xrep78 would also be double precision. The values of the nonmissing cases would be every bit as precise as in the original variable. Only the imputed values would have any loss of precision by not estimating them as double in the first place (but then again they were imputed so it isn't like they were accurate to 12 decimal places anyway).

-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME: (574)289-5227
EMAIL: [email protected]
WWW: http://www.nd.edu/~rwilliam

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