[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: reshape question

From   "Martin Weiss" <>
To   <>
Subject   st: RE: reshape question
Date   Tue, 22 Dec 2009 22:00:13 +0100


Have you had a look at the top of -help reshape-? No words can adequately
explain what the drawing makes clear. The j variable must be unique in the
initial dataset: How else would Stata create fill the new variables "stub"?


-----Original Message-----
[] On Behalf Of moleps islon
Sent: Dienstag, 22. Dezember 2009 21:51
Subject: st: reshape question

Dear listers,
My dataset originally contained 8000 observations on two different
variables (location) sampled with 6-sec intervals in a long format. I
then created averages for the two variables (avg_a & avg_b) for each
minute(time2), using egen cut to split the time-variable and egen mean
to create the avg variables. I now would like to subtract the two
variables from each other for each time-window. I believe I have to
create a wide dataset to do this, but I get an error stating

.reshape wide avg_a avg_b,i(time2) j(location)

location not unique within time2;
there are multiple observations at the same c7 within time2.
Type "reshape error" for a listing of the problem observations.

Any idea how I can go about this?

*   For searches and help try:

*   For searches and help try:

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