Hi guys,
I have a muiltiple regression model with 2 dummy variables. The qualitative variables in my data looks like this:
Broad | Sector |
---|---|
1 | 0 |
1 | 0 |
0 | 0 |
0 | 1 |
0 | 0 |
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
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.
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.
Thanks a lot.
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.
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.