Hello,
I don't really see the difference between those two statements :
proc reg data=Have;
model y= x1-x4;
run;
and
proc reg data=Have;
model y= x1 x2 x3 x4;
run;
Any answer ?
Thanks 🙂
As long as the variables appear in one of these orders in the dataset:
the statements are equal.
I stumbled upon a multiple choice question on the internet.
Question is :
Identify the correct sas program for fitting a MLR model with dependent variable y and four predictor variables (x1-x4)/
The propositions are :
I don't quite see why answer D is not a correct answer as well as A.
Because SOLUTION is not a valid option for the MODEL Statement.
Maxim 1: Read the Documentation.
You could have run the code yourself and found out that D doesn't work. Or looked in the documentation.
A is not wrong, it should give the same answers as B, but unnecessary to use a VAR statement in this situation.
To add to @PaigeMiller explanation, all variables named in the MODEL statement of proc REG are assumed to be numeric. The VAR statement, so often required in other procedures to distinguish numeric from categorical, isn't required. But proc reg can be used to fit many models interactively, it will compute results after every MODEL statement, not knowing yet if more models are to come. The VAR statement tells the procedure about all the variables that you may consider further along in your models. Knowing that, the procedure only needs to read your data once to accumulate all the required sums of crossproducts.
What differences do you see?
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Lock in the best rate now before the price increases on April 1.
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.