Re: SPSS Syntax MIXED Model

Posted by Ryan on
URL: http://spssx-discussion.165.s1.nabble.com/SPSS-Syntax-MIXED-Model-tp5713934p5713991.html

Zalihe,
 
My thoughts are interspersed below.
 
> On Tue, Jul 3, 2012 at 4:36 AM, Zalihe <[hidden email]> wrote:
> Thank you for your reply Ryan,
>
> I will explain you the research question in more detail for help. I have got
> a General Practice (GP) data set where each patient has repeated
> measurements on a blood test. Measurement dates are not same for each
> patient and the intervals between the measurements are not same either.
 
If the intervals between measurements are not equal (or not nearly equal), then employing an autoregressive residual structure is invalid. In fact, I suggest that you forget about the REPEATED statement. Technically, an unstructured residual matrix can never be wrong, but it's likely too complex given the way in which the measurements were collected (unequal time intervals between and within patients). It is worth noting that the MIXED procedure in SAS offers a variety of spatial covariance structures which can handle unequal intervals while accounting for decaying residual correlations as observations become more distant in time, but I'll stick within the confines of SPSS for this post. With that stated, using the MIXED procedure in SPSS, a random coefficient model seems like your best option.
 
> The
> time_point indicates the order of the measurement like measurement 1,
> measurement 2, measurement 3...etc. There are up to 15 measurements per
> patient, the reason for variation between the number of measurements per
> subject is the missing data,
 
Are the data missing completely at random (MCAR) or missing at random (MAR)? If not, you might need to rethink the analytic approach.
 
> so level 1 variable is the measurement taken
> within individual and level 2 variable is the patient. Repeated measured
> blood test is our dependent variable because the diagnosis of the particular
> disease is based on the value of this blood test. I am trying to investigate
> the effect of each independent variable such as age, gender, ethnicity... on
> dependent variable and also the effect on the decline of the dependent
> variable over time, so for example: is the person at age 30 has a higher
> decline from the measurement time point 1 to 2 compared to person at age 60
> ? In that case, will a code like this be appropriate to use?
 
This is not easy to explain over email. Moreover, I'm quite distracted by other pressing work. Having said that, I'm going to try to help get you started. In order to make any movement, I need to make some assumptions:
 
(1) You have the date associated for when the measurements were taken on each subject.
(2) The first measurement was taken shortly before diagnosis.
(3) Patients you are tracking are getting equivalent forms of treatment that started shortly after diagnosis.
 
If yes to all 3 assumptions, then create a Time variable that reflects number of days since baseline. The first measurement on each patient will be considered baseline and should be coded as 0, and subsequent measurements will reflect the number of days since the first measurement/baseline. Concretely, if patient 1 was measured three times (baseline, 5 days post-baseline and 25 days post-baseline, then the dataset should look like this:
 
Patient_ID  Time
1             0
1             5
1            25
2
2
.
.
.
 
Needless to say, if patients are measured more frequently (e.g., multiple times in a single day), then you should make the measurement unit number of hours or minutes since baseline.
 
With that said, I'd parameterize the model as follows:
 
 MIXED Y BY <categorical predictors> WITH Age Time
  /FIXED = <categorical predictors> Age Time <two-way interactions between each predictor and Time> | SSTYPE(3)
  /METHOD = REML
  /PRINT = G SOLUTION TESTCOV
  /RANDOM = INTERCEPT Time | SUBJECT(Patient_ID) COVTYPE(UN).
I am assuming that there is a linear relationship between time and the dependent variable. You can certainly consider exploring other types of relationships. Same goes for Age.
 
At any rate, with the model proposed above you should be able to answer all sorts of research questions using the TEST sub-command (e.g. is the estimated mean on day X since baseline for males significantly different than females; is the slope for males significantly different for females). Examining the estimates from the random effects covariance (G) matrix could prove useful as well, but no time to discuss this right now.
 
Write back if you have additional questions and I'll try to respond when time permits.
 
HTH,
 
Ryan
 
>
>
> MIXED Blood_test_Value BY Gender Ethnicity Hypertension_diagnosis
> Diabetes_Diagnosis IHD_Diagnosis Anaemia_Diagnosis Obesity_Diagnosis
> Time_point WITH Age
>   /CRITERIA = CIN(95) MXITER(150) MXSTEP(5) SCORING(1)
>   SINGULAR(0.000000000001) HCONVERGE(0, ABSOLUTE) LCONVERGE(0, ABSOLUTE)
>   PCONVERGE(0.000001, ABSOLUTE)
>   /FIXED = Gender Ethnicity Age Hypertension_diagnosis Diabetes_Diagnosis
> IHD_Diagnosis Anaemia_Diagnosis Obesity_Diagnosis Time_point
> Gender*Time_point Ethnicity*Time_point Hypertension_diagnosis*Time_point
> Diabetes_Diagnosis*Time_point IHD_Diagnosis*Time_point
> Anaemia_Diagnosis*Time_point Obesity_Diagnosis*Time_point Age*Time_point|
> SSTYPE(3)
>   /METHOD = ML
>   /PRINT = G R SOLUTION TESTCOV
>   /RANDOM = INTERCEPT | SUBJECT(ID) COVTYPE(ID)
>   /REPEATED = Time_point  | SUBJECT(ID) COVTYPE(AR1) .
>
> Thank you for your help again.
>
> Regards,
>
> Zalihe.
>
> --
> View this message in context: http://spssx-discussion.1045642.n5.nabble.com/SPSS-Syntax-MIXED-Model-tp5713934p5713971.html
> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
>
> =====================
> To manage your subscription to SPSSX-L, send a message to
> [hidden email] (not to SPSSX-L), with no body text except the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the command
> INFO REFCARD