# st: Trouble with hotdeck procedure

 From "Reza Daniels" <[email protected]> To <[email protected]> Subject st: Trouble with hotdeck procedure Date Wed, 4 Aug 2004 12:33:42 -0700

```Dear Statalisters,

I am having trouble using the hotdeck procedure to impute values for y2a
(obs=100, missing=54) from y1 (obs=100, missing=0). The first 25
observations are as follows:

sort y1
list y1 y2a in 1/25

+-----------------------+
|        y1         y2a |
|-----------------------|
1. | -1.872524   -1.342797 |
2. |  -.950053           . |
3. | -.8294063           . |
4. | -.8209193    2.082552 |
5. | -.6955014     1.37202 |
|-----------------------|
6. |  -.542197           . |
7. |  -.472739           . |
8. | -.4225743    1.702473 |
9. |  -.337009           . |
10. | -.3161629    2.368211 |
|-----------------------|
11. | -.2584664           . |
12. |   -.18923           . |
13. | -.1845185           . |
14. | -.1309191           . |
15. | -.1286997    .9998891 |
|-----------------------|
16. |   -.12622    3.163509 |
17. | -.1032103    2.781668 |
18. | -.0957911    1.384086 |
19. | -.0614794    1.152725 |
20. | -.0567206           . |
|-----------------------|
21. | -.0264047    .9421599 |
22. |   .026992           . |
23. |  .0503024           . |
24. |  .1294022           . |
25. |  .1481918     3.47327 |
+-----------------------+

I use the following code to try to impute for y2a==.

sort y1
hotdeck y2a, by(y1) store
use imp1
list

After the hotdeck command, I get an error message:

"WARNING: 54 strata with NO observed data
46 strata with only 1 observed data
100
WARNING: When the <command> option is not selected
then no analysis is performed on the imputed datasets"

When the list is generated afterwards, no imputation has taken place.

I have no idea how to overcome this. Is it a matter of my data being in long
versus wide format? Any suggestions would be most appreciated.

Reza

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