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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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