splines in mixed models

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

splines in mixed models

parisec
 
hi all,
 
I have a model where I want to know the effect of age on the DV *within* 5 quintiles of age on time. The nature of the relationship of age with time in this study is that younger people don't slow down as much as older people, so entering age as a continuous varible doesn't make sense since this assumes a consistent association with time across all ages. The goal is to be able to say something like:
 
"In the youngest quintile, a one year increase in age was associated with a 0.25 hour increase in time whereas in the highest quintile, a one unit increase in age was asociated with a 1 hour increase in time."
 
 
This lead to a search to figure out how to compute splines with knots at the highest age of each of the age quintiles in my model.
 
I found this reference on Raynauld's site http://www.spsstools.net/Syntax/RegressionRepeatedMeasure/PiecewiseRegression.txt. The example was a linear model with 2 knots, one at xA=15 and one at xA=25. You compute:
 
COMPUTE xb1=xa-15
COMPUTE xc1=xa-25.
recode xb1 xc1 (lo thru 0 =0).
 
once i ran frequencies on this, it made sense as to how i could enter these variables into the model and interpret them as i stated above.
 
 
It then states to enter them into linear regression by entering:
 
/Method = enter xa
/method= enter xb1
/method = enter xc1
 
My 2 questions:
 
1) Do you need to enter the original xa variable in the model with the spline variables and the other fixed variables? I can't quite understand why this is necessary.
2) I'm assuming the answer is YES, but i just want to check -  can i enter these spline variables into a mixed model and interpret them the same way?
 
 
thank you!
Carol
 
 
 
 
 
 
 
 
 
 
 
 
Reply | Threaded
Open this post in threaded view
|

Re: splines in mixed models

Jon K Peck
In this parameterization, you need all three variables.  xa gives the linear effect, xb gives the first delta starting at 15, and xb gives the second delta starting at 25.  So above 25, the effect is the sum of all three coefficients, for example.

This, of course, is just a linear spine.  Often people prefer to use cubic splines, which give a smoother effect.

You could, of course, just use a functional transformation of the independent variable, for example, a cubic polynomial to get varying slopes.

Jon Peck (no "h")
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621




From:        "Parise, Carol A." <[hidden email]>
To:        [hidden email]
Date:        10/17/2011 11:52 AM
Subject:        [SPSSX-L] splines in mixed models
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




 
hi all,
 
I have a model where I want to know the effect of age on the DV *within* 5 quintiles of age on time. The nature of the relationship of age with time in this study is that younger people don't slow down as much as older people, so entering age as a continuous varible doesn't make sense since this assumes a consistent association with time across all ages. The goal is to be able to say something like:
 
"In the youngest quintile, a one year increase in age was associated with a 0.25 hour increase in time whereas in the highest quintile, a one unit increase in age was asociated with a 1 hour increase in time."
 
 
This lead to a search to figure out how to compute splines with knots at the highest age of each of the age quintiles in my model.
 
I found this reference on Raynauld's site http://www.spsstools.net/Syntax/RegressionRepeatedMeasure/PiecewiseRegression.txt. The example was a linear model with 2 knots, one at xA=15 and one at xA=25. You compute:
 
COMPUTE xb1=xa-15
COMPUTE xc1=xa-25.
recode xb1 xc1 (lo thru 0 =0).
 
once i ran frequencies on this, it made sense as to how i could enter these variables into the model and interpret them as i stated above.
 
 
It then states to enter them into linear regression by entering:
 
/Method = enter xa
/method= enter xb1
/method = enter xc1
 
My 2 questions:
 
1) Do you need to enter the original xa variable in the model with the spline variables and the other fixed variables? I can't quite understand why this is necessary.
2) I'm assuming the answer is YES, but i just want to check -  can i enter these spline variables into a mixed model and interpret them the same way?
 
 
thank you!
Carol
 
 
 
 
 
 
 
 
 
 
 
 
Reply | Threaded
Open this post in threaded view
|

Automatic reply: splines in mixed models

Chih-Hung Chang

Out at an NIH study section.

 

Reply | Threaded
Open this post in threaded view
|

Re: splines in mixed models

parisec
In reply to this post by Jon K Peck
Jon,
 
I considered transforming the age variable but tried to figure out how i could make a statment about what is happening within a specified age range? 
 
I've got 5 age/spline variables with knots that I have predetermined. My original question is with regards to the usefullness of the original variable if i have already determined that in its original form, it does not fit the model.
Thank you!
Carol
 
 

From: Jon K Peck [mailto:[hidden email]]
Sent: Monday, October 17, 2011 12:00 PM
To: Parise, Carol A.
Cc: [hidden email]
Subject: Re: [SPSSX-L] splines in mixed models

In this parameterization, you need all three variables.  xa gives the linear effect, xb gives the first delta starting at 15, and xb gives the second delta starting at 25.  So above 25, the effect is the sum of all three coefficients, for example.

This, of course, is just a linear spine.  Often people prefer to use cubic splines, which give a smoother effect.

You could, of course, just use a functional transformation of the independent variable, for example, a cubic polynomial to get varying slopes.

Jon Peck (no "h")
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621




From:        "Parise, Carol A." <[hidden email]>
To:        [hidden email]
Date:        10/17/2011 11:52 AM
Subject:        [SPSSX-L] splines in mixed models
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




 
hi all,
 
I have a model where I want to know the effect of age on the DV *within* 5 quintiles of age on time. The nature of the relationship of age with time in this study is that younger people don't slow down as much as older people, so entering age as a continuous varible doesn't make sense since this assumes a consistent association with time across all ages. The goal is to be able to say something like:
 
"In the youngest quintile, a one year increase in age was associated with a 0.25 hour increase in time whereas in the highest quintile, a one unit increase in age was asociated with a 1 hour increase in time."
 
 
This lead to a search to figure out how to compute splines with knots at the highest age of each of the age quintiles in my model.
 
I found this reference on Raynauld's site http://www.spsstools.net/Syntax/RegressionRepeatedMeasure/PiecewiseRegression.txt. The example was a linear model with 2 knots, one at xA=15 and one at xA=25. You compute:
 
COMPUTE xb1=xa-15
COMPUTE xc1=xa-25.
recode xb1 xc1 (lo thru 0 =0).
 
once i ran frequencies on this, it made sense as to how i could enter these variables into the model and interpret them as i stated above.
 
 
It then states to enter them into linear regression by entering:
 
/Method = enter xa
/method= enter xb1
/method = enter xc1
 
My 2 questions:
 
1) Do you need to enter the original xa variable in the model with the spline variables and the other fixed variables? I can't quite understand why this is necessary.
2) I'm assuming the answer is YES, but i just want to check -  can i enter these spline variables into a mixed model and interpret them the same way?
 
 
thank you!
Carol
 
 
 
 
 
 
 
 
 
 
 
 
Reply | Threaded
Open this post in threaded view
|

Re: splines in mixed models

Jon K Peck
The point about including the original variable is that in the parameterization you gave, the total effect of the x variable is the sum of all the coefficients times each transform, so without the original variable, you are not estimating the model.  You could, of course, parameterize the model differently as in
(a <x <=b) * x, (b <x <=c) * x, etc where each parenthesized expression is 0 or 1.  Then you would leave x out of the model, because it would be perfectly collinear.

With any nonlinear function, though, you could compute an average for an interval or just show the effects at particular points.

Jon Peck (no "h")
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621




From:        "Parise, Carol A." <[hidden email]>
To:        Jon K Peck/Chicago/IBM@IBMUS
Cc:        "[hidden email]" <[hidden email]>
Date:        10/17/2011 01:18 PM
Subject:        RE: [SPSSX-L] splines in mixed models




Jon,
 
I considered transforming the age variable but tried to figure out how i could make a statment about what is happening within a specified age range?
 
I've got 5 age/spline variables with knots that I have predetermined. My original question is with regards to the usefullness of the original variable if i have already determined that in its original form, it does not fit the model.
Thank you!
Carol
 
 


From: Jon K Peck [mailto:peck@...]
Sent:
Monday, October 17, 2011 12:00 PM
To:
Parise, Carol A.
Cc:
[hidden email]
Subject:
Re: [SPSSX-L] splines in mixed models


In this parameterization, you need all three variables.  xa gives the linear effect, xb gives the first delta starting at 15, and xb gives the second delta starting at 25.  So above 25, the effect is the sum of all three coefficients, for example.

This, of course, is just a linear spine.  Often people prefer to use cubic splines, which give a smoother effect.


You could, of course, just use a functional transformation of the independent variable, for example, a cubic polynomial to get varying slopes.


Jon Peck (no "h")
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621





From:        
"Parise, Carol A." <[hidden email]>
To:        
[hidden email]
Date:        
10/17/2011 11:52 AM
Subject:        
[SPSSX-L] splines in mixed models
Sent by:        
"SPSSX(r) Discussion" <[hidden email]>




 
hi all,

 
I have a model where I want to know the effect of age on the DV *within* 5 quintiles of age on time. The nature of the relationship of age with time in this study is that younger people don't slow down as much as older people, so entering age as a continuous varible doesn't make sense since this assumes a consistent association with time across all ages. The goal is to be able to say something like:

 
"In the youngest quintile, a one year increase in age was associated with a 0.25 hour increase in time whereas in the highest quintile, a one unit increase in age was asociated with a 1 hour increase in time."

 
 
This lead to a search to figure out how to compute splines with knots at the highest age of each of the age quintiles in my model.

 
I found this reference on Raynauld's site
http://www.spsstools.net/Syntax/RegressionRepeatedMeasure/PiecewiseRegression.txt. The example was a linear model with 2 knots, one at xA=15 and one at xA=25. You compute:
 
COMPUTE xb1=xa-15

COMPUTE xc1=xa-25.

recode xb1 xc1 (lo thru 0 =0).

 
once i ran frequencies on this, it made sense as to how i could enter these variables into the model and interpret them as i stated above.

 
 
It then states to enter them into linear regression by entering:

 
/Method = enter xa

/method= enter xb1

/method = enter xc1

 
My 2 questions:

 
1) Do you need to enter the original xa variable in the model with the spline variables and the other fixed variables? I can't quite understand why this is necessary.

2) I'm assuming the answer is YES, but i just want to check -  can i enter these spline variables into a mixed model and interpret them the same way?

 
 
thank you!

Carol

 
 
 
 
 
 
 
 
 
 
 
 
Reply | Threaded
Open this post in threaded view
|

Re: splines in mixed models

Jon K Peck
I should have pointed out that the first, incremental parameterization provides continuity in the response function, but the second one does not impose a continuity constraint.

One useful thing to do would be to run the model with only the linear term and then plot the residuals against the x variable(s) to see whether there is a visible nonlinearity.  That's an intraocular test more or less equivalent to testing the significance of the xb and xc terms.

Jon Peck (no "h")
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621




From:        Jon K Peck/Chicago/IBM@IBMUS
To:        [hidden email]
Date:        10/17/2011 01:43 PM
Subject:        Re: [SPSSX-L] splines in mixed models
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




The point about including the original variable is that in the parameterization you gave, the total effect of the x variable is the sum of all the coefficients times each transform, so without the original variable, you are not estimating the model.  You could, of course, parameterize the model differently as in
(a <x <=b) * x, (b <x <=c) * x, etc where each parenthesized expression is 0 or 1.  Then you would leave x out of the model, because it would be perfectly collinear.


With any nonlinear function, though, you could compute an average for an interval or just show the effects at particular points.


Jon Peck (no "h")
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621





From:        
"Parise, Carol A." <[hidden email]>
To:        
Jon K Peck/Chicago/IBM@IBMUS
Cc:        
"[hidden email]" <[hidden email]>
Date:        
10/17/2011 01:18 PM
Subject:        
RE: [SPSSX-L] splines in mixed models




Jon,

 

I considered transforming the age variable but tried to figure out how i could make a statment about what is happening within a specified age range?

 

I've got 5 age/spline variables with knots that I have predetermined. My original question is with regards to the usefullness of the original variable if i have already determined that in its original form, it does not fit the model.

Thank you!

Carol

 
 


From:
Jon K Peck [
mailto:peck@...]
Sent:
Monday, October 17, 2011 12:00 PM
To:
Parise, Carol A.
Cc:
[hidden email]
Subject:
Re: [SPSSX-L] splines in mixed models


In this parameterization, you need all three variables.  xa gives the linear effect, xb gives the first delta starting at 15, and xb gives the second delta starting at 25.  So above 25, the effect is the sum of all three coefficients, for example.


This, of course, is just a linear spine.  Often people prefer to use cubic splines, which give a smoother effect.


You could, of course, just use a functional transformation of the independent variable, for example, a cubic polynomial to get varying slopes.


Jon Peck (no "h")
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621





From:        
"Parise, Carol A." <[hidden email]>
To:        
[hidden email]
Date:        
10/17/2011 11:52 AM
Subject:        
[SPSSX-L] splines in mixed models
Sent by:        
"SPSSX(r) Discussion" <[hidden email]>





hi all,


I have a model where I want to know the effect of age on the DV *within* 5 quintiles of age on time. The nature of the relationship of age with time in this study is that younger people don't slow down as much as older people, so entering age as a continuous varible doesn't make sense since this assumes a consistent association with time across all ages. The goal is to be able to say something like:


"In the youngest quintile, a one year increase in age was associated with a 0.25 hour increase in time whereas in the highest quintile, a one unit increase in age was asociated with a 1 hour increase in time."



This lead to a search to figure out how to compute splines with knots at the highest age of each of the age quintiles in my model.


I found this reference on Raynauld's site
http://www.spsstools.net/Syntax/RegressionRepeatedMeasure/PiecewiseRegression.txt. The example was a linear model with 2 knots, one at xA=15 and one at xA=25. You compute:

COMPUTE xb1=xa-15

COMPUTE xc1=xa-25.

recode xb1 xc1 (lo thru 0 =0).


once i ran frequencies on this, it made sense as to how i could enter these variables into the model and interpret them as i stated above.



It then states to enter them into linear regression by entering:


/Method = enter xa

/method= enter xb1

/method = enter xc1


My 2 questions:


1) Do you need to enter the original xa variable in the model with the spline variables and the other fixed variables? I can't quite understand why this is necessary.

2) I'm assuming the answer is YES, but i just want to check -  can i enter these spline variables into a mixed model and interpret them the same way?



thank you!

Carol












 

Reply | Threaded
Open this post in threaded view
|

Re: splines in mixed models

parisec
In reply to this post by Jon K Peck
 
Gotcha. So if i were to compute the following variables:
 
COMPUTE age36=age-36
COMPUTE age41=age-41

COMPUTE age46=age-46

COMPUTE age51=age-51

recode xb1 xc1 (lo thru 0 =0).
 
...and enter all variables along with the centered age, would the coefficients be interpreted as I originally stated?:
 
"For people age 36 and younger,  a one year increase in age was not associated with decreased time, but  a one year increase in age between 42 and 46 was asociated with a 1 hour increase in time".
 
Thanks
Carol
 
 

 
 


From: Jon K Peck [mailto:[hidden email]]
Sent: Monday, October 17, 2011 12:00 PM
To: Parise, Carol A.
Cc: [hidden email]
Subject: Re: [SPSSX-L] splines in mixed models

In this parameterization, you need all three variables.  xa gives the linear effect, xb gives the first delta starting at 15, and xb gives the second delta starting at 25.  So above 25, the effect is the sum of all three coefficients, for example.

This, of course, is just a linear spine.  Often people prefer to use cubic splines, which give a smoother effect.

You could, of course, just use a functional transformation of the independent variable, for example, a cubic polynomial to get varying slopes.

Jon Peck (no "h")
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621




From:        "Parise, Carol A." <[hidden email]>
To:        [hidden email]
Date:        10/17/2011 11:52 AM
Subject:        [SPSSX-L] splines in mixed models
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




 
hi all,
 
I have a model where I want to know the effect of age on the DV *within* 5 quintiles of age on time. The nature of the relationship of age with time in this study is that younger people don't slow down as much as older people, so entering age as a continuous varible doesn't make sense since this assumes a consistent association with time across all ages. The goal is to be able to say something like:
 
"In the youngest quintile, a one year increase in age was associated with a 0.25 hour increase in time whereas in the highest quintile, a one unit increase in age was asociated with a 1 hour increase in time."
 
 
This lead to a search to figure out how to compute splines with knots at the highest age of each of the age quintiles in my model.
 
I found this reference on Raynauld's site http://www.spsstools.net/Syntax/RegressionRepeatedMeasure/PiecewiseRegression.txt. The example was a linear model with 2 knots, one at xA=15 and one at xA=25. You compute:
 
COMPUTE xb1=xa-15
COMPUTE xc1=xa-25.
recode xb1 xc1 (lo thru 0 =0).
 
once i ran frequencies on this, it made sense as to how i could enter these variables into the model and interpret them as i stated above.
 
 
It then states to enter them into linear regression by entering:
 
/Method = enter xa
/method= enter xb1
/method = enter xc1
 
My 2 questions:
 
1) Do you need to enter the original xa variable in the model with the spline variables and the other fixed variables? I can't quite understand why this is necessary.
2) I'm assuming the answer is YES, but i just want to check -  can i enter these spline variables into a mixed model and interpret them the same way?
 
 
thank you!
Carol
 
 
 
 
 
 
 
 
 
 
 
 
Reply | Threaded
Open this post in threaded view
|

Re: splines in mixed models

Jon K Peck
Assuming that the recodes below are adjusted, a 1-year age increase between 41 and 46 has an effect that is
bage + bage36 + bage46, where bage is the age regression coefficient, etc.  That, of course, does not tell you whether the age effect is statistically significant.

Jon Peck (no "h")
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621




From:        "Parise, Carol A." <[hidden email]>
To:        [hidden email]
Date:        10/18/2011 12:57 PM
Subject:        Re: [SPSSX-L] splines in mixed models
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




 
Gotcha. So if i were to compute the following variables:
 
COMPUTE age36=age-36
COMPUTE age41=age-41
COMPUTE age46=age-46
COMPUTE age51=age-51
recode xb1 xc1 (lo thru 0 =0).

 
...and enter all variables along with the centered age, would the coefficients be interpreted as I originally stated?:
 
"For people age 36 and younger,  a one year increase in age was not associated with decreased time, but  a one year increase in age between 42 and 46 was asociated with a 1 hour increase in time".
 
Thanks
Carol
 
 

 
 


From: Jon K Peck [mailto:peck@...]
Sent:
Monday, October 17, 2011 12:00 PM
To:
Parise, Carol A.
Cc:
[hidden email]
Subject:
Re: [SPSSX-L] splines in mixed models


In this parameterization, you need all three variables.  xa gives the linear effect, xb gives the first delta starting at 15, and xb gives the second delta starting at 25.  So above 25, the effect is the sum of all three coefficients, for example.

This, of course, is just a linear spine.  Often people prefer to use cubic splines, which give a smoother effect.


You could, of course, just use a functional transformation of the independent variable, for example, a cubic polynomial to get varying slopes.


Jon Peck (no "h")
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621





From:        
"Parise, Carol A." <[hidden email]>
To:        
[hidden email]
Date:        
10/17/2011 11:52 AM
Subject:        
[SPSSX-L] splines in mixed models
Sent by:        
"SPSSX(r) Discussion" <[hidden email]>




 
hi all,

 
I have a model where I want to know the effect of age on the DV *within* 5 quintiles of age on time. The nature of the relationship of age with time in this study is that younger people don't slow down as much as older people, so entering age as a continuous varible doesn't make sense since this assumes a consistent association with time across all ages. The goal is to be able to say something like:

 
"In the youngest quintile, a one year increase in age was associated with a 0.25 hour increase in time whereas in the highest quintile, a one unit increase in age was asociated with a 1 hour increase in time."

 
 
This lead to a search to figure out how to compute splines with knots at the highest age of each of the age quintiles in my model.

 
I found this reference on Raynauld's site
http://www.spsstools.net/Syntax/RegressionRepeatedMeasure/PiecewiseRegression.txt. The example was a linear model with 2 knots, one at xA=15 and one at xA=25. You compute:
 
COMPUTE xb1=xa-15

COMPUTE xc1=xa-25.

recode xb1 xc1 (lo thru 0 =0).

 
once i ran frequencies on this, it made sense as to how i could enter these variables into the model and interpret them as i stated above.

 
 
It then states to enter them into linear regression by entering:

 
/Method = enter xa

/method= enter xb1

/method = enter xc1

 
My 2 questions:

 
1) Do you need to enter the original xa variable in the model with the spline variables and the other fixed variables? I can't quite understand why this is necessary.

2) I'm assuming the answer is YES, but i just want to check -  can i enter these spline variables into a mixed model and interpret them the same way?

 
 
thank you!

Carol

 
 
 
 
 
 
 
 
 
 
 
 
Reply | Threaded
Open this post in threaded view
|

Re: splines in mixed models

parisec
a couple of questions:
 
 
1) "Assuming that the recodes below are adjusted" do you mean for other variables in the model?
2) bage + bage36 + bage46, where bage is the age regression coefficient, etc
 
lets say that the results looked like this:
 
coefficient centered age = .01 - NS
coefficient for age36 = .25 - sig
coefficient for age41 =  .10 = NS
coefficient for age46 = .09 = NS
coefficient for age51 = .03 = NS
 
if i were to compute predicted times, would the equation be the following:
 
pTime= intercept + .01(centered age)+ .25(age36)+ .10(age41)+ .09(age46) +.03(age51)
 
thank you much!
Carol


From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Jon K Peck
Sent: Tuesday, October 18, 2011 12:32 PM
To: [hidden email]
Subject: Re: splines in mixed models

Assuming that the recodes below are adjusted, a 1-year age increase between 41 and 46 has an effect that is
bage + bage36 + bage46, where bage is the age regression coefficient, etc.  That, of course, does not tell you whether the age effect is statistically significant.

Jon Peck (no "h")
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621




From:        "Parise, Carol A." <[hidden email]>
To:        [hidden email]
Date:        10/18/2011 12:57 PM
Subject:        Re: [SPSSX-L] splines in mixed models
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




 
Gotcha. So if i were to compute the following variables:
 
COMPUTE age36=age-36
COMPUTE age41=age-41
COMPUTE age46=age-46
COMPUTE age51=age-51
recode xb1 xc1 (lo thru 0 =0).

 
...and enter all variables along with the centered age, would the coefficients be interpreted as I originally stated?:
 
"For people age 36 and younger,  a one year increase in age was not associated with decreased time, but  a one year increase in age between 42 and 46 was asociated with a 1 hour increase in time".
 
Thanks
Carol
 
 

 
 


From: Jon K Peck [[hidden email]]
Sent:
Monday, October 17, 2011 12:00 PM
To:
Parise, Carol A.
Cc:
[hidden email]
Subject:
Re: [SPSSX-L] splines in mixed models


In this parameterization, you need all three variables.  xa gives the linear effect, xb gives the first delta starting at 15, and xb gives the second delta starting at 25.  So above 25, the effect is the sum of all three coefficients, for example.

This, of course, is just a linear spine.  Often people prefer to use cubic splines, which give a smoother effect.


You could, of course, just use a functional transformation of the independent variable, for example, a cubic polynomial to get varying slopes.


Jon Peck (no "h")
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621





From:        
"Parise, Carol A." <[hidden email]>
To:        
[hidden email]
Date:        
10/17/2011 11:52 AM
Subject:        
[SPSSX-L] splines in mixed models
Sent by:        
"SPSSX(r) Discussion" <[hidden email]>




 
hi all,

 
I have a model where I want to know the effect of age on the DV *within* 5 quintiles of age on time. The nature of the relationship of age with time in this study is that younger people don't slow down as much as older people, so entering age as a continuous varible doesn't make sense since this assumes a consistent association with time across all ages. The goal is to be able to say something like:

 
"In the youngest quintile, a one year increase in age was associated with a 0.25 hour increase in time whereas in the highest quintile, a one unit increase in age was asociated with a 1 hour increase in time."

 
 
This lead to a search to figure out how to compute splines with knots at the highest age of each of the age quintiles in my model.

 
I found this reference on Raynauld's site
http://www.spsstools.net/Syntax/RegressionRepeatedMeasure/PiecewiseRegression.txt. The example was a linear model with 2 knots, one at xA=15 and one at xA=25. You compute:
 
COMPUTE xb1=xa-15

COMPUTE xc1=xa-25.

recode xb1 xc1 (lo thru 0 =0).

 
once i ran frequencies on this, it made sense as to how i could enter these variables into the model and interpret them as i stated above.

 
 
It then states to enter them into linear regression by entering:

 
/Method = enter xa

/method= enter xb1

/method = enter xc1

 
My 2 questions:

 
1) Do you need to enter the original xa variable in the model with the spline variables and the other fixed variables? I can't quite understand why this is necessary.

2) I'm assuming the answer is YES, but i just want to check -  can i enter these spline variables into a mixed model and interpret them the same way?

 
 
thank you!

Carol

 
 
 
 
 
 
 
 
 
 
 
 
Reply | Threaded
Open this post in threaded view
|

Re: splines in mixed models

Jon K Peck

Jon Peck (no "h")
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621




From:        "Parise, Carol A." <[hidden email]>
To:        Jon K Peck/Chicago/IBM@IBMUS, "[hidden email]" <[hidden email]>
Date:        10/18/2011 02:05 PM
Subject:        RE: splines in mixed models




a couple of questions:
 
 
1) "Assuming that the recodes below are adjusted" do you mean for other variables in the model?
>>>The recode syntax below referred to xb1 and xc1 instead of the agexx variables.

2) bage + bage36 + bage46, where bage is the age regression coefficient, etc
 
lets say that the results looked like this:
 
coefficient centered age = .01 - NS
coefficient for age36 = .25 - sig
coefficient for age41 =  .10 = NS
coefficient for age46 = .09 = NS
coefficient for age51 = .03 = NS
 
if i were to compute predicted times, would the equation be the following:
 
pTime= intercept + .01(centered age)+ .25(age36)+ .10(age41)+ .09(age46) +.03(age51)
>>>yes, so the effect of adding 1 year for someone aged 42 would be .01+.25+.10.
thank you much!
Carol


From: SPSSX(r) Discussion [[hidden email]] On Behalf Of Jon K Peck
Sent:
Tuesday, October 18, 2011 12:32 PM
To:
[hidden email]
Subject:
Re: splines in mixed models


Assuming that the recodes below are adjusted, a 1-year age increase between 41 and 46 has an effect that is
bage + bage36 + bage46, where bage is the age regression coefficient, etc.  That, of course, does not tell you whether the age effect is statistically significant.


Jon Peck (no "h")
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621





From:        
"Parise, Carol A." <[hidden email]>
To:        
[hidden email]
Date:        
10/18/2011 12:57 PM
Subject:        
Re: [SPSSX-L] splines in mixed models
Sent by:        
"SPSSX(r) Discussion" <[hidden email]>




 

Gotcha. So if i were to compute the following variables:

 

COMPUTE age36=age-36
COMPUTE age41=age-41
COMPUTE age46=age-46
COMPUTE age51=age-51
recode xb1 xc1 (lo thru 0 =0).

 

...and enter all variables along with the centered age, would the coefficients be interpreted as I originally stated?:

 

"For people age 36 and younger,  a one year increase in age was not associated with decreased time, but  a one year increase in age between 42 and 46 was asociated with a 1 hour increase in time".

 

Thanks

Carol

 

 

 
 


From: Jon K Peck [mailto:peck@...]
Sent:
Monday, October 17, 2011 12:00 PM
To:
Parise, Carol A.
Cc:
[hidden email]
Subject:
Re: [SPSSX-L] splines in mixed models


In this parameterization, you need all three variables.  xa gives the linear effect, xb gives the first delta starting at 15, and xb gives the second delta starting at 25.  So above 25, the effect is the sum of all three coefficients, for example.


This, of course, is just a linear spine.  Often people prefer to use cubic splines, which give a smoother effect.


You could, of course, just use a functional transformation of the independent variable, for example, a cubic polynomial to get varying slopes.


Jon Peck (no "h")
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621





From:        
"Parise, Carol A." <[hidden email]>
To:        
[hidden email]
Date:        
10/17/2011 11:52 AM
Subject:        
[SPSSX-L] splines in mixed models
Sent by:        
"SPSSX(r) Discussion" <[hidden email]>





hi all,


I have a model where I want to know the effect of age on the DV *within* 5 quintiles of age on time. The nature of the relationship of age with time in this study is that younger people don't slow down as much as older people, so entering age as a continuous varible doesn't make sense since this assumes a consistent association with time across all ages. The goal is to be able to say something like:


"In the youngest quintile, a one year increase in age was associated with a 0.25 hour increase in time whereas in the highest quintile, a one unit increase in age was asociated with a 1 hour increase in time."



This lead to a search to figure out how to compute splines with knots at the highest age of each of the age quintiles in my model.


I found this reference on Raynauld's site
http://www.spsstools.net/Syntax/RegressionRepeatedMeasure/PiecewiseRegression.txt. The example was a linear model with 2 knots, one at xA=15 and one at xA=25. You compute:

COMPUTE xb1=xa-15

COMPUTE xc1=xa-25.

recode xb1 xc1 (lo thru 0 =0).


once i ran frequencies on this, it made sense as to how i could enter these variables into the model and interpret them as i stated above.



It then states to enter them into linear regression by entering:


/Method = enter xa

/method= enter xb1

/method = enter xc1


My 2 questions:


1) Do you need to enter the original xa variable in the model with the spline variables and the other fixed variables? I can't quite understand why this is necessary.

2) I'm assuming the answer is YES, but i just want to check -  can i enter these spline variables into a mixed model and interpret them the same way?



thank you!

Carol