Learning SAS? Welcome to the exclusive online community for all SAS learners.

How to call in all predictors in a "Model" statement without typing them in manually?

Reply
New Contributor BD
New Contributor
Posts: 2

How to call in all predictors in a "Model" statement without typing them in manually?

How to call in all predictors in a "Model" statement without typing them in manually, especially in the case of highly dimensional data?

Super User
Posts: 11,343

Re: How to call in all predictors in a "Model" statement without typing them in manually?

If you have variables with names that start the same you may be able to use a list such as

 

model y = abc: ;

which would use all variables that start with the letters abc. If you have multiple name stems you can use them

model y = abc:  pdq:  etc: ;

 

Other than that we may need to know more about your data as there is no way for us to know which of your variables are "predictors".

New Contributor BD
New Contributor
Posts: 2

Re: How to call in all predictors in a "Model" statement without typing them in manually?

Thanks. That's a start.

 

Let's hypotheticaly assume my dataset has 50 variables of which only one is the the response variable (Y), and all the remaining variables would be Xs (X1, X2,X3....X49). Let's futher assume I am trying to run a PROC GLMSELECT to MODEL Y= X1, X2,X3....X49, while reducing the dimensionality. Would Y= ABCDEF....Z:;  work, or there is another way to call in all existing variables on the right side of the equation, and then perhaps go and remove the only one that is the Y, without having to manually type them all in?

Ask a Question
Discussion stats
  • 2 replies
  • 239 views
  • 0 likes
  • 2 in conversation