Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

Re: Re: st: MI: Multiple Imputation


From   weddings@stata.com (Wesley D. Eddings, StataCorp)
To   statalist@hsphsun2.harvard.edu
Subject   Re: Re: st: MI: Multiple Imputation
Date   Mon, 20 Dec 2010 18:00:33 -0600

Shikha Sinha <shikha.sinha414@gmail.com> asked about using the -by- prefix
with -mi estimate-:

> A follow-up question: How can I run the following command for each country?
> Can I use bysort,
>
> mi estimate, or: logistic Y X1 X2 edu

The -mi estimate- command does not support the -by- prefix.  Shikha may
instead run -mi estimate- inside a loop and use an -if- qualifier to restrict
estimation to a particular country.  Here are the commands for the model
Shikha mentioned:

* begin commands
quietly levelsof country, local(countries)
foreach c of local countries {
   mi estimate, or: logistic Y X1 X2 edu if country==`c'
}
* end commands

--Wes
weddings@stata.com


  

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


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index