# Linear piecewise spline interpretation

#### tsalek

##### New Member
Hello,

I suspected my data was non-linear so I ran PROC GAM to visualize my age variable relative to my binomial outcome. I realize adding one spline knot at age 51.5 was very appropriate. I created the linear piecewise spline using a "relative reference" coding scheme:

if age<=51.5 then age515=0;
else age515=age-51.5;

Next I ran a log binomial regressionPROC GENMOD; dist=bin, link=log) as my outcome variable is very prevalence (>60%). I have the outputs that give me the prevalence ratios for the first regression line up to age <=51.5; how do I get the prevalence ratios for the second regression line >51.5? I have one class variable (four levels) and one continuous variable

From the output:
Analysis Of Maximum Likelihood Parameter Estimates
Parameter Beta
Intercept -2.3315
Age (contin) 0.0328
Var (level 4) 0.6515
Var (level 2) 0.6509
Var (level 3) 0.6515
Var (level 1) 0.0000

Thanks

#### hlsmith

##### Less is more. Stay pure. Stay poor.
I have not done these procedures myself, so I am not much help in that regard. But I know there are some macros (spline), that address visualizing this process and provide the odds ratios for all values above and below the compared reference group.

#### tsalek

##### New Member
Let me rephrase the question:

The age continuous term has two separate betas, a ratio estimate before the spline knot (eg 1.0333 per 1 year increase), and a beta/ ratio estimate after the spline knot (eg PR=0.9844 per 1 year increase).

Say if I include a CLASS variable "monthsexchangingquartiles" that has 4 levels, SAS tells me the ratios are static (the same) before and after the spline knot. Am I suppose to get the same ratios before and after a linear piecewise spline with one knot? Or am I suppose to expect separate ratios for the CLASS term after the spline knot?