|
Hi, dear listers:
I am new to SPSS, so any help will be deeply appreciated. I am trying to run a regression analysis on 100 variables individually. I have one dependent variables, and I want to run regression analysis against these 100 independent variables separately. For example, my dependent variable is y, and 100 variables will be from x1 to x100. I want to do y= alpha1 + beta1 x1, y=alpha2+ beta2 x2.... for 100 times. Is there a command that will let me do this? Right now this is what I have, do I just have to manually change x for 100 times? Or I need to write a loop for it? REGRESSION /DESCRIPTIVES MEAN STDDEV CORR SIG N /MISSING LISTWISE /STATISTICS COEFF OUTS R ANOVA /CRITERIA=PIN(.05) POUT(.10) /NOORIGIN /DEPENDENT y /METHOD=ENTER x1 Thank you all. |
|
Hi,
I had a similar problem a while ago and found the method to develop this macro on the SPSS support website. This has been most helpful for running multiple ANOVAs, curve fits, regressions, you name it. I hope it helps you as much as it helped me. Define many_reg ( ) !do !i = 1 !to 100 . REGRESSION /DESCRIPTIVES MEAN STDDEV CORR SIG N /MISSING LISTWISE /STATISTICS COEFF OUTS R ANOVA /CRITERIA=PIN(.05) POUT(.10) /NOORIGIN /DEPENDENT y /METHOD=ENTER =!concat('x',!i) !doend . !enddefine . many_reg . Lyndsay C. Noble Statistician, Information Intelligence [hidden email] 209.341.7481 -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Joanne Tsai Sent: Thursday, July 05, 2007 11:09 AM To: [hidden email] Subject: regression analysis Hi, dear listers: I am new to SPSS, so any help will be deeply appreciated. I am trying to run a regression analysis on 100 variables individually. I have one dependent variables, and I want to run regression analysis against these 100 independent variables separately. For example, my dependent variable is y, and 100 variables will be from x1 to x100. I want to do y= alpha1 + beta1 x1, y=alpha2+ beta2 x2.... for 100 times. Is there a command that will let me do this? Right now this is what I have, do I just have to manually change x for 100 times? Or I need to write a loop for it? REGRESSION /DESCRIPTIVES MEAN STDDEV CORR SIG N /MISSING LISTWISE /STATISTICS COEFF OUTS R ANOVA /CRITERIA=PIN(.05) POUT(.10) /NOORIGIN /DEPENDENT y /METHOD=ENTER x1 Thank you all. |
|
In reply to this post by Joanne Tsai
Hi Joanne,
You could try placing the REGRESSION command within a macro loop, like this: DEFINE reg_loop (dep = !CMDEND). !DO !I !IN (!dep). REGRESSION /DESCRIPTIVES MEAN STDDEV CORR SIG N /MISSING LISTWISE /STATISTICS COEFF OUTS R ANOVA /CRITERIA=PIN(.05) POUT(.10) /NOORIGIN /DEPENDENT y /METHOD=ENTER !I !ENDDO. !ENDDEFINE. Reg_loop dep = x1 x2 x3 x4 x5... HTH, John Norton SPSS Inc. -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Joanne Tsai Sent: Thursday, July 05, 2007 1:09 PM To: [hidden email] Subject: regression analysis Hi, dear listers: I am new to SPSS, so any help will be deeply appreciated. I am trying to run a regression analysis on 100 variables individually. I have one dependent variables, and I want to run regression analysis against these 100 independent variables separately. For example, my dependent variable is y, and 100 variables will be from x1 to x100. I want to do y= alpha1 + beta1 x1, y=alpha2+ beta2 x2.... for 100 times. Is there a command that will let me do this? Right now this is what I have, do I just have to manually change x for 100 times? Or I need to write a loop for it? REGRESSION /DESCRIPTIVES MEAN STDDEV CORR SIG N /MISSING LISTWISE /STATISTICS COEFF OUTS R ANOVA /CRITERIA=PIN(.05) POUT(.10) /NOORIGIN /DEPENDENT y /METHOD=ENTER x1 Thank you all. |
|
In reply to this post by Joanne Tsai
Joanne:
Here is a macro that will run the same regression for a set of IV's on the same DV. The example runs 4 regressions-- adjust the list after "!regr" in the macro call below. **** sample data-- use your own. DATA LIST FREE /id y x1 x2 x3 x4 (6f8.0). BEGIN DATA 1 3 2 4 5 5 2 4 3 3 6 4 3 2 1 2 4 7 4 1 4 3 4 3 5 8 6 8 5 6 6 6 5 2 4 9 7 5 7 3 8 7 8 9 2 3 1 4 9 7 3 5 7 11 END DATA. DEFINE !regr ( !POS !CMDEND ). !DO !i !IN (!1) REGRESSION /DESCRIPTIVES MEAN STDDEV CORR SIG N /MISSING LISTWISE /STATISTICS COEFF OUTS R ANOVA /CRITERIA=PIN(.05) POUT(.10) /NOORIGIN /DEPENDENT y /METHOD=ENTER !i . !DOEND !ENDDEFINE. ************** call the macro (edit the list of variables after the macro name. !regr x1 x2 x3 x4. I expect there will be more work to do. This will create the output of the regressions, but you probably want to evaluate/ compare the alpha and beta estimates for each regression? --jim -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Joanne Tsai Sent: Thursday, July 05, 2007 1:09 PM To: [hidden email] Subject: regression analysis Hi, dear listers: I am new to SPSS, so any help will be deeply appreciated. I am trying to run a regression analysis on 100 variables individually. I have one dependent variables, and I want to run regression analysis against these 100 independent variables separately. For example, my dependent variable is y, and 100 variables will be from x1 to x100. I want to do y= alpha1 + beta1 x1, y=alpha2+ beta2 x2.... for 100 times. Is there a command that will let me do this? Right now this is what I have, do I just have to manually change x for 100 times? Or I need to write a loop for it? REGRESSION /DESCRIPTIVES MEAN STDDEV CORR SIG N /MISSING LISTWISE /STATISTICS COEFF OUTS R ANOVA /CRITERIA=PIN(.05) POUT(.10) /NOORIGIN /DEPENDENT y /METHOD=ENTER x1 Thank you all. |
|
In reply to this post by Joanne Tsai
Why do you want to do this? A simple correlation matrix of the 100
independent variables with the dependent variable should be sufficient to do some general data fishing since Pearson's R is the same as the standardized beta. Another consideration is missing data handling. Individual regressions delete missing data pairwise so you might end up with very different n's for each pair. If your ultimate intent is to build the most efficient model, enter all the independent variables into the equation and let regression sort out the best joint predictors. Unless you're into brute force data mining (and there are other techniques more powerful than regression to do this), theory should guide which independent variables to test to reject your hypothesis. -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Joanne Tsai Sent: Thursday, July 05, 2007 12:09 PM To: [hidden email] Subject: regression analysis Hi, dear listers: I am new to SPSS, so any help will be deeply appreciated. I am trying to run a regression analysis on 100 variables individually. I have one dependent variables, and I want to run regression analysis against these 100 independent variables separately. For example, my dependent variable is y, and 100 variables will be from x1 to x100. I want to do y= alpha1 + beta1 x1, y=alpha2+ beta2 x2.... for 100 times. Is there a command that will let me do this? Right now this is what I have, do I just have to manually change x for 100 times? Or I need to write a loop for it? REGRESSION /DESCRIPTIVES MEAN STDDEV CORR SIG N /MISSING LISTWISE /STATISTICS COEFF OUTS R ANOVA /CRITERIA=PIN(.05) POUT(.10) /NOORIGIN /DEPENDENT y /METHOD=ENTER x1 Thank you all. |
| Free forum by Nabble | Edit this page |
