BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SimoneStefano96
Fluorite | Level 6

Hello, 

I am wondering how to account for different weights in Multivariate models in PROC REG.

 

%MACRO WILKS(DS,Y1,Y2,regrvars);
proc reg data=&ds;
MOD1: model &y1=&regrvars/SPEC;
WEIGHT WEIGHT1;
MOD2: model &y2=&regrvars/SPEC;
WEIGHT WEIGHT2;
mtest;
run;
quit;
%MEND;

%WILKS(DS=VITAMINA,Y1=BMR,Y2=E_BMR,regrvars=WT CVIT);

PROC REG uses WEIGHT2 for weighting both models; instead, I would like to weight mod1 by WEIGHT1 and mod2 by WEIGHT2. How can I achieve this?

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

Since PROC REG allows only one set of weights, and you want different weights for different Y variables, you may be able to “pre-weight” the data before PROC REG sees it. (Or maybe not, I haven't tried this...)

 

From Wikipedia, the method is explained beginning with the sentence "When the errors are uncorrelated..."

--
Paige Miller

View solution in original post

4 REPLIES 4
PaigeMiller
Diamond | Level 26

The documentation for PROC REG is clear:

 

The BYFREQIDVAR, and WEIGHT statements are optionally specified once for the entire PROC step, and they must appear before the first RUN statement.

So you need to use PROC REG with WEIGHT1 and then another PROC REG with WEIGHT2.

 

Please change the subject of your original post to something that describes the actual question.

--
Paige Miller
SimoneStefano96
Fluorite | Level 6

Dear @PaigeMiller ,

thank you for your answer.

I would like to fit a multivariate WLS (bmr, e_bmr as dependent variables; wt, cvit as independent variable) accounting for the specific weights for each model (heteroschedasticity), so to test the overall significance of the model.

As I understand from your reply, it's not possible to do so in one PROC REG only.

Anyway, is there a way to do so, even using other PROCs?

I am a newbie in SAS and statistics, I would very much appreciate every kind of hint!

Kindly regards,

SimoneStefano96

PaigeMiller
Diamond | Level 26

Since PROC REG allows only one set of weights, and you want different weights for different Y variables, you may be able to “pre-weight” the data before PROC REG sees it. (Or maybe not, I haven't tried this...)

 

From Wikipedia, the method is explained beginning with the sentence "When the errors are uncorrelated..."

--
Paige Miller
SimoneStefano96
Fluorite | Level 6
Thanks, it would actually be a great solution.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 606 views
  • 1 like
  • 2 in conversation