Just to follow up on my previous remark about an alternative approach based on derivatives: This can be easily done using the Margins macro (as I mentioned earlier) but that macro uses GENMOD to fit the model and does not accommodate splines. Since GENMOD doesn't fit random effects models, a GEE model is used. So, the statements below fit higher-order (cubic in this case) curves over PROGRESS for each IV level. Note that using the name PROGRESS results in the higher-order effect names being too long, so a copy of PROGRESS is created named P to be used instead.
The Margins macro fits the GEE model as specified and computes the marginal effect (the derivative of DV with respect to PROGRESS) at each of four values of PROGRESS. These are in the output section labeled "P Average Marginal Effects." Note that these are the slopes of lines drawn tangent to the fitted curves at each of those four values. It also estimates the difference in the slopes at each of the four points. These are in the output section labeled "Differences Of P Average Marginal Effects." Tests and confidence intervals are provide for the individual slopes and differences. The "IV2 Predictive Margins" and "Differences Of IV2 Margins" sections might not be of as much interest, but these provide the estimated means on each curve at each of the four points and the differences at each point.
data atdat;
do p=0,0.5,1,1.5; output; end;
run;
%margins(data=b, class=id iv2, response=dv,
model=iv2|p|p|p, geesubject=id,
margins=iv2, effect=p,
at=p, atdata=atdat, diff=all, options=cl)
You can fit the same model as fit by the Margins macro and plot the fitted curves as below. The fitted curves are not too different from the spline models.
proc genmod;
class id iv2;
model DV = iv2|progress|progress|progress;
repeated subject=id;
effectplot slicefit(x=progress sliceby=iv2);
run;
... View more