Carol,
It looks like you set up the model correctly, and that your interpretation of the slopes is correct. However, I don't see why you centered age at the grand mean. In addition to assessing for shifts in slopes from one age group to the next, isn't the purpose of piecewise regression to see if there is a shift in intercepts at the cutpoints? With that in mind, I would suggest that you NOT center age at any value before running the analysis. I repeat...I think you should enter age into the model in its original form. Then you can easily estimate and compare the intercepts at the appropriate age cutpoint for adjacent age groups using TEST statements. Concretely...
According to your post, your cutpoints are 38 and 51. Therefore, I think you would want to estimate the intercepts at age=38 for age groups 1 and 2, and test whether they are significantly different from each other. How do you do this? Simple! Add the following TEST statements:
/TEST = "int for grp 1 at age 38" group 1 0 0 group*age 38 0 0
/TEST = "int for grp 2 at age 38" group 0 1 0 group*age 0 38 0
/TEST = "diff in ints between grps 1 and 2 at age 38" group 1 -1 0 group*age 38 -38 0
If you want to do the same for age groups 2 and 3, then you'd write the following TEST statements:
/TEST = "int for grp 2 at age 51" group 0 1 0 group*age 0 51 0
/TEST = "int for grp 3 at age 51" group 0 0 1 group*age 0 0 51
/TEST = "diff in ints between grps 2 and 3 at age 51" group 0 1 -1 group*age 0 51 -51
The full MIXED code, including the above intercept TEST statements **AND** slope TEST statements would look like this:
MIXED y BY group WITH age
/FIXED=group group*age | NOINT SSTYPE(3)
/METHOD=REML
/PRINT=SOLUTION
/TEST = "int for grp 1 at age 38" group 1 0 0 group*age 38 0 0
/TEST = "int for grp 2 at age 38" group 0 1 0 group*age 0 38 0
/TEST = "diff in ints between grps 1 and 2 at age 38" group 1 -1 0 group*age 38 -38 0
/TEST = "int for grp 2 at age 51" group 0 1 0 group*age 0 51 0
/TEST = "int for grp 3 at age 51" group 0 0 1 group*age 0 0 51
/TEST = "diff in ints between grps 2 and 3 at age 51" group 0 1 -1 group*age 0 51 -51
/TEST = "grp 1 slope" group*age 1 0 0
/TEST = "grp 2 slope" group*age 0 1 0
/TEST = "grp 3 slope" group*age 0 0 1
/TEST = "diff in slopes between grp 1 and grp 2" group*age 1 -1 0
/TEST = "diff in slopes between grp 2 and grp 3" group*age 0 1 -1.
A few points:
(1) The group-specific slopes estimated from the TEST statements should equal the group*age interaction coefficients reported in the "Estimates of Fixed Effects" Table.
(2) The code above is UNTESTED. I'm too busy right now to test the code above.
(3) I am no expert in piecewise regression. I'm simply extrapolating from the two-category example provided on that website.
HTH,
Ryan
On Tue, May 1, 2012 at 7:48 PM, Parise, Carol A. <[hidden email]> wrote:
Ryan,This nailed it. When Bruce stated....****************************************If I followed, however, Ryan's model (see syntax below) included age as *both* a categorical variable (called Group) and a continuous variable (age). The interaction of those two variables (group*age) is what allows the slope for continuous age to vary by age group. That's more or less the same thing you're trying to accomplish by using piece-wise regression, right?MIXED y BY group WITH age
/FIXED=group group*age | NOINT SSTYPE(3)
/METHOD=REML
/PRINT=SOLUTION.
***************************************************The lightbulb went on and i figured out why this made sense.I went back and reran my analysis and I think what I pasted below gives me exactly what i need. i'm including the interpretation because in case i'm wrong, i am hoping someone can point it out. If it's correct, i suspect someone may find it useful.
Estimates of Fixed Effectsa
Parameter
Estimate
[age3=1.00]
25.723006
[age3=2.00]
26.830893
[age3=3.00]
27.558274
[age3=1.00] * AllCenAge
.029302
[age3=2.00] * AllCenAge
.198141
[age3=3.00] * AllCenAge
.079184
a. Dependent Variable: timehrs.
age3= group (1=<38, 2=38-50, 3=51+)allcenage = centered continous ageMy interpreation:the mean finsh time for people:<38 is 25.75 hrs38-50 = 26.83 hrs51+ = 27.56 hrsFor every 1 year increase in age up to age 38, finish time increases by .03 hours [age3=1.00] * AllCenAge, for people between 38-50 years old, finish time increases by .19 hrs for every 1 year increase in age [age3=2.00] * AllCenAge, and there is only a .08 increase per year in finish time for people age 51+. [age3=3.00] * AllCenAgeThanks Ryan, Bruce, and Jon for your time.Carol.
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of R BSent: Monday, April 30, 2012 5:59 PMCarol,I'm not sure I fully understand your follow-up question. Here's the bottom line. The model I presented is essentially identical to the piece-wise regression on that website. What's very convenient about using the approach I suggested via the MIXED procedure is that you need not worry about manipulating "age" whatsoever. All you need to do is create the "age" grouping variable (a.k.a. "group" in my code), and then parameterize the model as I demonstrated previously. Furthermore, I see no reason the approach I recommended cannot be used for situations in which you categorize "age" into more than two groups.Correctly coded TEST statements will answer most, if not all of your questions. That is, you can use TEST statements to estimate group-specific slopes as well as group-specific intercepts at particular values of "age" (e.g., setting "age" at a cut point). You can also test for differences between "age" groups with respect to their slopes as well as differences between "age" groups with respect to their intercepts at particular values of "age".
RyanOn Mon, Apr 30, 2012 at 4:34 PM, Parise, Carol A. <[hidden email]> wrote:
Ryan,Thanks for your thoughtful response.This is interesting and makes me wonder if i'm making this harder than it needs to be. My original plan was indicator coding with 5 smaller age groups i.e. quintiles of age.I was thinking that by using indicator coding and using highest quintile of age as the reference category, that the coefficient would represent the change in finish time for anyone in say the lowest quintile compared with anyone in the highest quintile.my goal is to have the coefficient represent the change in finish time for every 1 year increase in age within the specified age groups which is why i thought i needed piecewise. When i started working on piecewise with my 5 groups, i quickly discovered that there wasn't much variation an age group that was inclusive of only 5 years or so. Therefore, i came up with 3 cutpoints that i think make sense based on the graphs and correlations of the data.Based on your experiment with the data on the site, it makes me think i can achieve what i want with my original plan which makes me wonder when WOULD be the reason to use piecewise regression versus indicator coding?Carol
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of R B
Sent: Monday, April 30, 2012 11:20 AM
To: [hidden email]
Subject: Re: Follow-up to piecewise regression questionFor those interested, I decided to apply the approach I suggested below to the data provided in one of the websites Carol sent us the link for:I found that the slopes were identical. Moreover, after centering age at 14, the intercepts fell in line as well. As I think about it, the parameterization I proposed is essentially identical to the piecewise regression model reported on that website.RyanOn Sun, Apr 29, 2012 at 9:13 PM, R B <[hidden email]> wrote:
Carol,It seems to me that a simple approach to allow for varying slopes would be to create an indicator variable of the age groups of interest (e.g., 0 thru <{a} = 1, {a} thru <{b} = 2, >= {b} = 3), and then to parameterize the model as follows:
MIXED y BY group WITH age/FIXED=group group*age | NOINT SSTYPE(3)
/METHOD=REML
/PRINT=SOLUTION.The model above assumes that age has a linear relationship with the dependent variable that varies depending on the age group. The estimated group-specifc slopes (group*age interaction effects) are provided in the "Estimates of Fixed Effects" Table. If you wanted to test whether the group-specific slopes were significantly different from each other, you could add the following TEST statements:/TEST = "diff in slopes between grp 1 and grp 2" group*age 1 -1 0/TEST = "diff in slopes between grp 1 and grp 3" group*age 1 0 -1/TEST = "diff in slopes between grp 2 and grp 3" group*age 0 1 -1The code provided above is untested, but I'm fairly certain it will do as I suggest.RyanOn Thu, Apr 26, 2012 at 8:00 PM, Parise, Carol A. <[hidden email]> wrote:
Hi all,I posted a question last week about extending the information from these articles:.....to accomodate having the coefficient represent the increase in odds of an event for every 1 year increase in age within an age group.The examples in these articles demonstrate how to compute this when you want to split a group into above or below a single value such as <14 and 14+. I think that to have multiple groups, i need to constrain the age group so that the lower limit of the age group is 0 and each year in age within the age group increases by 1. The end result is that the number of cases in the new age matches the number of cases in the 38-50 age group.With this in mind, i computed below what I think is the correct new variable to enter in a piecewise regression for a 38-50 age group.However, I cannot find an example that validates or invaldates this idea.Thanks for any references or information you may have.Carol
age piecewise age 38-50 27 . 28 . 29 . 30 . 31 . 32 . 33 . 34 . 35 . 36 . 37 . 38 0 39 1 40 2 41 3 42 4 43 5 44 6 45 7 46 8 47 9 48 10 49 11 50 12 51 . 52 . 53 . 54 . 55 . 56 . 57 .
| Free forum by Nabble | Edit this page |