Statalist


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

st: reshaping data


From   Tina Hernandez-Boussard <[email protected]>
To   [email protected]
Subject   st: reshaping data
Date   Thu, 15 Oct 2009 16:43:34 -0700

Hi All,,

I am trying to reshape some data from long to wide form

I have an id, temperature and a timepoint. However, id and timepoint are not unique, so I have ~1000 temperature readings for every time point for every id.

The data's current format
   id   month      temp
   -----------------------
 1     0        50
 1     0        55
 1     0        60
 1     3        20
 1     3        22
 1     3        33

How I want the data

   id       temp0		temp3	temp6
   -----------------------
 1     		50		20		12
 1     		55		22		12
 1              60 		.		11
 1     		55		20		12
 1     		.		33		12
 3		52		20		15


Any help with the command? When I use reshape wide temp, i(name ) j (op_time ) i get the error

op_time not unique within name;


Thanks,

Tina




*
*   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