SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
afgdurrani0
Pyrite | Level 9

R^2 is unfortunately not a part of the output from the nonlinear regression (e.g. below) in the newer versions of SAS. But I need the adjusted r2 value or simple r2 (coefficient of determination) for my research manuscript. Please kindly modify my below proc programming that could also estimate the R2. Many thanks

Here is the complete data, please use it if you want

data large;

input sow stw time;

datalines;

4 3.366 3

4 3.052 6

4 2.666 9

4 2.755 12

4 2.203 15

4 1.886 18

3.982 1.525 21

3.882 1.547 24

3.393 0.81 27

3.586 0.76 30

2.295 0.27 33

3.475 0.67 36

;

proc nlin data=large method=marquardt;

parms B=0.5 R=0.1;

delta=0.000001;

s=sow**(1-B)-R*(1-B)*time;

if s>0 then stx=s**(1/(1-B));

else stx=0;

model stw=stx;

sb=(sow**(1-B+delta)-R*(1-B+delta)*time);

if sb>0 then sdb=(stx-sb**(1/(1-B+delta)))/delta;

else sdb=0;

der.B=sdb;

sr=(sow**(1-B)-(R-delta)*(1-B)*time);

if sr>0 then sdr=(stx-sr**(1/(1-B)))/delta;

else sdr=0;

der.R=sdr;

output out=largep p=pstw;

run;

1 REPLY 1
Rick_SAS
SAS Super FREQ

It is helpful to those trying to help if you choose a single community to post questions to. This appears to be a duplicate of https://communities.sas.com/thread/86895 For this topic, I think the Statistical Procedures Community is your best resource.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 594 views
  • 1 like
  • 2 in conversation