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 on April 23, and its replacement, is already up and running.

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

Re: st: MI reshape

From (Yulia Marchenko, StataCorp)
Subject   Re: st: MI reshape
Date   Fri, 03 Feb 2012 09:54:15 -0600

Laura Gibbons ( received a "variable not found" error
from -mi reshape long-:

> My reshape command dies at the "assembling results" stage:
> . mi reshape long adas12_m, i(studyid) j(month)
> reshaping m=0 data ...
> (snip)
> reshaping m=1 data ...
> reshaping m=2 data ...
> (snip)
> reshaping m=20 data ...
> assembling results ...
> variable adas12_m not found
> r(111);

We identified the problem.

The error occurred because the -adas12_m#- variables in the original wide data
have different -mi- registrations, such as 

                adas12_m1     regular 
                adas12_m2     imputed 
                adas12_m3     passive
		adas12_m4     ...

So how should the new variable in the long dataset be registered:

                adas12_m     ???

-mi reshape- got confused. 

Basically, all the variables in the wide dataset need to be registered the 
same way:  all as imputed, or all as passive, or all as regular, although 
it is okay if some are unregistered. 

So that is what Laura needs to do to work around the problem:  register 
all the -adas12_m#- variables the same way.

We will fix -mi reshape-, but that fix may merely involve an improved error
message.  Determining how a stacked imputed, passive, and regular variables
are to be registered after stacking may be something best left to the

Laura also mentioned that the -noupdate- option with -mi reshape- produces 
an error:

      . mi reshape long adas12_m, i(studyid) j(month) noupdate
      reshaping m=0 data ...
      option noupdate not allowed
Despite what the documentation says, -noupdate- is not allowed with 
-mi reshape-.  We will fix the help file and the documentation.

-- Yulia                   -- Bill
*   For searches and help try:

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