I am confused by several things you said, but it sounds like you want to score the fitted model at 8 evenly-spaced points between 19.2 and 44.4. You can use the SCORE statement or use the STORE statement and PROC PLM, as follows:
data Patient1;
input Time Result;
datalines;
0 7.17
3 5.98
6 7.31
12 73.87
18 80.92
30 39.11
36 37.93
42 33.3
48 35.2
78 33.26
;
ods select ANOVA ParameterEstimates SplineKnots TPFSplineDetails;
ods output ParameterEstimates=param SplineKnots=spline ;
proc glmselect data=patient1;
effect spl = spline( time/ details naturalcubic basis=tpf(noint)
knotmethod=percentiles(5) );
model result = spl / selection=none ; /* fit model by using spline effects */
output out=SplineOut predicted=fit ; /* output predicted values for graphing */
store out=MyModel;
quit;
data ScoreData;
startT = 19.2;
endT = 44.4;
N = 8;
dt = (endT - startT) / (N-1);
do Time = startT to endT by dt;
output;
end;
keep Time;
run;
proc plm restore=MyModel;
score data=ScoreData out=ScoreResults;
run;
proc sgplot data=ScoreResults;
series x=Time y=Predicted; /* do you want the fitted curve? */
run;
proc sgplot data=ScoreResults;
reg x=Time y=Predicted; /* you said something about a slope? */
run;
What is unclear is the sentence " do a regression on those 8 data points to find a slope." Perhaps the hint above will provide the points that you need for the regression? You can use PROC REG to get the regression estimates, including the slope. If that's not what you want, then please explain further.
... View more