BookmarkSubscribeRSS Feed
Sean_OConnor
Fluorite | Level 6

Folks,

 

I'm new to regression analysis in SAS. Before I would have done all my economteric modelling using Stata.

 

I would like to run an OLS regression model where my independent variables are both continous and categorical.

 

My model is;

depen = age agesq sex pes region

 

where age and agesq are continous variables and region pes and sex are catergorical 

I provide a sample of my data for ease of interpreation.

 

Any help is most welcome on how to run a model with two different types of variables 

 

 

regionagePESSexDepenagesq
76011-0.00811120
72732-0.0020554
55831-0.00786116
748310.02210896
743320.08924386
13932.78
123320.16181846
117110.17099134
755110.002723110
161210.00234122
74121-0.0021882
245210.02071890
340210.03278580
33021.60
73112-0.0082662
448120.08927296
421210.09714942
34811-0.0208296
32212-0.0101944
318220.01882936
436220.02278572
239210.01014778
43611-0.073372
23312-0.0003166
43312-0.0006966
3 REPLIES 3
Miracle
Barite | Level 11

This will be helpful Introduction to Regression Procedures

Either proc reg or proc glm will do but dummy variables of your categorical variables are to be used in proc reg unlike proc glm where you just specify your categorical variables in the class statement.

And proc reg has more regression model diagnostics features.

art297
Opal | Level 21

@Miracle already provided your two choices and the differences between them. However, you will first want to correct your agesq variable as it is currently 2*age rather than age**2

 

Art, CEO, AnalystFinder.com

 

stat_sas
Ammonite | Level 13

Hi,

 

Also, why are you including 2*age as a predeictor in the model. This will introduce multicollinearity in the model resutling non unique solutions.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1528 views
  • 0 likes
  • 4 in conversation