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: midiagplots for mi impute chained command: multiple imputation in stata


From   "Miguel Dorta" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re:st: midiagplots for mi impute chained command: multiple imputation in stata
Date   Wed, 29 Jan 2014 15:36:40 -0600

Linda O'Keeffe <[email protected]> is using the unofficial command
-midiagplots- and receives an error:

>I am using  mi impute chained command in stata.
>
>I have used dryrun to test that my models are appropriate and converge first
>of all and have now imputed with customised equations 5 datasets for 4
>variables BMI(continuous) and smoking, binge before pregnancy and binge
>during which are binary categorical variables.
>
>I am using a number of other variabels with some (very few) missing values to
>impute these data. The models converge and everything looks ok.
>
>I next go to do midiagplots to look at some diagnostics of observed vs.
>imputed values etc. However, I am getting an error message that I seem to not
>be able to resolve and cannot figure out what I am doing wrong. I include all
>of my syntax below.
>
> ...
>
>RESULTS OF MIDIAGPLOTS.******************
>
> midiagplots BMI
>(M = 15 imputations) (imputed: Any_binge_before Any_binge_pregnancy BMI
>Any_smoking_preg) _0_Prepregnancy_alcohol_consumption invalid name r(198);
>
>ERROR***********************************************
>
>r198: [P]     error . . . . . . . . . . . . . . . . . . . . . . . .  Return
>cod>e 198 invalid syntax; option __________ incorrectly specified; option
>__________ not allowed; __________ invalid; range invalid; __________ invalid
>obs no; invalid filename; __________ invalid varname; __________ invalid
>name; multiple by's not allowed; __________ found where number expected; on
>or off required; All items in this list indicate invalid syntax.  These
>errors are often, but not always, due to typographical errors.  Stata
>attempts to provide you with as much information as it can.  Review the
>syntax diagram for the designated command.  In giving the message "invalid
>syntax", Stata is not helpful.  Errors in specifying expressions often result
>in this message.
>
>(end of search)
>
>
>The results appear to be telling me that Prepregnancy_alcohol consumtion is
>an invalid name. But this variable is not an imputed variable. It is a
>regular variable. So I do not understand why it is picking it up in the
>MIDIAGPLOTS command

Clyde Schechter <[email protected]> responded that this error is
triggered by long variable names:

    http://www.stata.com/statalist/archive/2014-01/msg01054.html

We also suspect that this is the case.  Linda may consider renaming the
variable Prepregnancy_alcohol_consumption to have a shorter name.  However, it
is important that Linda uses the -mi rename- command instead of the -rename-
command to rename the variables in her -mi- data.

If renaming does not solve the problem, Linda can email the example and the
dataset to [email protected] and we will try to determine the cause of
the problem.


-- Miguel Dorta
[email protected]
*
*   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