Statalist


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

Re: st: RE: reshape question


From   moleps islon <[email protected]>
To   [email protected]
Subject   Re: st: RE: reshape question
Date   Tue, 22 Dec 2009 22:35:18 +0100

Apparently contract seems to give me what I want....

M



On Tue, Dec 22, 2009 at 10:09 PM, Martin Weiss <[email protected]> wrote:
>
> <>
>
> 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"?
>
> HTH
> Martin
>
>
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of moleps islon
> Sent: Dienstag, 22. Dezember 2009 21:51
> To: [email protected]
> 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?
>
>
> M
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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