To know the power or ... is the question [Software]

posted by d_labes  – Berlin, Germany, 2009-01-28 14:53 (6355 d 18:40 ago) – Posting: # 3154
Views: 6,587

Dear Pavan,

❝ *** Simple Regression ***;

❝ options pageno=1;

❝ proc reg data=Work.Sas;

❝ model Y = B;

❝ run; quit;

❝ note: B=1/x2


Now my questions are,

❝ 1) Why my SAS R2 values are different compared to the Analyst R2 values?

❝ 2) Is there any mistake in my calculation?


Answer to question 2: Not any, many!
Answer to question 1: see answer to question 2.

Hint: If you can analyze your data correctly within the 'ANALYST' application in SAS have a look at the code generated by it. It is shown below the analysis results. The emphasis lies on correctly! So use test data with known results.

To shorten the process of repeated Q&A here in this forum, which is not a SAS forum:
Steps to follow
1. Prepare a dataset with your y and x data.
2. Define an additional variable with the x value squared (f.i. x2=x*x;)
3. Define variables with your weights (f.i. w1=1/x; w2=1/(x*x);)
4. Code: *linear model
Proc reg data=yourdata;
  model y=x;
  weight w1; *if weighted by 1/x
run;quit;
*quadratic model
Proc reg data=yourdata;
  model y=x x2;
  weight w2; *if weighted by 1/x2
run;quit;


BTW: I strongly recommend that you attend a basic SAS course or buy a beginners SAS book! Ok, both are not cheap. So have a look at preceedings of SAS User conferences found here with many beginners lessions.

BTW2: For the other members of this forum interested in coding: See the elegant and intuitive way in doing polynomial regression in SAS. In another piece of this great software Proc GLM the same model is written
model y=x x*x; Sic!
It is a programming language of the 4th generation :-P !

Regards,

Detlew

Complete thread:

UA Flag
Activity
 Admin contact
23,655 posts in 4,993 threads, 1,571 registered users;
126 visitors (0 registered, 126 guests [including 13 identified bots]).
Forum time: 10:34 CEST (Europe/Vienna)

Scientists often have a naïve faith that
if only they could discover enough facts about a problem,
these facts would somehow arrange themselves
in a compelling and true solution.    Theodosius Dobzhansky

The Bioequivalence and Bioavailability Forum is hosted by
BEBAC Ing. Helmut Schütz
HTML5