Include all regressors in model statement?

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

Include all regressors in model statement?

I am trying to fit a regression model with many independent variables (all of which have long variable names).  Is there a way, rather than typing

model Y = X1 X2 X3 ... Xn

to use every variable that is not the dependent as an independent?

I (apocryphally?) recall from grad school something of the form

model Y = ~

Your help is much appreciated!


Accepted Solutions
Solution
‎03-26-2013 11:57 AM
Respected Advisor
Posts: 4,920

Re: Include all regressors in model statement?

Posted in reply to dr_awkward

If you arrange your variables such that Y is the first or last in the dataset variable list then you can use something like MODEL Y = X1 -- Xn; The double dash meaning from X1 to Xn in the variable list.

PG

PG

View solution in original post


All Replies
Respected Advisor
Posts: 3,799

Re: Include all regressors in model statement?

Posted in reply to dr_awkward

PROC REG supports name range lists.

proc reg data=sashelp.heart;
   model ageatdeath = status-numeric-smoking;
   run;
Solution
‎03-26-2013 11:57 AM
Respected Advisor
Posts: 4,920

Re: Include all regressors in model statement?

Posted in reply to dr_awkward

If you arrange your variables such that Y is the first or last in the dataset variable list then you can use something like MODEL Y = X1 -- Xn; The double dash meaning from X1 to Xn in the variable list.

PG

PG
🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 235 views
  • 2 likes
  • 3 in conversation