0
votes

SAS Fit a regression model for prediction of ‘mpg’ by the other five variables. Report the variation inflation factors and explain.

Here is the code for reading in the file:

DATA mpg;
    INFILE '/home/u42258867/sasuser.v94/auto-mpg.data.txt';
    INPUT n1-n6;
run;

mpg is n1, thus I need to make a regression model to predict n1 by n2-n6 and I'm not sure how to do this.

1
Please tell us what you have tried to get both a regression model and VIF.Stu Sztukowski
@StuSztukowski I've tried using proc reg for n1 = n2 and repeating this method every time for n3 n4 n5 and n6 but I don't thinl that is the output I'm supposed to getHannah
Are you trying to fit a multiple linear regression of the form "n1 = (a * n2) + (b * n3) + (c * n4) + (d * n5) + (e * n6) + offset"?James Phillips
If all variables are numeric, I would recommend looking into proc reg. For increased functionality look into proc glmselect.J_Lard

1 Answers

0
votes

To make a simple linear regression and get VIF:

proc reg data=mpg;
    model n1 = n2 n3 n4 n5 n6 / vif;
run;

Turn on ods graphics for additional output if you're using the oldschool editor. If you're using Enterprise Guide or SAS Studio then graphics will already be available.