Re: Follow-up to piecewise regression question

Posted by Ryan on
URL: http://spssx-discussion.165.s1.nabble.com/Follow-up-to-piecewise-regression-question-tp5668949p5677259.html

Carol,
 
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".

Ryan
On 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 question

For 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.
 
Ryan
On 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 -1
 
The code provided above is untested, but I'm fairly certain it will do as I suggest.
 
Ryan
 
On 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 .