Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

st: carrying observations forward if criteria met

From   laura hendrix <>
Subject   st: carrying observations forward if criteria met
Date   Thu, 2 Feb 2012 15:41:01 -0500

I have a set of time-series data where patients complete a weekly
survey with items describing the severity of 14 symptoms (scoring
1-lowest to 5-highest) for 8 weeks with.  It is in wide format, ie

idno   S1_week1   S2_week1  S3_week1....S1_week2  S2_week2  S3_week3....etc

1            3                 2              1    ........     1
          2               3
2            1                 1              2   .........     1
         3               4

a score of >=3 is considered clinically relevant.  I would like to be
able to read across the weeks for each symptom, and as soon as a score
of 3 or higher is encountered in the 8 week period, the rest of the
values for the period are replaced with this value.  for example, if a
patient has a score of 3 in week 2, then the scores for that symptom
will be replaced with 3 for weeks 3,4,5,6,7, and 8.  If there is a
higher score in later weeks, it will be overwritten by the first
clinically relevant score.

This is similar to the "carryforward" ado file but I believe that only
replaces missing values?

Thanks in advance,
Laura Hendrix
UNC-Chapel Hill
*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index