08-29-2015 11:59 AM
Thanksfor modifying my program that now can produce R^2 too. But I have asked a question many time from PaigeMiller but he (I think he is not receiving the notification) is not answering to my question. Please PaigeMiller answer to my question that the R^2 that is produced with this modification is adjusted R^2 or coefficient of determination (R^2).
input sow stw time;
4 3.366 3
4 3.052 6
4 2.666 9
4 2.755 12
4 2.203 15
4 1.886 18
proc nlin data=large method=marquardt;
parms B=0.5 R=0.1;
if s>0 then stx=s**(1/(1-B));
if sb>0 then sdb=(stx-sb**(1/(1-B+delta)))/delta;
if sr>0 then sdr=(stx-sr**(1/(1-B)))/delta;
output out=largep p=pstw;
output out=smallp p=pstw;
output out=smallp p=pstw r=stw_residual;
Then, this ought to work (untested code)
proc summary data=smallp;
var stw_residual stw;
output out=stats css(stw)=sstot uss(stw_residual)=ssres;
08-29-2015 02:28 PM
Its the weekend. He may be on vacation or at the lake but is in no way obligated to answer your question anyways. According to Wikipedia's definition it appears to be the r-squared value.
08-29-2015 02:47 PM
it is clear that the r^2 which produced through this modification is simple r^2. Can you please modify it more with this for adjusted r^2. I need to write adjusted r^2 in my research paper.
Adjusted R2 can be calculated as 1-[(1-R2)(n-1)(n-k-1)-1]
where n is the number of data points and k is the number of regressors (parameters in your cases)
- and you already now are able to calculate R2.