
12

Hi,
I had a dataset on excel with regions on the rows and years on the columns.
I moved this data to Stata 10.1 MP(updated to the latest packages) and
was trying to reshaping from wide to long as I would like to have all
years' data of the same variable on the same column.
Below, I report an example of what I have:
regio prod1995 prod1996 .....prod2006
1 .... ... ...
2 ... ... ...
3 ... ... ...
4 ... ... ...
I would like to get:
regio years prod
1 1995 ...
1 1996 ...
..
2 1995 ...
..
3 1995 ...
..
4 1995 ...
..
The command I use is:
reshape long prod, i(regio) j(year)
It would appear a very easy task. Instead, the result I get is always
different (every time I launch the command) and never correct.
Stata drops many observations and many others become missing for some
variable (whereas my dataset has no missing value). I have also
checked that Stata considers data as numeric.
Thanks in advance,
Emanuele
*
* 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/


Emanuele,
Have you read in the data correctly? If the data isn't read in
correctly then it may not form a proper rectangle, which explains why
it doesn't reshape properly.
Ada
On Tue, Dec 9, 2008 at 1:41 PM, Martin Weiss < [hidden email]> wrote:
> Sounds like a http://www.stata.com/statalist/archive/200511/msg01084.html> problem... Where should the randomness come from in a command like
> reshape?
>
> HTH
> Martin
>
>
> Original Message
> From: [hidden email]
> [mailto: [hidden email]] On Behalf Of Emanuele
> Millemaci
> Sent: Tuesday, December 09, 2008 1:27 PM
> To: [hidden email]
> Subject: st: reshape problem
>
> Hi,
>
> I had a dataset on excel with regions on the rows and years on the columns.
> I moved this data to Stata 10.1 MP(updated to the latest packages) and
> was trying to reshaping from wide to long as I would like to have all
> years' data of the same variable on the same column.
>
> Below, I report an example of what I have:
>
> regio prod1995 prod1996 .....prod2006
>
> 1 .... ... ...
> 2 ... ... ...
> 3 ... ... ...
> 4 ... ... ...
>
> I would like to get:
>
> regio years prod
> 1 1995 ...
> 1 1996 ...
> ..
> 2 1995 ...
> ..
> 3 1995 ...
> ..
> 4 1995 ...
> ..
>
> The command I use is:
>
> reshape long prod, i(regio) j(year)
>
> It would appear a very easy task. Instead, the result I get is always
> different (every time I launch the command) and never correct.
> Stata drops many observations and many others become missing for some
> variable (whereas my dataset has no missing value). I have also
> checked that Stata considers data as numeric.
>
> Thanks in advance,
>
> Emanuele
> *
> * 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/>
> *
> * 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/>

Ada Ma
Research Fellow
Health Economics Research Unit
University of Aberdeen, UK.
http://www.abdn.ac.uk/heru/Tel: +44 (0) 1224 553863
Fax: +44 (0) 1224 550926
*
* 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/


Ada,
I tried two different ways to read in the data obtaining the same
disappointing results: 1)I used the command "insheet" 2) I copied
from excel and pasted into the data editor. Data look rectangular and
I cannot see missing values before typing the reshape command.
2008/12/9 Ada Ma < [hidden email]>:
> Emanuele,
>
> Have you read in the data correctly? If the data isn't read in
> correctly then it may not form a proper rectangle, which explains why
> it doesn't reshape properly.
>
> Ada
>
>
> On Tue, Dec 9, 2008 at 1:41 PM, Martin Weiss < [hidden email]> wrote:
>> Sounds like a http://www.stata.com/statalist/archive/200511/msg01084.html>> problem... Where should the randomness come from in a command like
>> reshape?
>>
>> HTH
>> Martin
>>
>>
>> Original Message
>> From: [hidden email]
>> [mailto: [hidden email]] On Behalf Of Emanuele
>> Millemaci
>> Sent: Tuesday, December 09, 2008 1:27 PM
>> To: [hidden email]
>> Subject: st: reshape problem
>>
>> Hi,
>>
>> I had a dataset on excel with regions on the rows and years on the columns.
>> I moved this data to Stata 10.1 MP(updated to the latest packages) and
>> was trying to reshaping from wide to long as I would like to have all
>> years' data of the same variable on the same column.
>>
>> Below, I report an example of what I have:
>>
>> regio prod1995 prod1996 .....prod2006
>>
>> 1 .... ... ...
>> 2 ... ... ...
>> 3 ... ... ...
>> 4 ... ... ...
>>
>> I would like to get:
>>
>> regio years prod
>> 1 1995 ...
>> 1 1996 ...
>> ..
>> 2 1995 ...
>> ..
>> 3 1995 ...
>> ..
>> 4 1995 ...
>> ..
>>
>> The command I use is:
>>
>> reshape long prod, i(regio) j(year)
>>
>> It would appear a very easy task. Instead, the result I get is always
>> different (every time I launch the command) and never correct.
>> Stata drops many observations and many others become missing for some
>> variable (whereas my dataset has no missing value). I have also
>> checked that Stata considers data as numeric.
>>
>> Thanks in advance,
>>
>> Emanuele
>> *
>> * 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/>>
>> *
>> * 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/>>
>
>
>
> 
> Ada Ma
> Research Fellow
> Health Economics Research Unit
> University of Aberdeen, UK.
> http://www.abdn.ac.uk/heru/> Tel: +44 (0) 1224 553863
> Fax: +44 (0) 1224 550926
> *
> * 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/>
*
* 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/


Emanuele, does isid regio return an error? The isid command will
verify if you have wide data.
Anders Alexandersson
[hidden email]
Emanuele Millemaci < [hidden email]> wrote:
> Ada,
>
> I tried two different ways to read in the data obtaining the same
> disappointing results: 1)I used the command "insheet" 2) I copied
> from excel and pasted into the data editor. Data look rectangular and
> I cannot see missing values before typing the reshape command.
>
>
> 2008/12/9 Ada Ma < [hidden email]>:
>> Emanuele,
>>
>> Have you read in the data correctly? If the data isn't read in
>> correctly then it may not form a proper rectangle, which explains why
>> it doesn't reshape properly.
>>
>> Ada
>>
>>
>> On Tue, Dec 9, 2008 at 1:41 PM, Martin Weiss < [hidden email]> wrote:
>>> Sounds like a http://www.stata.com/statalist/archive/200511/msg01084.html>>> problem... Where should the randomness come from in a command like
>>> reshape?
>>>
>>> HTH
>>> Martin
>>>
>>>
>>> Original Message
>>> From: [hidden email]
>>> [mailto: [hidden email]] On Behalf Of Emanuele
>>> Millemaci
>>> Sent: Tuesday, December 09, 2008 1:27 PM
>>> To: [hidden email]
>>> Subject: st: reshape problem
>>>
>>> Hi,
>>>
>>> I had a dataset on excel with regions on the rows and years on the columns.
>>> I moved this data to Stata 10.1 MP(updated to the latest packages) and
>>> was trying to reshaping from wide to long as I would like to have all
>>> years' data of the same variable on the same column.
>>>
>>> Below, I report an example of what I have:
>>>
>>> regio prod1995 prod1996 .....prod2006
>>>
>>> 1 .... ... ...
>>> 2 ... ... ...
>>> 3 ... ... ...
>>> 4 ... ... ...
>>>
>>> I would like to get:
>>>
>>> regio years prod
>>> 1 1995 ...
>>> 1 1996 ...
>>> ..
>>> 2 1995 ...
>>> ..
>>> 3 1995 ...
>>> ..
>>> 4 1995 ...
>>> ..
>>>
>>> The command I use is:
>>>
>>> reshape long prod, i(regio) j(year)
>>>
>>> It would appear a very easy task. Instead, the result I get is always
>>> different (every time I launch the command) and never correct.
>>> Stata drops many observations and many others become missing for some
>>> variable (whereas my dataset has no missing value). I have also
>>> checked that Stata considers data as numeric.
*
* 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/


Anders,
isid regio works correctly. No error message displayed.
Emanuele
2008/12/9 Anders Alexandersson < [hidden email]>:
> Emanuele, does isid regio return an error? The isid command will
> verify if you have wide data.
>
> Anders Alexandersson
> [hidden email]
>
> Emanuele Millemaci < [hidden email]> wrote:
>> Ada,
>>
>> I tried two different ways to read in the data obtaining the same
>> disappointing results: 1)I used the command "insheet" 2) I copied
>> from excel and pasted into the data editor. Data look rectangular and
>> I cannot see missing values before typing the reshape command.
>>
>>
>> 2008/12/9 Ada Ma < [hidden email]>:
>>> Emanuele,
>>>
>>> Have you read in the data correctly? If the data isn't read in
>>> correctly then it may not form a proper rectangle, which explains why
>>> it doesn't reshape properly.
>>>
>>> Ada
>>>
>>>
>>> On Tue, Dec 9, 2008 at 1:41 PM, Martin Weiss < [hidden email]> wrote:
>>>> Sounds like a http://www.stata.com/statalist/archive/200511/msg01084.html>>>> problem... Where should the randomness come from in a command like
>>>> reshape?
>>>>
>>>> HTH
>>>> Martin
>>>>
>>>>
>>>> Original Message
>>>> From: [hidden email]
>>>> [mailto: [hidden email]] On Behalf Of Emanuele
>>>> Millemaci
>>>> Sent: Tuesday, December 09, 2008 1:27 PM
>>>> To: [hidden email]
>>>> Subject: st: reshape problem
>>>>
>>>> Hi,
>>>>
>>>> I had a dataset on excel with regions on the rows and years on the columns.
>>>> I moved this data to Stata 10.1 MP(updated to the latest packages) and
>>>> was trying to reshaping from wide to long as I would like to have all
>>>> years' data of the same variable on the same column.
>>>>
>>>> Below, I report an example of what I have:
>>>>
>>>> regio prod1995 prod1996 .....prod2006
>>>>
>>>> 1 .... ... ...
>>>> 2 ... ... ...
>>>> 3 ... ... ...
>>>> 4 ... ... ...
>>>>
>>>> I would like to get:
>>>>
>>>> regio years prod
>>>> 1 1995 ...
>>>> 1 1996 ...
>>>> ..
>>>> 2 1995 ...
>>>> ..
>>>> 3 1995 ...
>>>> ..
>>>> 4 1995 ...
>>>> ..
>>>>
>>>> The command I use is:
>>>>
>>>> reshape long prod, i(regio) j(year)
>>>>
>>>> It would appear a very easy task. Instead, the result I get is always
>>>> different (every time I launch the command) and never correct.
>>>> Stata drops many observations and many others become missing for some
>>>> variable (whereas my dataset has no missing value). I have also
>>>> checked that Stata considers data as numeric.
> *
> * 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/>
*
* 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/


Despite various attempts your problem looks just as puzzling as when
first posted.
If there is some way for you to post your data file in an accessible
place, interested people will be able to look themselves.
Alternatively, I suggest you get in touch with StataCorp techsupport. I
guess they will want a copy of the file too.
Nick
[hidden email]
Emanuele Millemaci
>>>> I had a dataset on excel with regions on the rows and years on the
columns.
>>>> I moved this data to Stata 10.1 MP(updated to the latest packages)
and
>>>> was trying to reshaping from wide to long as I would like to have
all
>>>> years' data of the same variable on the same column.
>>>>
>>>> Below, I report an example of what I have:
>>>>
>>>> regio prod1995 prod1996 .....prod2006
>>>>
>>>> 1 .... ... ...
>>>> 2 ... ... ...
>>>> 3 ... ... ...
>>>> 4 ... ... ...
>>>>
>>>> I would like to get:
>>>>
>>>> regio years prod
>>>> 1 1995 ...
>>>> 1 1996 ...
>>>> ..
>>>> 2 1995 ...
>>>> ..
>>>> 3 1995 ...
>>>> ..
>>>> 4 1995 ...
>>>> ..
>>>>
>>>> The command I use is:
>>>>
>>>> reshape long prod, i(regio) j(year)
>>>>
>>>> It would appear a very easy task. Instead, the result I get is
always
>>>> different (every time I launch the command) and never correct.
>>>> Stata drops many observations and many others become missing for
some
>>>> variable (whereas my dataset has no missing value). I have also
>>>> checked that Stata considers data as numeric.
*
* 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/


As the file *.dta containing the dataset is small(few KB), I try to
send it attached to this message. Alternatively, such a file can be
downloaded at this link:
http://www.2shared.com/file/4425484/c1951cbd/produc.html(perhaps, need to wait few seconds before displaying the working link
at the bottom of the page)
The command I use is
reshape long x, i(regio) j(year)
Thanks
Emanuele
2008/12/9 Nick Cox < [hidden email]>:
> Despite various attempts your problem looks just as puzzling as when
> first posted.
>
> If there is some way for you to post your data file in an accessible
> place, interested people will be able to look themselves.
>
> Alternatively, I suggest you get in touch with StataCorp techsupport. I
> guess they will want a copy of the file too.
>
> Nick
> [hidden email]
>
> Emanuele Millemaci
>
>>>>> I had a dataset on excel with regions on the rows and years on the
> columns.
>>>>> I moved this data to Stata 10.1 MP(updated to the latest packages)
> and
>>>>> was trying to reshaping from wide to long as I would like to have
> all
>>>>> years' data of the same variable on the same column.
>>>>>
>>>>> Below, I report an example of what I have:
>>>>>
>>>>> regio prod1995 prod1996 .....prod2006
>>>>>
>>>>> 1 .... ... ...
>>>>> 2 ... ... ...
>>>>> 3 ... ... ...
>>>>> 4 ... ... ...
>>>>>
>>>>> I would like to get:
>>>>>
>>>>> regio years prod
>>>>> 1 1995 ...
>>>>> 1 1996 ...
>>>>> ..
>>>>> 2 1995 ...
>>>>> ..
>>>>> 3 1995 ...
>>>>> ..
>>>>> 4 1995 ...
>>>>> ..
>>>>>
>>>>> The command I use is:
>>>>>
>>>>> reshape long prod, i(regio) j(year)
>>>>>
>>>>> It would appear a very easy task. Instead, the result I get is
> always
>>>>> different (every time I launch the command) and never correct.
>>>>> Stata drops many observations and many others become missing for
> some
>>>>> variable (whereas my dataset has no missing value). I have also
>>>>> checked that Stata considers data as numeric.
>
> *
> * 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/>
*
* 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/


As the file *.dta containing the dataset is small(few KB), I try to
send it attached to this message. Alternatively, such a file can be
downloaded at this link:
http://www.2shared.com/file/4425484/c1951cbd/produc.html(perhaps, need to wait few seconds before displaying the working link
at the bottom of the page)
The command I use is
reshape long x, i(regio) j(year)
Thanks
Emanuele
2008/12/9 Nick Cox < [hidden email]>:
> Despite various attempts your problem looks just as puzzling as when
> first posted.
>
> If there is some way for you to post your data file in an accessible
> place, interested people will be able to look themselves.
>
> Alternatively, I suggest you get in touch with StataCorp techsupport. I
> guess they will want a copy of the file too.
>
> Nick
> [hidden email]
>
> Emanuele Millemaci
>
>>>>> I had a dataset on excel with regions on the rows and years on the
> columns.
>>>>> I moved this data to Stata 10.1 MP(updated to the latest packages)
> and
>>>>> was trying to reshaping from wide to long as I would like to have
> all
>>>>> years' data of the same variable on the same column.
>>>>>
>>>>> Below, I report an example of what I have:
>>>>>
>>>>> regio prod1995 prod1996 .....prod2006
>>>>>
>>>>> 1 .... ... ...
>>>>> 2 ... ... ...
>>>>> 3 ... ... ...
>>>>> 4 ... ... ...
>>>>>
>>>>> I would like to get:
>>>>>
>>>>> regio years prod
>>>>> 1 1995 ...
>>>>> 1 1996 ...
>>>>> ..
>>>>> 2 1995 ...
>>>>> ..
>>>>> 3 1995 ...
>>>>> ..
>>>>> 4 1995 ...
>>>>> ..
>>>>>
>>>>> The command I use is:
>>>>>
>>>>> reshape long prod, i(regio) j(year)
>>>>>
>>>>> It would appear a very easy task. Instead, the result I get is
> always
>>>>> different (every time I launch the command) and never correct.
>>>>> Stata drops many observations and many others become missing for
> some
>>>>> variable (whereas my dataset has no missing value). I have also
>>>>> checked that Stata considers data as numeric.
>
> *
> * 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/>


Hi there,
Could somebody let me know if I can use mim to combine the bootstrap results using the imputed data? When I was running the following codes,
mim, noi: bootstrap: regress science ses female math
It gives me an error message of "prefix bootstrap not allowed after mim".
Thanks.
Haiyong
IMPORTANT WARNING: This email (and any attachments) is only intended for the use of the person or entity to which it is addressed, and may contain information that is privileged and confidential. You, the recipient, are obligated to maintain it in a safe, secure and confidential manner. Unauthorized redisclosure or failure to maintain confidentiality may subject you to federal and state penalties. If you are not the intended recipient, please immediately notify us by return email, and delete this message from your computer.
*
* 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/


I had no problems reshapeing your data:
. reshape long x, i(regio) j(year)
(note: j = 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974
1975 1976 1977 1978 1979 1980 1981 1982 1983 1984
> 1985 1986 1987 1989 1990 1991 1992 1993 1994 1995 1996 1997 1999
2000 2001 2002 2003 2004 2005 2006)
Data wide > long

Number of obs. 21 > 882
Number of variables 43 > 3
j variable (42 values) > year
xij variables:
x1963 x1964 ... x2006 > x

. su
Variable  Obs Mean Std. Dev. Min Max
+
regio  882 11 6.058736 1 21
annee  882 1984.095 12.81874 1963 2006
x  882 31.23255 9.333917 9.844 50.513
You could try to reinstall Stata (?)
Antoine
Emanuele Millemaci wrote:
> As the file *.dta containing the dataset is small(few KB), I try to
> send it attached to this message. Alternatively, such a file can be
> downloaded at this link:
>
> http://www.2shared.com/file/4425484/c1951cbd/produc.html> (perhaps, need to wait few seconds before displaying the working link
> at the bottom of the page)
>
> The command I use is
> reshape long x, i(regio) j(year)
>
> Thanks
> Emanuele
>
> 2008/12/9 Nick Cox < [hidden email]>:
>> Despite various attempts your problem looks just as puzzling as when
>> first posted.
>>
>> If there is some way for you to post your data file in an accessible
>> place, interested people will be able to look themselves.
>>
>> Alternatively, I suggest you get in touch with StataCorp techsupport. I
>> guess they will want a copy of the file too.
>>
>> Nick
>> [hidden email]
>>
>> Emanuele Millemaci
>>
>>>>>> I had a dataset on excel with regions on the rows and years on the
>> columns.
>>>>>> I moved this data to Stata 10.1 MP(updated to the latest packages)
>> and
>>>>>> was trying to reshaping from wide to long as I would like to have
>> all
>>>>>> years' data of the same variable on the same column.
>>>>>>
>>>>>> Below, I report an example of what I have:
>>>>>>
>>>>>> regio prod1995 prod1996 .....prod2006
>>>>>>
>>>>>> 1 .... ... ...
>>>>>> 2 ... ... ...
>>>>>> 3 ... ... ...
>>>>>> 4 ... ... ...
>>>>>>
>>>>>> I would like to get:
>>>>>>
>>>>>> regio years prod
>>>>>> 1 1995 ...
>>>>>> 1 1996 ...
>>>>>> ..
>>>>>> 2 1995 ...
>>>>>> ..
>>>>>> 3 1995 ...
>>>>>> ..
>>>>>> 4 1995 ...
>>>>>> ..
>>>>>>
>>>>>> The command I use is:
>>>>>>
>>>>>> reshape long prod, i(regio) j(year)
>>>>>>
>>>>>> It would appear a very easy task. Instead, the result I get is
>> always
>>>>>> different (every time I launch the command) and never correct.
>>>>>> Stata drops many observations and many others become missing for
>> some
>>>>>> variable (whereas my dataset has no missing value). I have also
>>>>>> checked that Stata considers data as numeric.
>> *
>> * 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/>>
> *
> * 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/>
*
* 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/


Although you are asked _not_ to send attachments  as I should perhaps
have reminded you in my previous post  this one got through to me and
I found that your data reshape fine:
. ds
x1963 x1967 x1971 x1975 x1979 x1983 x1987 x1992 x1996 x2001
x2005
x1964 x1968 x1972 x1976 x1980 x1984 x1989 x1993 x1997 x2002
x2006
x1965 x1969 x1973 x1977 x1981 x1985 x1990 x1994 x1999 x2003
regio
x1966 x1970 x1974 x1978 x1982 x1986 x1991 x1995 x2000 x2004
. isid regio
. reshape long x, i(regio) j(year)
(note: j = 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974
1975 1976 1977 1978 1979 1
> 980 1981 1982 1983 1984 1985 1986 1987 1989 1990 1991 1992 1993 1994
1995 1996 1997 1999 2000
> 2001 2002 2003 2004 2005 2006)
Data wide > long


Number of obs. 21 > 882
Number of variables 43 > 3
j variable (42 values) > year
xij variables:
x1963 x1964 ... x2006 > x


. su
Variable  Obs Mean Std. Dev. Min Max
+
regio  882 11 6.058736 1 21
year  882 1984.095 12.81874 1963 2006
x  882 31.23255 9.333917 9.844 50.513
The problem if there is one would seem to lie in your Stata, but I can't
say what it is.
Nick
[hidden email]
Emanuele Millemaci
As the file *.dta containing the dataset is small(few KB), I try to
send it attached to this message. Alternatively, such a file can be
downloaded at this link:
http://www.2shared.com/file/4425484/c1951cbd/produc.html(perhaps, need to wait few seconds before displaying the working link
at the bottom of the page)
The command I use is
reshape long x, i(regio) j(year)
2008/12/9 Nick Cox < [hidden email]>:
> Despite various attempts your problem looks just as puzzling as when
> first posted.
>
> If there is some way for you to post your data file in an accessible
> place, interested people will be able to look themselves.
>
> Alternatively, I suggest you get in touch with StataCorp techsupport.
I
> guess they will want a copy of the file too.
>
> Nick
> [hidden email]
>
> Emanuele Millemaci
>
>>>>> I had a dataset on excel with regions on the rows and years on the
> columns.
>>>>> I moved this data to Stata 10.1 MP(updated to the latest packages)
> and
>>>>> was trying to reshaping from wide to long as I would like to have
> all
>>>>> years' data of the same variable on the same column.
>>>>>
>>>>> Below, I report an example of what I have:
>>>>>
>>>>> regio prod1995 prod1996 .....prod2006
>>>>>
>>>>> 1 .... ... ...
>>>>> 2 ... ... ...
>>>>> 3 ... ... ...
>>>>> 4 ... ... ...
>>>>>
>>>>> I would like to get:
>>>>>
>>>>> regio years prod
>>>>> 1 1995 ...
>>>>> 1 1996 ...
>>>>> ..
>>>>> 2 1995 ...
>>>>> ..
>>>>> 3 1995 ...
>>>>> ..
>>>>> 4 1995 ...
>>>>> ..
>>>>>
>>>>> The command I use is:
>>>>>
>>>>> reshape long prod, i(regio) j(year)
>>>>>
>>>>> It would appear a very easy task. Instead, the result I get is
> always
>>>>> different (every time I launch the command) and never correct.
>>>>> Stata drops many observations and many others become missing for
> some
>>>>> variable (whereas my dataset has no missing value). I have also
>>>>> checked that Stata considers data as numeric.
*
* 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/


I work as a statistical consultant in a computer lab, and I ran into a
patron who had this problem on his computer. (Reshaping data,
specifically.) After much headscratching, we figured out that it was
his version of Stata that was causing the problem, as when it was done
on the lab machines it worked fine. Later, he admitted to me that the
version of Stata 10 that he had been using was pirated. In general, I
would be careful if you are not using a fully licensed version of Stata
10, because I have seen this problem before, and Stata is very
reasonably priced for researchers and students, anyway. The reshaping
worked fine on Stata 10 on the computer lab machines. I'm not sure what
version it was exactly that he was using.
Nick Cox wrote:
> Although you are asked _not_ to send attachments  as I should perhaps
> have reminded you in my previous post  this one got through to me and
> I found that your data reshape fine:
>
> . ds
> x1963 x1967 x1971 x1975 x1979 x1983 x1987 x1992 x1996 x2001
> x2005
> x1964 x1968 x1972 x1976 x1980 x1984 x1989 x1993 x1997 x2002
> x2006
> x1965 x1969 x1973 x1977 x1981 x1985 x1990 x1994 x1999 x2003
> regio
> x1966 x1970 x1974 x1978 x1982 x1986 x1991 x1995 x2000 x2004
>
> . isid regio
>
> . reshape long x, i(regio) j(year)
> (note: j = 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974
> 1975 1976 1977 1978 1979 1
>
>> 980 1981 1982 1983 1984 1985 1986 1987 1989 1990 1991 1992 1993 1994
>>
> 1995 1996 1997 1999 2000
>
>> 2001 2002 2003 2004 2005 2006)
>>
>
> Data wide > long
> 
> 
> Number of obs. 21 > 882
> Number of variables 43 > 3
> j variable (42 values) > year
> xij variables:
> x1963 x1964 ... x2006 > x
> 
> 
>
> . su
>
> Variable  Obs Mean Std. Dev. Min Max
> +
> regio  882 11 6.058736 1 21
> year  882 1984.095 12.81874 1963 2006
> x  882 31.23255 9.333917 9.844 50.513
>
> The problem if there is one would seem to lie in your Stata, but I can't
> say what it is.
>
> Nick
> [hidden email]
>
> Emanuele Millemaci
>
> As the file *.dta containing the dataset is small(few KB), I try to
> send it attached to this message. Alternatively, such a file can be
> downloaded at this link:
>
> http://www.2shared.com/file/4425484/c1951cbd/produc.html> (perhaps, need to wait few seconds before displaying the working link
> at the bottom of the page)
>
> The command I use is
> reshape long x, i(regio) j(year)
>
> 2008/12/9 Nick Cox < [hidden email]>:
>
>
>> Despite various attempts your problem looks just as puzzling as when
>> first posted.
>>
>> If there is some way for you to post your data file in an accessible
>> place, interested people will be able to look themselves.
>>
>> Alternatively, I suggest you get in touch with StataCorp techsupport.
>>
> I
>
>> guess they will want a copy of the file too.
>>
>> Nick
>> [hidden email]
>>
>> Emanuele Millemaci
>>
>>
>>>>>> I had a dataset on excel with regions on the rows and years on the
>>>>>>
>> columns.
>>
>>>>>> I moved this data to Stata 10.1 MP(updated to the latest packages)
>>>>>>
>> and
>>
>>>>>> was trying to reshaping from wide to long as I would like to have
>>>>>>
>> all
>>
>>>>>> years' data of the same variable on the same column.
>>>>>>
>>>>>> Below, I report an example of what I have:
>>>>>>
>>>>>> regio prod1995 prod1996 .....prod2006
>>>>>>
>>>>>> 1 .... ... ...
>>>>>> 2 ... ... ...
>>>>>> 3 ... ... ...
>>>>>> 4 ... ... ...
>>>>>>
>>>>>> I would like to get:
>>>>>>
>>>>>> regio years prod
>>>>>> 1 1995 ...
>>>>>> 1 1996 ...
>>>>>> ..
>>>>>> 2 1995 ...
>>>>>> ..
>>>>>> 3 1995 ...
>>>>>> ..
>>>>>> 4 1995 ...
>>>>>> ..
>>>>>>
>>>>>> The command I use is:
>>>>>>
>>>>>> reshape long prod, i(regio) j(year)
>>>>>>
>>>>>> It would appear a very easy task. Instead, the result I get is
>>>>>>
>> always
>>
>>>>>> different (every time I launch the command) and never correct.
>>>>>> Stata drops many observations and many others become missing for
>>>>>>
>> some
>>
>>>>>> variable (whereas my dataset has no missing value). I have also
>>>>>> checked that Stata considers data as numeric.
>>>>>>
>
> *
> * 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/>

Kyle Hood
Department of Economics
Yale University
New Haven, CT
website: http://www.econ.yale.edu/~kkh25*
* 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/


At 03:21 PM 12/9/2008, Nick Cox wrote:
>It means what it says. This is asking (a) too much (b) the wrong thing.
>You should impute first, then bootstrap. All caveats one can think of,
>and more, no doubt apply.
Sometimes changing the order of prefix commands will help. As far as
I can tell from the mim help file, though, mim and bootstrap do
not work together.
One might try adding the vce(bootstrap) option to regress and see if
that works. I'm not optimistic, but it is worth a try. See help vce_option.

Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)6316668, (574)6316463
HOME: (574)2895227
EMAIL: [hidden email]
WWW: http://www.nd.edu/~rwilliam*
* 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/


At 03:28 PM 12/9/2008, Kyle Hood wrote:
>I work as a statistical consultant in a computer lab, and I ran into a
>patron who had this problem on his computer. (Reshaping data,
>specifically.) After much headscratching, we figured out that it was
>his version of Stata that was causing the problem, as when it was done
>on the lab machines it worked fine. Later, he admitted to me that the
>version of Stata 10 that he had been using was pirated. In general, I
>would be careful if you are not using a fully licensed version of Stata
>10, because I have seen this problem before, and Stata is very
>reasonably priced for researchers and students, anyway. The reshaping
>worked fine on Stata 10 on the computer lab machines. I'm not sure what
>version it was exactly that he was using.
Interesting. Does Stata deliberately sabotage pirated copies
somehow? Or perhaps pirated copies can't be updated and this is a
bug that got fixed after the initial release?

Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)6316668, (574)6316463
HOME: (574)2895227
EMAIL: [hidden email]
WWW: http://www.nd.edu/~rwilliam*
* 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/


That was my initial reply...
HTH
Martin
_______________________
 Original Message 
From: "Kyle Hood" < [hidden email]>
To: < [hidden email]>
Sent: Tuesday, December 09, 2008 9:28 PM
Subject: Re: st: RE: reshape problem
>I work as a statistical consultant in a computer lab, and I ran into a
> patron who had this problem on his computer. (Reshaping data,
> specifically.) After much headscratching, we figured out that it was
> his version of Stata that was causing the problem, as when it was done
> on the lab machines it worked fine. Later, he admitted to me that the
> version of Stata 10 that he had been using was pirated. In general, I
> would be careful if you are not using a fully licensed version of Stata
> 10, because I have seen this problem before, and Stata is very
> reasonably priced for researchers and students, anyway. The reshaping
> worked fine on Stata 10 on the computer lab machines. I'm not sure what
> version it was exactly that he was using.
>
> Nick Cox wrote:
>> Although you are asked _not_ to send attachments  as I should perhaps
>> have reminded you in my previous post  this one got through to me and
>> I found that your data reshape fine:
>>
>> . ds
>> x1963 x1967 x1971 x1975 x1979 x1983 x1987 x1992 x1996 x2001
>> x2005
>> x1964 x1968 x1972 x1976 x1980 x1984 x1989 x1993 x1997 x2002
>> x2006
>> x1965 x1969 x1973 x1977 x1981 x1985 x1990 x1994 x1999 x2003
>> regio
>> x1966 x1970 x1974 x1978 x1982 x1986 x1991 x1995 x2000 x2004
>>
>> . isid regio
>>
>> . reshape long x, i(regio) j(year)
>> (note: j = 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974
>> 1975 1976 1977 1978 1979 1
>>
>>> 980 1981 1982 1983 1984 1985 1986 1987 1989 1990 1991 1992 1993 1994
>>>
>> 1995 1996 1997 1999 2000
>>
>>> 2001 2002 2003 2004 2005 2006)
>>>
>>
>> Data wide > long
>> 
>> 
>> Number of obs. 21 > 882
>> Number of variables 43 > 3
>> j variable (42 values) > year
>> xij variables:
>> x1963 x1964 ... x2006 > x
>> 
>> 
>>
>> . su
>>
>> Variable  Obs Mean Std. Dev. Min Max
>> +
>> regio  882 11 6.058736 1 21
>> year  882 1984.095 12.81874 1963 2006
>> x  882 31.23255 9.333917 9.844 50.513
>>
>> The problem if there is one would seem to lie in your Stata, but I can't
>> say what it is.
>>
>> Nick
>> [hidden email]
>>
>> Emanuele Millemaci
>>
>> As the file *.dta containing the dataset is small(few KB), I try to
>> send it attached to this message. Alternatively, such a file can be
>> downloaded at this link:
>>
>> http://www.2shared.com/file/4425484/c1951cbd/produc.html>> (perhaps, need to wait few seconds before displaying the working link
>> at the bottom of the page)
>>
>> The command I use is
>> reshape long x, i(regio) j(year)
>>
>> 2008/12/9 Nick Cox < [hidden email]>:
>>
>>
>>> Despite various attempts your problem looks just as puzzling as when
>>> first posted.
>>>
>>> If there is some way for you to post your data file in an accessible
>>> place, interested people will be able to look themselves.
>>>
>>> Alternatively, I suggest you get in touch with StataCorp techsupport.
>>>
>> I
>>
>>> guess they will want a copy of the file too.
>>>
>>> Nick
>>> [hidden email]
>>>
>>> Emanuele Millemaci
>>>
>>>
>>>>>>> I had a dataset on excel with regions on the rows and years on the
>>>>>>>
>>> columns.
>>>
>>>>>>> I moved this data to Stata 10.1 MP(updated to the latest packages)
>>>>>>>
>>> and
>>>
>>>>>>> was trying to reshaping from wide to long as I would like to have
>>>>>>>
>>> all
>>>
>>>>>>> years' data of the same variable on the same column.
>>>>>>>
>>>>>>> Below, I report an example of what I have:
>>>>>>>
>>>>>>> regio prod1995 prod1996 .....prod2006
>>>>>>>
>>>>>>> 1 .... ... ...
>>>>>>> 2 ... ... ...
>>>>>>> 3 ... ... ...
>>>>>>> 4 ... ... ...
>>>>>>>
>>>>>>> I would like to get:
>>>>>>>
>>>>>>> regio years prod
>>>>>>> 1 1995 ...
>>>>>>> 1 1996 ...
>>>>>>> ..
>>>>>>> 2 1995 ...
>>>>>>> ..
>>>>>>> 3 1995 ...
>>>>>>> ..
>>>>>>> 4 1995 ...
>>>>>>> ..
>>>>>>>
>>>>>>> The command I use is:
>>>>>>>
>>>>>>> reshape long prod, i(regio) j(year)
>>>>>>>
>>>>>>> It would appear a very easy task. Instead, the result I get is
>>>>>>>
>>> always
>>>
>>>>>>> different (every time I launch the command) and never correct.
>>>>>>> Stata drops many observations and many others become missing for
>>>>>>>
>>> some
>>>
>>>>>>> variable (whereas my dataset has no missing value). I have also
>>>>>>> checked that Stata considers data as numeric.
>>>>>>>
>>
>> *
>> * 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/>>
>
>
> 
> Kyle Hood
> Department of Economics
> Yale University
> New Haven, CT
> website: http://www.econ.yale.edu/~kkh25>
> *
> * 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/>
*
* 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/


Come on, folks, seriously!
Let's agree that the subject of pirating is taboo for the following
reasons:
1. Ladies and gentlemen (and moral cyborgs) on the list should not ask
each other whether their copies of Stata are pirated.
2. Nor do or should they ask StataCorp employees (who also are ladies,
or gentlemen, or moral cyborgs) to discuss how StataCorp combats
pirating.
You won't get an answer in any case.
On Richard's last question, however, there is one comment from me: the
dataset in question looked in complete good order and my guess is that
it would never have tickled any reshape bug.
Nick
[hidden email]
Richard Williams
At 03:28 PM 12/9/2008, Kyle Hood wrote:
>I work as a statistical consultant in a computer lab, and I ran into a
>patron who had this problem on his computer. (Reshaping data,
>specifically.) After much headscratching, we figured out that it was
>his version of Stata that was causing the problem, as when it was done
>on the lab machines it worked fine. Later, he admitted to me that the
>version of Stata 10 that he had been using was pirated. In general, I
>would be careful if you are not using a fully licensed version of Stata
>10, because I have seen this problem before, and Stata is very
>reasonably priced for researchers and students, anyway. The reshaping
>worked fine on Stata 10 on the computer lab machines. I'm not sure
what
>version it was exactly that he was using.
Interesting. Does Stata deliberately sabotage pirated copies
somehow? Or perhaps pirated copies can't be updated and this is a
bug that got fixed after the initial release?
*
* 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/

12
