Re: Follow-up to piecewise regression question

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

It sounds like you're now describing a model that has age categories, but not age as a continuous variable.  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.

HTH.

parisec 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:

http://www.ats.ucla.edu/stat/spss/faq/piecewise.htm

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]<mailto:[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]<mailto:[hidden email]>> wrote:
Hi all,

I posted a question last week about extending the information from these articles:

http://www.ats.ucla.edu/stat/spss/faq/piecewise.htm

http://www.spsstools.net/Syntax/RegressionRepeatedMeasure/PiecewiseRegression.txt

.....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      .
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).