Statalist The Stata Listserver

[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: wide to long

From   David Kantor <>
Subject   Re: st: wide to long
Date   Thu, 19 Oct 2006 12:34:26 -0400

Hi Alice,

I'm not totally sure of where the message is coming from, but I would ask, what variables are present when you do the -reshape long- ?

If I am not confused, year (in your example) should not exist prior to the reshape. It is created by -reshape long-. I don't see how you would have a year variable in the wide form (as your message suggests); what would it signify?

The variables you should have prior to -reshape wide- ought to be
(etc. -- other totisam variables)

And that's all (at least, in your example, doing just one measure at a time).

By the way, any other variables not mentioned in the -reshape- command, but which exist in your data, must be (I believe) functionally dependent on firmid. But in your case, there really ought not to be any other variables.

I hope this helps.

At 10:56 AM 10/19/2006, you wrote:

Hi David, thanks for the response. I transfered each individual variable
file to State using Stat transfer. I renamed the variable using a prefix.
However, when I try:

reshape long totistam, i(firmid) j(year)

I get the following message:

year contains all missing values

Could anybody please tell me what's going on? I also tried - mvencode - to
replace missing values with 0 but that did not help either.

*   For searches and help try:

© Copyright 1996–2022 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index