  | 
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: RE: RE: -impute- variable creates only type 'float'
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.
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
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:  [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/