Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: mi estimate with wide data - "no imputations" error


From   daniel klein <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: mi estimate with wide data - "no imputations" error
Date   Fri, 19 Apr 2013 12:29:31 +0200

Vanessa,

I do not think there is anything wrong with your setup, except you do
not impute any values. If you type

. char li

in Stata, you will find the value 0 in the characteristic _dta[_mi_M],
which is telling Stata how many imputations there are. There is the
-mi set M- command which allows to set the number of imputations, but
I have not yet figured out, if and how it can be used in this
situation.

You can, nevertheless, "fix" this problem typing

. char _dta[_mi_M] 5

Here is an example using auto.dta

// toy data
clear
sysuse auto
forv j = 1/5 {
    g _`j'_rep78 = cond(mi(rep78), floor(5*runiform() + 1), rep78)
}

// declare mi
mi set w
mi reg imp rep78

// estiamtion (will not work)
cap n mi est : reg price i.rep78 mpg

// Stata cannot find any imputations
// here is why
char li

// fix it (work around)
char _dta[_mi_M] 5

// estiamtion
mi est : reg price i.rep78 mpg

Note that this is a work around and may introduce other probems. I
recommend reading through -help mi_technical- first.

Others may give other/better advice.

Best
Daniel

--
I am analyzing data that contains m = 5 imputations of a single
variable - poverty level (plev).

I did not impute the data - they were provided in a separate file from
the original data file that contained the missing data. I merged in
the imputed variables in wide format.

I have the following variables:
plev
_1_plev
_2_plev
_3_plev
_4_plev
_5_plev

I also have a 0,1 variable that indicates if the values of plev and
_1_plev through _5_plev are imputed, but only plev has missing values.

When I try to run mi estimate, I get the error "no imputations" so
clearly I am not setting this up correctly.

I have tried this sequence:
mi set wide
mi register imputed plev
mi register regular gender
mi estimate: reg plev gender

[...]

What is the correct syntax for mi estimate when your data is in wide
format and therefore imputed values are in separate variables? Or is
my problem in the way I have set up the data? Or the way in which I
have declared to Stata the format of my mi data?
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index