Statalist


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

st: STATA 10 bug? variables disappearing with reshape wide


From   "Burak Darbaz" <[email protected]>
To   <[email protected]>
Subject   st: STATA 10 bug? variables disappearing with reshape wide
Date   Fri, 13 Jun 2008 19:02:00 +0100

Hello, i just started using STATA 10 in Vista

I was trying a couple of exercises from Christopher F. Baum's book: "An Introduction to Modern Econometrics Using Stata" by referring to his do files.

here is the dataset:

Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
year | 77 1990 3.183014 1985 1995
packpc | 77 87.16241 21.63518 49.2722 141.9558
avgprs | 77 161.4092 36.29128 97.03333 239.1093
stateid | 77 24.42857 16.77281 3 45
incpc | 77 18.05913 3.505946 11.64714 25.80803

and its description:

obs: 77
vars: 5 9 Jun 2006 14:07
size: 2,156 (99.9% of memory free)
----------------------------------------------------------------------------------------------------------------------------
storage display value
variable name type format label variable label
--------------------------------------------------------------------------------------------------------------------------
year float %9.0g
packpc float %9.0g packs per capita = packs/pop
avgprs float %9.0g average price during fiscal year, including sales taxes
stateid long %8.0g stateid
incpc float %9.0g
--------------------------------------------------------------------------------------------------------------------------

When i type in the command as he does in the do file once in a hundred time it worked, and gave me the following result, so i saved instantenously:

. reshape wide packpc avgprs incpc, i(stateid) j(year)

(note: j = 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995)

Data long -> wide
-----------------------------------------------------------------------------
Number of obs. 77 -> 7
Number of variables 5 -> 23
j variable (11 values) year -> (dropped)
xij variables:
packpc -> packpc1985 packpc1986 ... packpc1995
avgprs -> avgprs1985 avgprs1986 ... avgprs1995
incpc -> incpc1985 incpc1986 ... incpc1995
-----------------------------------------------------------------------------

But under normal circumstances;

. reshape wide packpc avgprs incpc, i(stateid) j(year)

(note: j = 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995)
variable stateid not found


this is the message i get.

I observed that normally, when i get the error message, the data name that i am working is displayed next to STATA 10.00 such as: STATA 10.00 - C: blablablablab\cigconsumpw.dta

but at the one time it worked the display was such that: - STATA 10.00 - C: blablablablab\temp\blalal.tmp

Now, can anybody help me to make this work non-stochastically?

Thanks

*
* 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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index