Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Another reshaping problem


From   Sascha Robert <[email protected]>
To   STATA List <[email protected]>
Subject   st: Another reshaping problem
Date   Fri, 15 Apr 2005 10:54:46 +0200

Hi

...and sorry to hassle you again with a ridiculous problem. A teacher once told me: 'There are no dumb questions!', though. Well, there are, as the protagonists of 'Simple Life' have evidenced, and nontheless I try it:

My data in short:

group var strategy
1 11 0
1 12 1
1 13 0
1 14 1
2 15 0
2 16 1

If the first two rows would be omited,

. reshape wide var, i(group) j(strategy)

would do the trick. The problem is, using all observations, that multiple observations within 'group' share the same 'strategy'.

My data, after the reshaping, should look like this:

group var0 var1
1 11 12
1 13 14
2 15 16

Note that my data is in a form that would not produce missing values in 'var0' and 'var1' (within a 'group' there is always an equal share of 'strategy' = 0 and 'strategy' = 1).

Can anybody help? Thankyou.
Sascha

--
***** sascha robert | mailto: [email protected] *****
*
* 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