```Date: Thu, 11 Jul 1996 20:46:30 GMT Reply-To: Dean Nelson Sender: "SAS(r) Discussion" From: Dean Nelson Organization: UW-Madison Subject: Re: trying to get R-squared to 9 decimal places In article <4rs8e2\$p8m@news.wco.com>, doliov@wco.com says... > >Dean Nelson (denelson@facstaff.wisc.edu) wrote: >:Does anyone know how to get R-squared from an OLS model to 9 decimal places? >: >your post piqued my interest. just as a matter of curiosity, why would >you want the ninth decimal place of an R-square value? Evidently, the student with the problem will be calculating some statistic based on the value of rsquare, and part of the calculation involves either dividing or multiplying by 280,000, I forget which. Another problem has cropped up in this solution. The model he is using has 68 independent variables. PROC RSQUARE generates all possible regressions... (pause)...I think you are beginning to see the problem. Anyway, I tried to go back to the documentation and found that the procedure isn't documented, at least not in the latest manuals (I just happened to be thumbing through a version 5 manual when I first came across it). After trying to track down what happened to it, I finally decided to go back to PROC REG and see if I could get what I needed there. Here is my quick and dirty solution: libname dir 'c:\public'; proc reg data=dir.health; model weight=age height; output out=reg r=resids; proc means data=dir.health noprint; var weight; output out=wmean var=totvar; proc means data=reg noprint; var resids; output out=rmean var=resvar; data _null_; merge wmean rmean; rsquare=1-(resvar/totvar); put rsquare 12.9; run; Dean ```

Back to: Top of message | Previous page | Main SAS-L page