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

st: recoding variables


From   [email protected]
To   [email protected]
Subject   st: recoding variables
Date   Wed, 8 Oct 2003 09:37:18 -0700

All,

I have a database of scores of subjects who were given the same memory test
on an annual basis.  The data look  something like:

SUBJECT   YEAR 1 SCORE   YEAR 2 SCORE    YEAR 3 SCORE.....

Tom            15             16              14
Dick           12             13              10
Harry               15             14              15
.
.
.


I would like to determine if the subjects scores tend to increase or
decrease with time.  I was thinking of using linear regression, with YEAR
as the x variable and SCORE as the y variable.

In order to do that, I think that I have to recode the data thusly:

SUBJECT   YEAR      SCORE
Tom       1         15
Tom       2         16
Tom       3         14
Dick      1         12
Dick      2         13
Dick      3         10
Harry          1         15
Harry          2         14
Harry          3         15

Does anyone know of a way to do this in Stata?

Thanks,
Jim Seward

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