Help with programming in SPSS

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Help with programming in SPSS

Ray Haraf
Hi there!
I am wondering if this is feasible. I have eight dependent nominal
variables dv1, dv2, …, dv8 and twelve nominal and ordinal independent
variables iv1, iv2, …, iv12. I run eight (8) different multinomial
logistic regressions. My work is done.

However, I would like to be able to write Syntax to execute the 8
regressions. I would like to have something like

For n =1 to 8
Do
NOMREG dvn (BASE=LAST ORDER=ASCENDING) BY iv1 TO iv12
  /CRITERIA CIN(95) DELTA(0) MXITER(100) MXSTEP(5) CHKSEP(20) LCONVERGE(0)
PCONVERGE(0.000001) SINGULAR(0.00000001)
  /MODEL
  /STEPWISE=PIN(.05) POUT(0.1) MINEFFECT(0) RULE(SINGLE) ENTRYMETHOD(LR)
REMOVALMETHOD(LR)
  /INTERCEPT=INCLUDE
  /PRINT=PARAMETER SUMMARY LRT CPS STEP MFI.

Would this be possible? If yes, please help.

Thanks,
Ray

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Help with programming in SPSS

Bruce Weaver
Administrator
Ray Haraf wrote
Hi there!
I am wondering if this is feasible. I have eight dependent nominal
variables dv1, dv2, …, dv8 and twelve nominal and ordinal independent
variables iv1, iv2, …, iv12. I run eight (8) different multinomial
logistic regressions. My work is done.

However, I would like to be able to write Syntax to execute the 8
regressions. I would like to have something like

For n =1 to 8
Do
NOMREG dvn (BASE=LAST ORDER=ASCENDING) BY iv1 TO iv12
  /CRITERIA CIN(95) DELTA(0) MXITER(100) MXSTEP(5) CHKSEP(20) LCONVERGE(0)
PCONVERGE(0.000001) SINGULAR(0.00000001)
  /MODEL
  /STEPWISE=PIN(.05) POUT(0.1) MINEFFECT(0) RULE(SINGLE) ENTRYMETHOD(LR)
REMOVALMETHOD(LR)
  /INTERCEPT=INCLUDE
  /PRINT=PARAMETER SUMMARY LRT CPS STEP MFI.

Would this be possible? If yes, please help.

Thanks,
Ray
Hi Ray.  Something like the following should work.

* Macro to loop through a list of outcome variables,
* running NOMREG (with the same explanatory variables)
* for each Y.

DEFINE MyNOMREG (YLIST !CMDEND) .

!do !Y !in(!YLIST)

NOMREG !Y (BASE=LAST ORDER=ASCENDING) BY iv1 TO iv12
  /CRITERIA CIN(95) DELTA(0) MXITER(100) MXSTEP(5) CHKSEP(20) LCONVERGE(0)
PCONVERGE(0.000001) SINGULAR(0.00000001)
  /MODEL
  /STEPWISE=PIN(.05) POUT(0.1) MINEFFECT(0) RULE(SINGLE) ENTRYMETHOD(LR)
REMOVALMETHOD(LR)
  /INTERCEPT=INCLUDE
  /PRINT=PARAMETER SUMMARY LRT CPS STEP MFI.

!doend
!ENDDEFINE.

* Call the macro .

MyNOMREG ylist = y1 y2 y3 y4 y5 y6 y7 y8 .

--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).