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=®rvars/SPEC; WEIGHT WEIGHT1; MOD2: model &y2=®rvars/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?
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..."
The documentation for PROC REG is clear:
The BY, FREQ, ID, VAR, 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.
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
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..."
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!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.