12-07-2017 09:11 AM
I need to run a linear regression with two categorical variables with 3 plus levels and one continuous variable on a continuous response variable, and is Thus using proc GLM.
- product=(agriculture, rental, industry)
- customer_segment=(key, focus, corporate)
Is it possible to run the following regression, and if so how do you specify the interaction terms:
Proc GLM data=model1_data2 alpha=0.75;
class product customer_segment;
model price=rating product customer_segment industry*rating industry*key / solution;
output out=model1_v2_out r=res p=benchmark2 lcl=Q25 ucl=Q75;
So my issue is that i don't know how to specify interaction terms only involving specific levels of the categorical variable.
Hopes this makes sence.
I'm using SAS 9.4
12-07-2017 09:51 AM
Many procedures output coded variables. You can then process the output data set to drop terms. Personally, I like transreg because 1) I wrote it, 2) it has nice names and labels for terms, and 3) it outputs a macro variable with all of the terms in the model.