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

From |
Richard Williams <Richard.A.Williams.5@ND.edu> |

To |
statalist@hsphsun2.harvard.edu, Stata List <statalist@hsphsun2.harvard.edu> |

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

Date |
Tue, 15 Jul 2008 21:48:56 -0500 |

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

Dear Richard,Seems to work for me. I copied impute.ado and called it impute2.ado, and placed it on c:\personal\ado (although anywhere in Stata's path should work). I then changed the 2nd line to

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

program impute2, sortpreserve

Finally, I replaced the two occurrences of "float" with "double". Then I ran the following:

. sysuse auto

(1978 Automobile Data)

. impute2 rep78 price mpg headroom, gen(xrep78)

6.76% (5) observations imputed

. des xrep78

storage display value

variable name type format label variable label

--------------------------------------------------------------

xrep78 double %10.0g imputed rep78

Make sure you did all of the above, and make sure Stata is finding impute2. Use the which command to check, e.g.

. which impute2

c:\ado\personal\impute2.ado

*! version 3.1.4 17jan2005

If somebody wanted to spend more time on this, I imagine they could check the type of the DV and, if it was double, set the type for the new variable accordingly. But, as Maarten says, it would be evil. :)

-------------------------------------------

Richard Williams, Notre Dame Dept of Sociology

OFFICE: (574)631-6668, (574)631-6463

HOME: (574)289-5227

EMAIL: Richard.A.Williams.5@ND.Edu

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/

**References**:**Re: st: RE: RE: -impute- variable creates only type 'float'***From:*Hewan Belay <hewan_belay@yahoo.com>

- Prev by Date:
**st: question about dummies for time periods** - Next by Date:
**st: Is there a kind of stochasticity in the execution of xthtaylor?** - Previous by thread:
**Re: st: RE: RE: -impute- variable creates only type 'float'** - Next by thread:
**Re: st: RE: RE: -impute- variable creates only type 'float'** - Index(es):

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