Re: Follow-up to piecewise regression question

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

Hi doug

Age is linear but it changes by age group. My study is regarding ultra distance running times taking age into account in addition to some other variables. So i'm not actually using logistic regression as previously stated regarding the coefficient, but i'm using linear regression.

What happens is that up to say age 38 or so, increasing age can lead to faster times. After age 40 or so, the opposite is true, and after 51 or so, people get even slower with increasing age. I could stratifiy age into smaller age categories and enter as dummy variables but i loose some sensitivity.

My thought on using piecewise regression here is that i want to show the effect of age on finish times. However if i enter it as a single variable, the coefficient will not accurately reflect the association of age on time since the coefficient will likely show that there is a x decrease in time (people get faster) over the entire range of ages. With piecewise regression, i can enter age in as 3 variables: 1) <38; 2) 38-50; and 3) 51+/ and get 3 coefficients that reflect the change in time for every 1 year increase in age within the age group.

The question i'm trying to get answered is whether or not the variable below is the correct way to compute the  3 categories that i have. The articles i refer to only show examples for 2 knots; above and below a specific value. I'm just not sure how to handle the a 3rd knot.

Thanks!
Carol
________________________________
From: Doug [[hidden email]]
Sent: Sunday, April 29, 2012 5:00 AM
To: Parise, Carol A.
Subject: Re: Follow-up to piecewise regression question

If age is not linear, I don't understand why you would run linear models. Sorry I can't help further, other than to suggest a linearizing transformation.

On Thu, Apr 26, 2012 at 11:41 PM, Parise, Carol A. <[hidden email]<mailto:[hidden email]>> wrote:
Hi Doug,

Thanks for the response. I am running linear mixed models. The issue is that i know that age is not linear for all ranges of age which is why i want to use piecewise regression.

What i am trying to do is have a term in the model that reflects an increase in the log odds of the event for every 1 year increase in age between that age group.

Do you know if the example i included below is correct for this?
________________________________
From: Doug [[hidden email]<mailto:[hidden email]>]
Sent: Thursday, April 26, 2012 5:07 PM
To: Parise, Carol A.
Subject: Re: Follow-up to piecewise regression question

I missed your first post, but depending on what your data look like, it might be useful to think about using a logistic model if there's a fairly smooth transition from 38-50 with an asympote at older ages. I did something similar to estimate "growth rate" for a multispecies community to identify an inflection point.

On Thu, Apr 26, 2012 at 8:00 PM, Parise, Carol A. <[hidden email]<mailto:[hidden email]><mailto:[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      .

=====================
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