* This is file PRESSURE.SAS ; options noovp; title 'Baroreceptor contol of blood pressure--nonlinear regresssion'; * Normal data set (Data in Table C-20) ; DATA normal; infile presnorm; input N P; * Hypertensive data set (Data in Table C-21) ; DATA hyper; infile preshypr; input N P; * Fit simple, MIN, MAX parameterization to normal data ; proc NLIN data=normal METHOD=MARQUARDT; parameters Nmax=90 Nmin=5 C=4 D=-.1; model N=Nmax-(Nmax-Nmin)/(1+exp(-(C+D*P))); X=exp(-(C+D*P)); DER.Nmax=1-1/(1+X); DER.Nmin=1/(1+X); DER.C=-(Nmax-Nmin)*X/(1+X)**2; DER.D=P*DER.C; output OUT=Plot1 PREDICTED=Nhat RESIDUAL=resid STUDENT=stdres H=hat; proc PLOT data=Plot1; plot N*P='O' Nhat*P='P' / OVERLAY VPOS=25; plot resid*P / VREF=0 VPOS=25; plot resid*Nhat / VREF=0 VPOS=25; proc PRINT data=Plot1; var N Nhat resid stdres hat; * Fit simple, MIN, MAX parameterization to hypertensive data ; proc NLIN data=hyper METHOD=MARQUARDT; parameters Nmax=70 Nmin=5 C=4 D=-.1; model N=Nmax-(Nmax-Nmin)/(1+exp(-(C+D*P))); X=exp(-(C+D*P)); DER.Nmax=1-1/(1+X); DER.Nmin=1/(1+X); DER.C=-(Nmax-Nmin)*X/(1+X)**2; DER.D=P*DER.C; output OUT=Plot2 PREDICTED=Nhat RESIDUAL=resid STUDENT=stdres H=hat; proc PLOT data=Plot2; plot N*P='O' Nhat*P='P' / OVERLAY VPOS=25; plot resid*P / VREF=0 VPOS=25; plot resid*Nhat / VREF=0 VPOS=25; proc PRINT data=Plot2; var N Nhat resid stdres hat; * Fit alternative parameterization to normal data ; proc NLIN data=normal METHOD=MARQUARDT; parameters Nmin=0 Nmax=90 Phalf=100 s=1.5; model N=Nmin+(Nmax-Nmin)/(1+exp(4*s*(Phalf-P)/(Nmax-Nmin))); DeltaN=Nmax-Nmin; DeltaP=Phalf-P; X = exp(4*s*DeltaP/DeltaN); X1=1+X; *NOTE The following line is in error in the book; DER.Nmax=(X1+X*4*s*DeltaP/DeltaN)/X1**2; DER.Nmin=1-(X1+X*4*s*DeltaP/DeltaN)/X1**2; DER.Phalf=-X*4*s/X1**2; DER.s=-X*4*DeltaP/X1**2; output OUT=Plot3 PREDICTED=Nhat RESIDUAL=resid STUDENT=stdres H=hat; proc PLOT data=Plot3; plot N*P='O' Nhat*P='P' / OVERLAY VPOS=25; plot resid*P / VREF=0 VPOS=25; plot resid*Nhat / VREF=0 VPOS=25; proc PRINT data=Plot3; var N Nhat resid stdres hat; * Fit alternative parameterization to hypertensive data ; proc NLIN data=hyper METHOD=MARQUARDT; parameters Nmin=0 Nmax=70 Phalf=100 s=1.5; model N=Nmin+(Nmax-Nmin)/(1+exp(4*s*(Phalf-P)/(Nmax-Nmin))); DeltaN=Nmax-Nmin; DeltaP=Phalf-P; X = exp(4*s*DeltaP/DeltaN); X1=1+X; *NOTE The following line is in error in the book; DER.Nmax=(X1+X*4*s*DeltaP/DeltaN)/X1**2; DER.Nmin=1-(X1+X*4*s*DeltaP/DeltaN)/X1**2; DER.Phalf=-X*4*s/X1**2; DER.s=-X*4*DeltaP/X1**2; output OUT=Plot4 PREDICTED=Nhat RESIDUAL=resid STUDENT=stdres H=hat; proc PLOT data=Plot4; plot N*P='O' Nhat*P='P' / OVERLAY VPOS=25; plot resid*P / VREF=0 VPOS=25; plot resid*Nhat / VREF=0 VPOS=25; proc PRINT data=Plot4; var N Nhat resid stdres hat;