Statalist The Stata Listserver


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

st: Re: impute vs. predict


From   "Rodrigo A. Alfaro" <[email protected]>
To   <[email protected]>
Subject   st: Re: impute vs. predict
Date   Thu, 1 Mar 2007 14:54:46 -0500

The answer is clear in the manual: -impute- uses the best available set to make the prediction. For example
impute y x1 x2, g(z1)
reg y x1 x2
predict z2
reg y x1
predict z3
reg y x2
predict z4

then z1 will be - y if y is not missing
- z2 if y is missing, but x1 and x2 are not - z3 if y and x2 are missing
- z4 if y and x1 are missing
- missing if y, x1 and x2 are missing.

Rodrigo.


----- Original Message ----- From: "Caleb Southworth" <[email protected]>
To: <[email protected]>
Sent: Thursday, March 01, 2007 3:50 PM
Subject: st: impute vs. predict



What is the difference between -impute- and -reg- followed by
-predict-?

For example:

. impute t_aflcio_mem temp year if inrange(year,1956,2005),
g(i_aflcio_mem)
44.00% (22) observations imputed

. quietly reg t_aflcio_mem temp year if inrange(year,1956,2005)

. predict yhat if inrange(year,1956,2005)
(option xb assumed; fitted values)
(77 missing values generated)

. list year i_aflcio_mem yhat in 77/87

    +----------------------------+
    | year   i_aflc~m       yhat |
    |----------------------------|
77. | 1956    15707.5   14748.04 |
78. | 1957    15965.1   15062.62 |
79. | 1958    13849.3    14816.2 |
80. | 1959    13701.4   14569.78 |
81. | 1960    13866.6   14336.76 |
    |----------------------------|
82. | 1961    13618.2   14103.74 |
83. | 1962    13784.8   14021.69 |
84. | 1963    13904.2   13939.65 |
85. | 1964    14235.3   14286.39 |
86. | 1965    14815.9   14633.13 |
    |----------------------------|
87. | 1966    15372.1   15372.03 |

. pwcorr yhat i_aflcio_mem

            |     yhat i_aflc~m
-------------+------------------
       yhat |   1.0000
i_aflcio_mem |   0.8947   1.0000

OK, so the reg prediction and imputation differ, but why? -eret li-
indicates that -impute- is -regress-.

Thanks!

Caleb
[email protected]
University of Oregon Sociology
*
*   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/
*
*   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/



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