I'm hoping someone can answer a question regarding computing terms for piecewise regression.
I want to enter age groups into a regression model but have the coefficient represent the increase in odds of an event for every 1 year increase in age within the following age groups:
17-36
37-41
42-46
47-51
51+
I used these examples in these articles
to compute knots at ages 36, 41, 46, and 51:
v36 = age-36
v41 = age-41
v46 = age -46
v51= age-51
recode v36 to v51 (lo thru 0=0).
so for v41:- someone age 42=1 and someone age 43=2 etc...so this part accomplishs what i need to.
the coefficient for v36 represents the increased log odds for a 1 year increase in age up to age 36; v41 for up to age 41, etc. what i am not sure if it accomplishing is constraining the values within an age group. For example the coefficient for v41 isn't
the increased log odds between 37 and 41 but for UP to age 41.
My question is how to i modify this to create terms that put a limit on the upper end of the age group?
Thanks all
Carol