Indiana University
University Information Technology Services
  
What are archived documents?
Login>>
Login

Login is for authorized groups (e.g., UITS, OVPIT, and TCC) that need access to specialized Knowledge Base documents. Otherwise, simply use the Knowledge Base without logging in.

Close

In SPSS, how do I run multiple sets of regressions without having to retype the command each time?

SPSS has a macro facility designed to customize functions from existing commands, allowing you to run a series of commands using different variables in each iteration.

For example, if you want to run a series of regressions using different dependent variables but the same independent variables, you can use the SPSS macro facility to create a list of your dependent variables. When you have defined your macro, you can direct its output to a single regression command, which will then proceed through each of the dependent variables you listed in the macro.

The following example contains three dependent variables (y1-y3) and three independent variables (x1-x3). The commands establish a macro that will run three regressions using each of the dependent variables against all of the independent variables:

DEFINE M () y1 y2 y3. !ENDDEFINE. REGRESSION VAR = M x1 x2 x3 /DEP = M /METHOD = ENTER.

The line DEFINE M () tells SPSS the name of the function to define. In this example, the macro is called M. The next line lists the variables that M is equal to, and consists of the dependent variable names on a line indented at least one space. Finally, the line !ENDDEFINE specifies the end of the macro.

The second group of commands shows how this macro is used. Instead of typing the dependent variable names in the regression command, use the macro name (M, in this example). This single command will then execute for each value of M, thus producing three different regression analyses with one command.

For more about statistical and mathematical software, email the UITS Stat/Math Center, visit the center's web page, or phone 812-855-4724 (IUB) or 317-278-4740 (IUPUI). The center is located in Bloomington at 410 N. Park Avenue, and is open for consultation by appointment Monday-Friday 9am-5pm.

This is document afii in domain all.
Last modified on March 24, 2011.

Comments/Questions/Corrections

Use this form to offer suggestions, corrections, and additions to the Knowledge Base. We welcome your input!

If you are affiliated with Indiana University and would like assistance with a specific computing problem, please use the Ask a Consultant form, or contact your campus Support Center.

Contact Information

Note: We will reply to your comment at this address. If your message concerns a problem receiving email, please enter an alternate email address.