Carol,
Often, residual correlation tends to diminish as observations become more distant in time. As currently parameterized, your model assumes a compound symmetric residual correlation structure. In other words, you're assuming the correlation between residuals obtained from observations t1, t2 is the same as t1, t3, etc. Is that a reasonable assumption for your situation? If not, you might want to add a REPEATED statement with an appropriate residual covariance structure specification. HTH, Ryan On Thu, Aug 4, 2011 at 2:05 PM, Parise, Carol A. <[hidden email]> wrote: > Hi all, > > > I'm working through the example for using repeated measures in mixed models in Norusis "advanced statistical procedures companion". this has been a very helpful reference (but would be more helpful if syntax were listed versus drop downs) > > on pages 235 -240 there is an example of "time" being entered as a fixed effect in a mixed design model of repeated measures. the variable is categorical with values of 0,1,2,3. > > When this is entered as a fixed effect, the results show a factor with 3 df but only gives 1 F-value associated with this effect. > > Using my own data, when i enter a time variable with 5 levels, it's treating this as a categorical variable and giving me an estimate for each level of time. > > below is the syntax. > > is there something that needs to be included for this procedure to differentiate wanting the effects of the variable as a whole versus each level of the variable? > > thanks > carol > > > MIXED > dv BY time > /CRITERIA = CIN(95) MXITER(100) MXSTEP(5) SCORING(1) > SINGULAR(0.000000000001) HCONVERGE(0, ABSOLUTE) LCONVERGE(0, ABSOLUTE) > PCONVERGE(0.000001, ABSOLUTE) > /FIXED = time | SSTYPE(3) > /METHOD = REML > /PRINT = SOLUTION TESTCOV > /RANDOM INTERCEPT | SUBJECT(SubID) COVTYPE(VC) . > > ===================== > 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 > ===================== 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 |
Ryan
I hope this isn't a stupid question, but what's the difference between adding a 2nd covariance structure specification on the REPEATED statement and changing the existing specification on the RANDOM statement? How do the two specifications interact? Garry -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of R B Sent: 04 August 2011 20:43 To: [hidden email] Subject: Re: mixed models example in norusis Carol, Often, residual correlation tends to diminish as observations become more distant in time. As currently parameterized, your model assumes a compound symmetric residual correlation structure. In other words, you're assuming the correlation between residuals obtained from observations t1, t2 is the same as t1, t3, etc. Is that a reasonable assumption for your situation? If not, you might want to add a REPEATED statement with an appropriate residual covariance structure specification. HTH, Ryan On Thu, Aug 4, 2011 at 2:05 PM, Parise, Carol A. <[hidden email]> wrote: > Hi all, > > > I'm working through the example for using repeated measures in mixed models in Norusis "advanced statistical procedures companion". this has been a very helpful reference (but would be more helpful if syntax were listed versus drop downs) > > on pages 235 -240 there is an example of "time" being entered as a fixed effect in a mixed design model of repeated measures. the variable is categorical with values of 0,1,2,3. > > When this is entered as a fixed effect, the results show a factor with 3 df but only gives 1 F-value associated with this effect. > > Using my own data, when i enter a time variable with 5 levels, it's treating this as a categorical variable and giving me an estimate for each level of time. > > below is the syntax. > > is there something that needs to be included for this procedure to differentiate wanting the effects of the variable as a whole versus each level of the variable? > > thanks > carol > > > MIXED > dv BY time > /CRITERIA = CIN(95) MXITER(100) MXSTEP(5) SCORING(1) > SINGULAR(0.000000000001) HCONVERGE(0, ABSOLUTE) LCONVERGE(0, ABSOLUTE) > PCONVERGE(0.000001, ABSOLUTE) > /FIXED = time | SSTYPE(3) > /METHOD = REML > /PRINT = SOLUTION TESTCOV > /RANDOM INTERCEPT | SUBJECT(SubID) COVTYPE(VC) . > > ===================== > 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 > ===================== 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 ===================== 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 |
In reply to this post by David Marso
Good Morning list,
Can some kind soul in here point me to where the python modules and devcentral are now located? I find myself wandering around in circles in the IBM labyrinth with no daylight in sight :) TIA Mike ===================== 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 |
In reply to this post by Garry Gelade
Garry,
The linear mixed model can be expressed as: Y = X(BETA) + Z(GAMMA) + EPSILON where the terms reflect the fixed effects (FIXED statement), random effects (RANDOM statement), and errors (REPEATED statement), respectively. Let's focus on Z(GAMMA), since a RANDOM intercept term was specified by the OP: /RANDOM INTERCEPT | SUBJECT(SubID) COVTYPE(VC) This statement implies the following covariance matrix for the random effects ("G"): G = [sigma^2_betweenSs, 0, 0, ..., 0; 0, sigma2_betweenSs, 0, ..., 0; etc. ] The random effect variance component, sigma^2_betweenSs (a.k.a. variance BETWEEN subjects) is specified on the diagonal. Now, since there is only one random term being estimated (the random intercept), adjusting the statement to allow for correlation across random terms would be unnecessary, e.g., /RANDOM INTERCEPT | SUBJECT(SubID) COVTYPE(UN) It so happens to work out mathematically that a random intercept term is generally equivalent to a REPEATED statement with a compound symmetric distribution. But, don't be fooled by this. The RANDOM statement specifies G, which is not the same as the REPEATED statement which specifies the residual matrix, R. While it is true that the following statements are usually equivalent, /RANDOM INTERCEPT | SUBJECT(SubID) COVTYPE({VC} or {UN}, for that matter) /REPEATED TIME | SUBJECT(SubID) COVTYPE(CS) the following statements are not the same!: /RANDOM INTERCEPT | SUBJECT(SubID) COVTYPE(UN) /REPEATED TIME | SUBJECT(SubID) COVTYPE(UN) The above RANDOM statement is generally equivalent to the VC specification (or REPEATED statement with a compound symmetric specification), but the UNstructured specification on the REPEATED statement is a different animal. This specification allows for varying residual correlations between measurements (e.g., corr(t1,t2), corr(t1,t3), etc.); that is, it loosens the compound symmetric restriction. It also allows the residual variance to vary across measurement periods. The bottom line is this-->When dealing with more than two repeated measurements, a compound symmetric residual covariance structure is usually too restrictive. But, if you determine that it is appropriate, either the RANDOM intercept statement or REPEATED statement would likely be just fine. In fact, specifying either one will likely yield identical results. Certainly you would not include both. However, if you find that the residual correlation varies depending on the measurement points (e.g., corr(t1,t2) does not equal corr(t1,t3), etc.), then you should consider adding a REPEATED statement, and specify a more complex structure (e.g., AR1, UN). Adjusting "COVTYPE()" on the RANDOM intercept statement is not what you want! It is possible, and at times preferable, to have both a RANDOM intercept statement and a non-compound symmetric residual covariance structure as specified on the REPEATED statement, e.g., /RANDOM INTERCEPT | SUBJECT(SubID) COVTYPE(VC) /REPEATED TIME | SUBJECT(SubID) COVTYPE(AR1) The above statements entered into the same MIXED model would be interpreted as follows: Conditional on the subject-specific intercepts, residuals obtained from observations closer in time are more highly correlated than residuals obtained from distant observations. This could yield a substantially better fitting model than the REPEATED statement by itself. HTH, Ryan On Fri, Aug 5, 2011 at 7:10 AM, Garry Gelade <[hidden email]> wrote: > Ryan > > I hope this isn't a stupid question, but what's the difference between > adding a 2nd covariance structure specification on the REPEATED statement > and changing the existing specification on the RANDOM statement? How do the > two specifications interact? > > Garry > > -----Original Message----- > From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of R B > Sent: 04 August 2011 20:43 > To: [hidden email] > Subject: Re: mixed models example in norusis > > Carol, > > Often, residual correlation tends to diminish as observations become > more distant in time. As currently parameterized, your model assumes a > compound symmetric residual correlation structure. In other words, > you're assuming the correlation between residuals obtained from > observations t1, t2 is the same as t1, t3, etc. Is that a reasonable > assumption for your situation? If not, you might want to add a > REPEATED statement with an appropriate residual covariance structure > specification. > > HTH, > > Ryan > > On Thu, Aug 4, 2011 at 2:05 PM, Parise, Carol A. > <[hidden email]> wrote: >> Hi all, >> >> >> I'm working through the example for using repeated measures in mixed > models in Norusis "advanced statistical procedures companion". this has been > a very helpful reference (but would be more helpful if syntax were listed > versus drop downs) >> >> on pages 235 -240 there is an example of "time" being entered as a fixed > effect in a mixed design model of repeated measures. the variable is > categorical with values of 0,1,2,3. >> >> When this is entered as a fixed effect, the results show a factor with 3 > df but only gives 1 F-value associated with this effect. >> >> Using my own data, when i enter a time variable with 5 levels, it's > treating this as a categorical variable and giving me an estimate for each > level of time. >> >> below is the syntax. >> >> is there something that needs to be included for this procedure to > differentiate wanting the effects of the variable as a whole versus each > level of the variable? >> >> thanks >> carol >> >> >> MIXED >> dv BY time >> /CRITERIA = CIN(95) MXITER(100) MXSTEP(5) SCORING(1) >> SINGULAR(0.000000000001) HCONVERGE(0, ABSOLUTE) LCONVERGE(0, ABSOLUTE) >> PCONVERGE(0.000001, ABSOLUTE) >> /FIXED = time | SSTYPE(3) >> /METHOD = REML >> /PRINT = SOLUTION TESTCOV >> /RANDOM INTERCEPT | SUBJECT(SubID) COVTYPE(VC) . >> >> ===================== >> 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 >> > > ===================== > 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 > > ===================== > 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 > ===================== 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 |
In reply to this post by Roberts, Michael-2
www.ibm.com/developerworks/spssdevcentral
Jon Peck Senior Software Engineer, IBM [hidden email] new phone: 720-342-5621 From: "Roberts, Michael" <[hidden email]> To: [hidden email] Date: 08/05/2011 08:39 AM Subject: [SPSSX-L] New Devcentral location Sent by: "SPSSX(r) Discussion" <[hidden email]> Good Morning list, Can some kind soul in here point me to where the python modules and devcentral are now located? I find myself wandering around in circles in the IBM labyrinth with no daylight in sight :) TIA Mike ===================== 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 |
In reply to this post by Garry Gelade
Gary,
I'm so glad you asked this question. In fact, I'm at a loss as to how to choose the the appropriate covariace structure for the random effects in a model since there are a dozen to choose from. What ryan says below makes sense for my data but so would the autoregressive structure. Is there a list somewhere of each of the covariance structures available with examples in plain english as to when each would be approrpriate? One issue I am having in just running sample models is that spss 'hangs' with some covariance structures. It leads me to believe that it's obviously not the appropriate covariance structure or I really need a faster computer. Thanks Carol -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Garry Gelade Sent: Friday, August 05, 2011 4:10 AM To: [hidden email] Subject: Re: mixed models example in norusis Ryan I hope this isn't a stupid question, but what's the difference between adding a 2nd covariance structure specification on the REPEATED statement and changing the existing specification on the RANDOM statement? How do the two specifications interact? Garry -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of R B Sent: 04 August 2011 20:43 To: [hidden email] Subject: Re: mixed models example in norusis Carol, Often, residual correlation tends to diminish as observations become more distant in time. As currently parameterized, your model assumes a compound symmetric residual correlation structure. In other words, you're assuming the correlation between residuals obtained from observations t1, t2 is the same as t1, t3, etc. Is that a reasonable assumption for your situation? If not, you might want to add a REPEATED statement with an appropriate residual covariance structure specification. HTH, Ryan On Thu, Aug 4, 2011 at 2:05 PM, Parise, Carol A. <[hidden email]> wrote: > Hi all, > > > I'm working through the example for using repeated measures in mixed models in Norusis "advanced statistical procedures companion". this has been a very helpful reference (but would be more helpful if syntax were listed versus drop downs) > > on pages 235 -240 there is an example of "time" being entered as a > fixed effect in a mixed design model of repeated measures. the variable is categorical with values of 0,1,2,3. > > When this is entered as a fixed effect, the results show a factor with > 3 df but only gives 1 F-value associated with this effect. > > Using my own data, when i enter a time variable with 5 levels, it's treating this as a categorical variable and giving me an estimate for each level of time. > > below is the syntax. > > is there something that needs to be included for this procedure to differentiate wanting the effects of the variable as a whole versus each level of the variable? > > thanks > carol > > > MIXED > dv BY time > /CRITERIA = CIN(95) MXITER(100) MXSTEP(5) SCORING(1) > SINGULAR(0.000000000001) HCONVERGE(0, ABSOLUTE) LCONVERGE(0, > ABSOLUTE) PCONVERGE(0.000001, ABSOLUTE) /FIXED = time | SSTYPE(3) > /METHOD = REML /PRINT = SOLUTION TESTCOV /RANDOM INTERCEPT | > SUBJECT(SubID) COVTYPE(VC) . > > ===================== > 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 > ===================== 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 ===================== 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 ===================== 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 |
Hi Carol
I believe the covariance structures are laid out in the SPSS syntax manual under the mixed model syntax. It is quite easy to see how they are structured and the differences between them. The choice of which to use is partly theoretical (eg autoregressive for a time-series is a plausible first choice) but then its usual to try a few others and examine the effects on model fit, and use the fit statistics to select the "best" one for your particular dataset. It may be that for your data, an autoregressive structure works best, but equally a simpler structure or a more complex one may prove to be better. Garry -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Parise, Carol A. Sent: 05 August 2011 16:31 To: [hidden email] Subject: Re: mixed models example in norusis Gary, I'm so glad you asked this question. In fact, I'm at a loss as to how to choose the the appropriate covariace structure for the random effects in a model since there are a dozen to choose from. What ryan says below makes sense for my data but so would the autoregressive structure. Is there a list somewhere of each of the covariance structures available with examples in plain english as to when each would be approrpriate? One issue I am having in just running sample models is that spss 'hangs' with some covariance structures. It leads me to believe that it's obviously not the appropriate covariance structure or I really need a faster computer. Thanks Carol -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Garry Gelade Sent: Friday, August 05, 2011 4:10 AM To: [hidden email] Subject: Re: mixed models example in norusis Ryan I hope this isn't a stupid question, but what's the difference between adding a 2nd covariance structure specification on the REPEATED statement and changing the existing specification on the RANDOM statement? How do the two specifications interact? Garry -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of R B Sent: 04 August 2011 20:43 To: [hidden email] Subject: Re: mixed models example in norusis Carol, Often, residual correlation tends to diminish as observations become more distant in time. As currently parameterized, your model assumes a compound symmetric residual correlation structure. In other words, you're assuming the correlation between residuals obtained from observations t1, t2 is the same as t1, t3, etc. Is that a reasonable assumption for your situation? If not, you might want to add a REPEATED statement with an appropriate residual covariance structure specification. HTH, Ryan On Thu, Aug 4, 2011 at 2:05 PM, Parise, Carol A. <[hidden email]> wrote: > Hi all, > > > I'm working through the example for using repeated measures in mixed models in Norusis "advanced statistical procedures companion". this has been a very helpful reference (but would be more helpful if syntax were listed versus drop downs) > > on pages 235 -240 there is an example of "time" being entered as a > fixed effect in a mixed design model of repeated measures. the variable is categorical with values of 0,1,2,3. > > When this is entered as a fixed effect, the results show a factor with > 3 df but only gives 1 F-value associated with this effect. > > Using my own data, when i enter a time variable with 5 levels, it's treating this as a categorical variable and giving me an estimate for each level of time. > > below is the syntax. > > is there something that needs to be included for this procedure to differentiate wanting the effects of the variable as a whole versus each level of the variable? > > thanks > carol > > > MIXED > dv BY time > /CRITERIA = CIN(95) MXITER(100) MXSTEP(5) SCORING(1) > SINGULAR(0.000000000001) HCONVERGE(0, ABSOLUTE) LCONVERGE(0, > ABSOLUTE) PCONVERGE(0.000001, ABSOLUTE) /FIXED = time | SSTYPE(3) > /METHOD = REML /PRINT = SOLUTION TESTCOV /RANDOM INTERCEPT | > SUBJECT(SubID) COVTYPE(VC) . > > ===================== > 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 > ===================== 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 ===================== 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 ===================== 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 ===================== 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 |
In reply to this post by Ryan
Thanks Ryan. I am going to study this carefully!
Garry -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of R B Sent: 05 August 2011 16:00 To: [hidden email] Subject: Re: mixed models example in norusis Garry, The linear mixed model can be expressed as: Y = X(BETA) + Z(GAMMA) + EPSILON where the terms reflect the fixed effects (FIXED statement), random effects (RANDOM statement), and errors (REPEATED statement), respectively. Let's focus on Z(GAMMA), since a RANDOM intercept term was specified by the OP: /RANDOM INTERCEPT | SUBJECT(SubID) COVTYPE(VC) This statement implies the following covariance matrix for the random effects ("G"): G = [sigma^2_betweenSs, 0, 0, ..., 0; 0, sigma2_betweenSs, 0, ..., 0; etc. ] The random effect variance component, sigma^2_betweenSs (a.k.a. variance BETWEEN subjects) is specified on the diagonal. Now, since there is only one random term being estimated (the random intercept), adjusting the statement to allow for correlation across random terms would be unnecessary, e.g., /RANDOM INTERCEPT | SUBJECT(SubID) COVTYPE(UN) It so happens to work out mathematically that a random intercept term is generally equivalent to a REPEATED statement with a compound symmetric distribution. But, don't be fooled by this. The RANDOM statement specifies G, which is not the same as the REPEATED statement which specifies the residual matrix, R. While it is true that the following statements are usually equivalent, /RANDOM INTERCEPT | SUBJECT(SubID) COVTYPE({VC} or {UN}, for that matter) /REPEATED TIME | SUBJECT(SubID) COVTYPE(CS) the following statements are not the same!: /RANDOM INTERCEPT | SUBJECT(SubID) COVTYPE(UN) /REPEATED TIME | SUBJECT(SubID) COVTYPE(UN) The above RANDOM statement is generally equivalent to the VC specification (or REPEATED statement with a compound symmetric specification), but the UNstructured specification on the REPEATED statement is a different animal. This specification allows for varying residual correlations between measurements (e.g., corr(t1,t2), corr(t1,t3), etc.); that is, it loosens the compound symmetric restriction. It also allows the residual variance to vary across measurement periods. The bottom line is this-->When dealing with more than two repeated measurements, a compound symmetric residual covariance structure is usually too restrictive. But, if you determine that it is appropriate, either the RANDOM intercept statement or REPEATED statement would likely be just fine. In fact, specifying either one will likely yield identical results. Certainly you would not include both. However, if you find that the residual correlation varies depending on the measurement points (e.g., corr(t1,t2) does not equal corr(t1,t3), etc.), then you should consider adding a REPEATED statement, and specify a more complex structure (e.g., AR1, UN). Adjusting "COVTYPE()" on the RANDOM intercept statement is not what you want! It is possible, and at times preferable, to have both a RANDOM intercept statement and a non-compound symmetric residual covariance structure as specified on the REPEATED statement, e.g., /RANDOM INTERCEPT | SUBJECT(SubID) COVTYPE(VC) /REPEATED TIME | SUBJECT(SubID) COVTYPE(AR1) The above statements entered into the same MIXED model would be interpreted as follows: Conditional on the subject-specific intercepts, residuals obtained from observations closer in time are more highly correlated than residuals obtained from distant observations. This could yield a substantially better fitting model than the REPEATED statement by itself. HTH, Ryan On Fri, Aug 5, 2011 at 7:10 AM, Garry Gelade <[hidden email]> wrote: > Ryan > > I hope this isn't a stupid question, but what's the difference between > adding a 2nd covariance structure specification on the REPEATED statement > and changing the existing specification on the RANDOM statement? How do the > two specifications interact? > > Garry > > -----Original Message----- > From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of R B > Sent: 04 August 2011 20:43 > To: [hidden email] > Subject: Re: mixed models example in norusis > > Carol, > > Often, residual correlation tends to diminish as observations become > more distant in time. As currently parameterized, your model assumes a > compound symmetric residual correlation structure. In other words, > you're assuming the correlation between residuals obtained from > observations t1, t2 is the same as t1, t3, etc. Is that a reasonable > assumption for your situation? If not, you might want to add a > REPEATED statement with an appropriate residual covariance structure > specification. > > HTH, > > Ryan > > On Thu, Aug 4, 2011 at 2:05 PM, Parise, Carol A. > <[hidden email]> wrote: >> Hi all, >> >> >> I'm working through the example for using repeated measures in mixed > models in Norusis "advanced statistical procedures companion". this has > a very helpful reference (but would be more helpful if syntax were listed > versus drop downs) >> >> on pages 235 -240 there is an example of "time" being entered as a fixed > effect in a mixed design model of repeated measures. the variable is > categorical with values of 0,1,2,3. >> >> When this is entered as a fixed effect, the results show a factor with 3 > df but only gives 1 F-value associated with this effect. >> >> Using my own data, when i enter a time variable with 5 levels, it's > treating this as a categorical variable and giving me an estimate for each > level of time. >> >> below is the syntax. >> >> is there something that needs to be included for this procedure to > differentiate wanting the effects of the variable as a whole versus each > level of the variable? >> >> thanks >> carol >> >> >> MIXED >> dv BY time >> /CRITERIA = CIN(95) MXITER(100) MXSTEP(5) SCORING(1) >> SINGULAR(0.000000000001) HCONVERGE(0, ABSOLUTE) LCONVERGE(0, ABSOLUTE) >> PCONVERGE(0.000001, ABSOLUTE) >> /FIXED = time | SSTYPE(3) >> /METHOD = REML >> /PRINT = SOLUTION TESTCOV >> /RANDOM INTERCEPT | SUBJECT(SubID) COVTYPE(VC) . >> >> ===================== >> 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 >> > > ===================== > 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 > > ===================== > 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 > ===================== 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 ===================== 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 |
In reply to this post by parisec
Carol,
Let me cut to the chase and just provide an example. If you run the code BELOW, you'll see that I simulated data which have a first-order autoregressive residual (AR1) covariance structure. Using the simulated data, I then fit the model with an unstructured residual specification and then again with an AR1 residual specification. So, how do we decide whether one model is preferable? First, I would suggest we look at the "Estimates of Covariance Parameters" Table from the UNstructured model. Upon inspection, we see that the cov(t1,t2) is about the same as the cov(t2,t3). We also notice that the covariance between adjacent time points is markedly higher than the covariance between t1 and t3. Finally, we take note that the residual variances, t1, t2, t3, are about the same. This looks like a good candidate for the AR1 specification. We then re-fit the model with an AR1 specification. (Of note, the Estimates of Covariance Parameters Table from the model with the AR1 structure shows that the estimated residual correlation is close to what we specified in the simulation.) Finally, since the model with the AR1 specification is nested in the model with the UNstructured specification, we are able to construct a likelihood ratio test (supplied at the end of the code). The difference in -2LLs approximate a Chi-Square distribution with degrees of freedom = difference in # of parameters estimated. The Unstructured specification has not significantly improved fit (p>.05). It should be pretty clear at this point that the more parsimonious model with the AR1 specification would be preferable. HTH, Ryan *Generate Data for Mixed Model with AR1 specification. set seed 65923454. new file. inp pro. compute subject=-99. compute time = -99. compute x1 = -99. compute x2 = -99. compute x3 = -99. compute e1 = -99. compute e2 = -99. compute e3 = -99. compute sigma = 1. compute rho = 0.50. compute a11 = 1. compute a21 = rho. compute a31 = rho**2. compute a22 = sqrt(1 - rho**2). compute a32 = rho*sqrt(1 - rho**2). compute a33 = sqrt(1 - rho**2). leave subject to a33. loop subject= 1 to 1000. compute x1 = rv.normal(0,1). compute x2 = rv.normal(0,1). compute x3 = rv.normal(0,1). compute e1 = sigma * a11*x1. compute e2 = sigma * (a21*x1 + a22*x2). compute e3 = sigma * (a31*x1 + a32*x2 + a33*x3). loop time = 1 to 3. compute y = 1.5 + 1.2*(time=1) + 0.9*(time=2) + e1*(time=1) + e2*(time=2) + e3*(time=3). end case. end loop. end loop. end file. end inp pro. exe. delete variables x1 x2 x3 sigma rho a11 a21 a31 a22 a32 a33 e1 e2 e3. MIXED y BY time /FIXED=time | SSTYPE(3) /METHOD=REML /PRINT=R SOLUTION /REPEATED=time | SUBJECT(subject) COVTYPE(UN). MIXED y BY time /FIXED=time | SSTYPE(3) /METHOD=REML /PRINT=R SOLUTION /REPEATED=time | SUBJECT(subject) COVTYPE(AR1). compute deviance_difference = abs(8102.120471002093 - 8103.357531356206). compute deviance_p_value = 1 - CDF.CHISQ(deviance_difference,4). execute. On Fri, Aug 5, 2011 at 11:31 AM, Parise, Carol A. <[hidden email]> wrote: > Gary, > > I'm so glad you asked this question. In fact, I'm at a loss as to how to choose the the appropriate covariace structure for the random effects in a model since there are a dozen to choose from. What ryan says below makes sense for my data but so would the autoregressive structure. > > Is there a list somewhere of each of the covariance structures available with examples in plain english as to when each would be approrpriate? > > One issue I am having in just running sample models is that spss 'hangs' with some covariance structures. It leads me to believe that it's obviously not the appropriate covariance structure or I really need a faster computer. > > Thanks > Carol > > -----Original Message----- > From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Garry Gelade > Sent: Friday, August 05, 2011 4:10 AM > To: [hidden email] > Subject: Re: mixed models example in norusis > > Ryan > > I hope this isn't a stupid question, but what's the difference between adding a 2nd covariance structure specification on the REPEATED statement and changing the existing specification on the RANDOM statement? How do the two specifications interact? > > Garry > > -----Original Message----- > From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of R B > Sent: 04 August 2011 20:43 > To: [hidden email] > Subject: Re: mixed models example in norusis > > Carol, > > Often, residual correlation tends to diminish as observations become more distant in time. As currently parameterized, your model assumes a compound symmetric residual correlation structure. In other words, you're assuming the correlation between residuals obtained from observations t1, t2 is the same as t1, t3, etc. Is that a reasonable assumption for your situation? If not, you might want to add a REPEATED statement with an appropriate residual covariance structure specification. > > HTH, > > Ryan > > On Thu, Aug 4, 2011 at 2:05 PM, Parise, Carol A. > <[hidden email]> wrote: >> Hi all, >> >> >> I'm working through the example for using repeated measures in mixed > models in Norusis "advanced statistical procedures companion". this has been a very helpful reference (but would be more helpful if syntax were listed versus drop downs) >> >> on pages 235 -240 there is an example of "time" being entered as a >> fixed > effect in a mixed design model of repeated measures. the variable is categorical with values of 0,1,2,3. >> >> When this is entered as a fixed effect, the results show a factor with >> 3 > df but only gives 1 F-value associated with this effect. >> >> Using my own data, when i enter a time variable with 5 levels, it's > treating this as a categorical variable and giving me an estimate for each level of time. >> >> below is the syntax. >> >> is there something that needs to be included for this procedure to > differentiate wanting the effects of the variable as a whole versus each level of the variable? >> >> thanks >> carol >> >> >> MIXED >> dv BY time >> /CRITERIA = CIN(95) MXITER(100) MXSTEP(5) SCORING(1) >> SINGULAR(0.000000000001) HCONVERGE(0, ABSOLUTE) LCONVERGE(0, >> ABSOLUTE) PCONVERGE(0.000001, ABSOLUTE) /FIXED = time | SSTYPE(3) >> /METHOD = REML /PRINT = SOLUTION TESTCOV /RANDOM INTERCEPT | >> SUBJECT(SubID) COVTYPE(VC) . >> >> ===================== >> 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 >> > > ===================== > 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 > > ===================== > 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 > > ===================== > 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 > ===================== 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 |
Ryan
Thanks much for taking the time to write this out. I will give these a try and compare. In addition your previous post stating: /RANDOM INTERCEPT | SUBJECT(SubID) COVTYPE(VC) /REPEATED TIME | SUBJECT(SubID) COVTYPE(AR1) >The above statements entered into the same MIXED model would be interpreted as follows: Conditional on the subject-specific intercepts, residuals obtained from observations closer in time are >more highly correlated than residuals obtained from distant observations. This could yield a substantially better fitting model than the REPEATED statement by itself. looks like it may hit the nail on the head. Can you provide insight on the "hanging up" issue? Is this due to an in appropriate model or just processor speed? Carol -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of R B Sent: Friday, August 05, 2011 10:45 AM To: [hidden email] Subject: Re: mixed models example in norusis Carol, Let me cut to the chase and just provide an example. If you run the code BELOW, you'll see that I simulated data which have a first-order autoregressive residual (AR1) covariance structure. Using the simulated data, I then fit the model with an unstructured residual specification and then again with an AR1 residual specification. So, how do we decide whether one model is preferable? First, I would suggest we look at the "Estimates of Covariance Parameters" Table from the UNstructured model. Upon inspection, we see that the cov(t1,t2) is about the same as the cov(t2,t3). We also notice that the covariance between adjacent time points is markedly higher than the covariance between t1 and t3. Finally, we take note that the residual variances, t1, t2, t3, are about the same. This looks like a good candidate for the AR1 specification. We then re-fit the model with an AR1 specification. (Of note, the Estimates of Covariance Parameters Table from the model with the AR1 structure shows that the estimated residual correlation is close to what we specified in the simulation.) Finally, since the model with the AR1 specification is nested in the model with the UNstructured specification, we are able to construct a likelihood ratio test (supplied at the end of the code). The difference in -2LLs approximate a Chi-Square distribution with degrees of freedom = difference in # of parameters estimated. The Unstructured specification has not significantly improved fit (p>.05). It should be pretty clear at this point that the more parsimonious model with the AR1 specification would be preferable. HTH, Ryan *Generate Data for Mixed Model with AR1 specification. set seed 65923454. new file. inp pro. compute subject=-99. compute time = -99. compute x1 = -99. compute x2 = -99. compute x3 = -99. compute e1 = -99. compute e2 = -99. compute e3 = -99. compute sigma = 1. compute rho = 0.50. compute a11 = 1. compute a21 = rho. compute a31 = rho**2. compute a22 = sqrt(1 - rho**2). compute a32 = rho*sqrt(1 - rho**2). compute a33 = sqrt(1 - rho**2). leave subject to a33. loop subject= 1 to 1000. compute x1 = rv.normal(0,1). compute x2 = rv.normal(0,1). compute x3 = rv.normal(0,1). compute e1 = sigma * a11*x1. compute e2 = sigma * (a21*x1 + a22*x2). compute e3 = sigma * (a31*x1 + a32*x2 + a33*x3). loop time = 1 to 3. compute y = 1.5 + 1.2*(time=1) + 0.9*(time=2) + e1*(time=1) + e2*(time=2) + e3*(time=3). end case. end loop. end loop. end file. end inp pro. exe. delete variables x1 x2 x3 sigma rho a11 a21 a31 a22 a32 a33 e1 e2 e3. MIXED y BY time /FIXED=time | SSTYPE(3) /METHOD=REML /PRINT=R SOLUTION /REPEATED=time | SUBJECT(subject) COVTYPE(UN). MIXED y BY time /FIXED=time | SSTYPE(3) /METHOD=REML /PRINT=R SOLUTION /REPEATED=time | SUBJECT(subject) COVTYPE(AR1). compute deviance_difference = abs(8102.120471002093 - 8103.357531356206). compute deviance_p_value = 1 - CDF.CHISQ(deviance_difference,4). execute. On Fri, Aug 5, 2011 at 11:31 AM, Parise, Carol A. <[hidden email]> wrote: > Gary, > > I'm so glad you asked this question. In fact, I'm at a loss as to how to choose the the appropriate covariace structure for the random effects in a model since there are a dozen to choose from. What ryan says below makes sense for my data but so would the autoregressive structure. > > Is there a list somewhere of each of the covariance structures available with examples in plain english as to when each would be approrpriate? > > One issue I am having in just running sample models is that spss 'hangs' with some covariance structures. It leads me to believe that it's obviously not the appropriate covariance structure or I really need a faster computer. > > Thanks > Carol > > -----Original Message----- > From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf > Of Garry Gelade > Sent: Friday, August 05, 2011 4:10 AM > To: [hidden email] > Subject: Re: mixed models example in norusis > > Ryan > > I hope this isn't a stupid question, but what's the difference between adding a 2nd covariance structure specification on the REPEATED statement and changing the existing specification on the RANDOM statement? How do the two specifications interact? > > Garry > > -----Original Message----- > From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf > Of R B > Sent: 04 August 2011 20:43 > To: [hidden email] > Subject: Re: mixed models example in norusis > > Carol, > > Often, residual correlation tends to diminish as observations become more distant in time. As currently parameterized, your model assumes a compound symmetric residual correlation structure. In other words, you're assuming the correlation between residuals obtained from observations t1, t2 is the same as t1, t3, etc. Is that a reasonable assumption for your situation? If not, you might want to add a REPEATED statement with an appropriate residual covariance structure specification. > > HTH, > > Ryan > > On Thu, Aug 4, 2011 at 2:05 PM, Parise, Carol A. > <[hidden email]> wrote: >> Hi all, >> >> >> I'm working through the example for using repeated measures in mixed > models in Norusis "advanced statistical procedures companion". this > has been a very helpful reference (but would be more helpful if syntax > were listed versus drop downs) >> >> on pages 235 -240 there is an example of "time" being entered as a >> fixed > effect in a mixed design model of repeated measures. the variable is categorical with values of 0,1,2,3. >> >> When this is entered as a fixed effect, the results show a factor >> with >> 3 > df but only gives 1 F-value associated with this effect. >> >> Using my own data, when i enter a time variable with 5 levels, it's > treating this as a categorical variable and giving me an estimate for each level of time. >> >> below is the syntax. >> >> is there something that needs to be included for this procedure to > differentiate wanting the effects of the variable as a whole versus each level of the variable? >> >> thanks >> carol >> >> >> MIXED >> dv BY time >> /CRITERIA = CIN(95) MXITER(100) MXSTEP(5) SCORING(1) >> SINGULAR(0.000000000001) HCONVERGE(0, ABSOLUTE) LCONVERGE(0, >> ABSOLUTE) PCONVERGE(0.000001, ABSOLUTE) /FIXED = time | SSTYPE(3) >> /METHOD = REML /PRINT = SOLUTION TESTCOV /RANDOM INTERCEPT | >> SUBJECT(SubID) COVTYPE(VC) . >> >> ===================== >> 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 >> > > ===================== > 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 > > ===================== > 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 > > ===================== > 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 > ===================== 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 ===================== 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 |
Free forum by Nabble | Edit this page |