Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: RE: convert 5 rows to one observation
From
"Nick Cox" <[email protected]>
To
<[email protected]>
Subject
st: RE: convert 5 rows to one observation
Date
Tue, 15 Jun 2010 21:41:09 +0100
egen col = seq(), to(5)
egen row = seq(), block(5)
reshape wide varname, i(row) j(col)
where varname is your variable name.
Also check out -destring-.
Nick
[email protected]
Paul O'Brien
i have data on patients i one variable with 5 rows for each patient and
want to convert to one observation per patient.
a
b
c
d
e
1
2
3
4
5
s
t
u
v
w
6
7
8
9
10
to
a1s6
b2t7
etc
*
* 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/