Statalist The Stata Listserver


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

Re: st: wide to long


From   David Kantor <kantor.d@att.net>
To   statalist@hsphsun2.harvard.edu
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
firmid
totistam1985
totistam1986
totistam1987
(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.
--David

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
r(498);

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.
Best,
alice

[...]
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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   |   What's new   |   Site index