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

Hi guys,

I have a muiltiple regression model with 2 dummy variables.  The qualitative variables in my data looks like this:

BroadSector
10
10
00
01
00

Each observation can belong to either the Broad category, Sector category, or neither.  This would require me to have 2 dummy variables.  How can I add these dummies to my model which looks like this so far:

PROC REG data=GH3 outest=est;

by symbol;

model ADV = Volume Volatility MarketCap;

(need to add my dummies to this model)

run;

quit;

data FINAL;
set est;
format Volume Volatility MarketCap e15.;
run;


proc print data = FINAL;
run;
quit;

-------------

Thanks in advance,

Razzle

1 ACCEPTED SOLUTION

Accepted Solutions
DBailey
Lapis Lazuli | Level 10

I think that most of the dummy variables are added to the input dataset.  If you don't want to recreate the data, you can create a view which has the dummy variables in it.

proc sql;

create view work.gh3_view as

select

t1.*

,case when t1.category='Broad' then 1 else 0 end as Broad

,case when t1.category='Sector' then 1 else 0 end as Sector

from work.gh3;

quit;

and then use that as the input data to your proc.

View solution in original post

2 REPLIES 2
DBailey
Lapis Lazuli | Level 10

I think that most of the dummy variables are added to the input dataset.  If you don't want to recreate the data, you can create a view which has the dummy variables in it.

proc sql;

create view work.gh3_view as

select

t1.*

,case when t1.category='Broad' then 1 else 0 end as Broad

,case when t1.category='Sector' then 1 else 0 end as Sector

from work.gh3;

quit;

and then use that as the input data to your proc.

RazzleBayker
Calcite | Level 5

Thanks a lot.

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1756 views
  • 0 likes
  • 2 in conversation