how to creat a loop for many dependent variable regression

Reply
Super Contributor
Posts: 297

how to creat a loop for many dependent variable regression

I have this data (the one I sent) there are 615 dependent variable and 3 independent variable.

The dependent variables are A, T, M , N, z (that is they are not ordered) and the independent variable are age, gender and drug type.

I want to run 6i5 regression models with all 615 dependent variable map to the 3 independent variable.

I am thinking to use array for this but still confused

The problem is that the dependent variable which are genes are not in form A1-A600, they have different name and not order.

Please can you help with that?

Respected Advisor
Posts: 3,777

Re: how to creat a loop for many dependent variable regression

Assuming proc REG or GLM you could use a name range list.  Some procs like MIXED only accept one Y variable so you would need to transpose the Ys and use a BY statement.

proc reg data=sashelp.class;
   model height-numeric-weight = age;
   run;

Message was edited by: data _null_

Super Contributor
Posts: 297

Re: how to creat a loop for many dependent variable regression

thanks I did it using array

Ask a Question
Discussion stats
  • 2 replies
  • 234 views
  • 1 like
  • 2 in conversation