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: multiple repeated measures
From
Nick Cox <[email protected]>
To
"'[email protected]'" <[email protected]>
Subject
st: RE: multiple repeated measures
Date
Thu, 10 Mar 2011 15:25:07 +0000
Without commenting on whether this is a good way to do it, an answer to your Q1 is
gen twoweek = cond(mod(week,2) == 1, week, week-1)
egen max_myvar = max(myvar), by(id twoweek)
The first statement is likely to be seem more cryptic. It keeps odd values as they are are and bumps down even values. So (1,2) -> 1; (3, 4) -> 3; etc.
(mod(week, 2) == 1) is equivalent to mod(week, 2).
Depending on how many subjects you have, just plotting the data sounds a good idea. Missing values won't show, which is right.
Nick
[email protected]
laura hendrix
I have a 14-item survey that was administered weekly to a group of
subjects for 8 weeks with responses to each question ranging from 1-5
with some subjects having missing weeks and/or missing responses:
Week1 Week2
------------------------------------------------------------------
Question Question
------------------------------------------------------------------
ID 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
----------------------------------------------------------------------------
1 1 3 . 2 2 1 5 . 2 4 2 2 . 3 4 5
2 4 4 4 3 3 . 1 1 2 3 2 2 4 5 1 1
and so on.
I would like to determine whether there has been a significant change
in score for each question between weeks 1 and 8. Without going into
a complex longitudinal analysis which I have no idea how to do, how
can I
1. Group questions into 1-2 3-4 5-6 7-8 and generate a new
variable containing the highest value in each group (counting
missing=0)
2. determine whether there has been a significant change in score for
each item between weeks 1 and 8
??
*
* 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/