|
Dear List,
I am trying to run a series of ordinal/binary logistic regression models on a big batch of dependents using the same 10 independents for each model. I have a syntax which executes this for a linear regression but when I amend the syntax for Ordinal or BL regression it does not want to work. I have pasted the syntax for the linear regression first, which runs fine. The second syntax is a ordinal regression applying the same format as the linear regression syntax, though surprisingly this syntax does not run. Error appears regarding to many dependents, only one dependent is allowed. The second syntax is adjusted for an ordinal regression though surprisingly this syntax does not run. Error appears regarding to many dependents, only one dependent is allowed. (I've done the same for BL regression which also does not work) Does anybody have an experience in why this happens? Thanks in advance *Syntax for Linear Regression:* ** DEFINE XXX (!POS !CHAREND('*') /!POS !CHAREND('*') /!POS !CHAREND('*')). REGRESSION /MISSING LISTWISE /STATISTICS COEFF OUTS R ANOVA /CRITERIA=PIN(.05) POUT(.10) /NOORIGIN /DEPENDENT !1 /METHOD=ENTER X1 X2 X3 X4 X5. !ENDDEFINE. XXX Y1 Y2 Y3 Y4 Y5 Y6 Y7 Y8 Y9 Y10. *Syntax for Ordinal Regression:* DEFINE XXX (!POS !CHAREND('*') /!POS !CHAREND('*') /!POS !CHAREND('*')). PLUM !1 BY WITH X1 X2 X3 X4 X5 /CRITERIA = CIN(95) DELTA(0) LCONVERGE(0) MXITER(100) MXSTEP(5) PCONVERGE(1.0E-6) SINGULAR(1.0E-8) /LINK = LOGIT /PRINT = CELLINFO CORB COVB FIT PARAMETER SUMMARY TPARALLEL . !ENDDEFINE. XXX Y1 Y2 Y3 Y4 Y5 Y6 Y7 Y8 Y9 Y10. |
|
At 10:20 AM 6/19/2007, J Sutar wrote:
>I am trying to run a series of ordinal/binary logistic regression >models on a big batch of dependents using the same 10 independents for >each model. > >[I have] an ordinal regression applying the same format as the linear >regression syntax [that works], [and] this syntax does not run. >*Syntax for Ordinal Regression:* > >DEFINE XXX (!POS !CHAREND('*') > /!POS !CHAREND('*') > /!POS !CHAREND('*')). > >PLUM > !1 BY WITH X1 X2 X3 X4 X5 > /CRITERIA = CIN(95) DELTA(0) LCONVERGE(0) MXITER(100) MXSTEP(5) > PCONVERGE(1.0E-6) SINGULAR(1.0E-8) > /LINK = LOGIT > /PRINT = CELLINFO CORB COVB FIT PARAMETER SUMMARY TPARALLEL >. >!ENDDEFINE. > >XXX Y1 Y2 Y3 Y4 Y5 Y6 Y7 Y8 Y9 Y10. Is it as simple as that line > !1 BY WITH X1 X2 X3 X4 X5 is syntactically invalid for PLUM, having both BY and WITH and no set of factor variables for the BY? |
|
Apologies, Thanks for spotting that out Richard.
Though its not that whats causing the problem. Even when I fix that by removing the 'BY' (so that the model includes only 5 covariates and no factors) I still receive the same error...command could not be executed due to to many dependents specified. On 19/06/07, Richard Ristow <[hidden email]> wrote: > > At 10:20 AM 6/19/2007, J Sutar wrote: > > >I am trying to run a series of ordinal/binary logistic regression > >models on a big batch of dependents using the same 10 independents for > >each model. > > > >[I have] an ordinal regression applying the same format as the linear > >regression syntax [that works], [and] this syntax does not run. > >*Syntax for Ordinal Regression:* > > > >DEFINE XXX (!POS !CHAREND('*') > > /!POS !CHAREND('*') > > /!POS !CHAREND('*')). > > > >PLUM > > !1 BY WITH X1 X2 X3 X4 X5 > > /CRITERIA = CIN(95) DELTA(0) LCONVERGE(0) MXITER(100) MXSTEP(5) > > PCONVERGE(1.0E-6) SINGULAR(1.0E-8) > > /LINK = LOGIT > > /PRINT = CELLINFO CORB COVB FIT PARAMETER SUMMARY TPARALLEL > >. > >!ENDDEFINE. > > > >XXX Y1 Y2 Y3 Y4 Y5 Y6 Y7 Y8 Y9 Y10. > > Is it as simple as that line > > > !1 BY WITH X1 X2 X3 X4 X5 > > is syntactically invalid for PLUM, having both BY and WITH and no set > of factor variables for the BY? > > |
|
At 06:40 AM 6/20/2007, J Sutar wrote:
>Apologies, Thanks for spotting that out Richard. > >Though even when I fix that by removing the 'BY' (so that the model >includes only 5 covariates and no factors) I still receive the same >error...command could not be executed due to too many dependents >specified. Sounds like you have all the dependents on the same PLUM command, where you want a PLUM command for each. The latter takes a macro loop, with the !DO command. To see what code you're generating, use MPRINT. (In fact, always use MPRINT when debugging macros.) Try like this; the result may be illuminating. DEFINE XXX (!POS !CHAREND('*') /!POS !CHAREND('*') /!POS !CHAREND('*')). PLUM !1 BY WITH X1 X2 X3 X4 X5 /CRITERIA = CIN(95) DELTA(0) LCONVERGE(0) MXITER(100) MXSTEP(5) PCONVERGE(1.0E-6) SINGULAR(1.0E-8) /LINK = LOGIT /PRINT = CELLINFO CORB COVB FIT PARAMETER SUMMARY TPARALLEL . !ENDDEFINE. PRESERVE. SET MPRINT ON. XXX Y1 Y2 Y3 Y4 Y5 Y6 Y7 Y8 Y9 Y10. RESTORE. |
|
So how would I construct a macro loop with a !DO command to run this syntax?
Thanks On 20/06/07, Richard Ristow <[hidden email]> wrote: > > At 06:40 AM 6/20/2007, J Sutar wrote: > > >Apologies, Thanks for spotting that out Richard. > > > >Though even when I fix that by removing the 'BY' (so that the model > >includes only 5 covariates and no factors) I still receive the same > >error...command could not be executed due to too many dependents > >specified. > > Sounds like you have all the dependents on the same PLUM command, where > you want a PLUM command for each. The latter takes a macro loop, with > the !DO command. > > To see what code you're generating, use MPRINT. (In fact, always use > MPRINT when debugging macros.) Try like this; the result may be > illuminating. > > DEFINE XXX (!POS !CHAREND('*') > /!POS !CHAREND('*') > /!POS !CHAREND('*')). > > PLUM > !1 BY WITH X1 X2 X3 X4 X5 > /CRITERIA = CIN(95) DELTA(0) LCONVERGE(0) MXITER(100) MXSTEP(5) > PCONVERGE(1.0E-6) SINGULAR(1.0E-8) > /LINK = LOGIT > /PRINT = CELLINFO CORB COVB FIT PARAMETER SUMMARY TPARALLEL > . > !ENDDEFINE. > > PRESERVE. > SET MPRINT ON. > XXX Y1 Y2 Y3 Y4 Y5 Y6 Y7 Y8 Y9 Y10. > RESTORE. > > |
|
At 10:00 AM 6/21/2007, J Sutar wrote:
>So how would I construct a macro loop with a !DO command to run this >syntax? This demo generates FREQUENCIES syntax rather than PLUM. (You wouldn't need the macro to run FREQUENCIES; FREQUENCIES accepts lists of variables.) You should be able to substitute your PLUM command for the FREQUENCIES. SPSS 15 draft output (WRR: not saved separately. Test data hand-entered): |-----------------------------|---------------------------| |Output Created |22-JUN-2007 15:49:23 | |-----------------------------|---------------------------| [DataSet1] C:\Documents and Settings\Richard\My Documents \Technical\SPSS 16 Beta\LIST command taking ridiculously long.sav A B C 1 4 7 2 5 8 3 6 9 Number of cases read: 3 Number of cases listed: 3 DEFINE !FREQS (VARLIST=!CMDEND) !DO !VAR !IN (!VARLIST) FREQUENCIES !VAR. !DOEND !ENDDEFINE. PRESERVE. SET MPRINT ON. !FREQS VARLIST=A B C. 24 M> 25 M> . 26 M> FREQUENCIES A. Frequencies |-----------------------------|---------------------------| |Output Created |22-JUN-2007 15:49:24 | |-----------------------------|---------------------------| [DataSet1] C:\Documents and Settings\Richard\My Documents \Technical\SPSS 16 Beta\LIST command taking ridiculously long.sav Statistics [suppressed] A |-----|-----|---------|-------|-------------|---------------| | | |Frequency|Percent|Valid Percent|Cumulative | | | | | | |Percent | |-----|-----|---------|-------|-------------|---------------| |Valid|1 |1 |33.3 |33.3 |33.3 | | |2 |1 |33.3 |33.3 |66.7 | | |3 |1 |33.3 |33.3 |100.0 | | |-----|---------|-------|-------------|---------------| | |Total|3 |100.0 |100.0 | | |-----|-----|---------|-------|-------------|---------------| 27 M> FREQUENCIES B. Frequencies |-----------------------------|---------------------------| |Output Created |22-JUN-2007 15:49:24 | |-----------------------------|---------------------------| [DataSet1] C:\Documents and Settings\Richard\My Documents \Technical\SPSS 16 Beta\LIST command taking ridiculously long.sav Statistics [suppressed] B |-----|-----|---------|-------|-------------|---------------| | | |Frequency|Percent|Valid Percent|Cumulative | | | | | | |Percent | |-----|-----|---------|-------|-------------|---------------| |Valid|4 |1 |33.3 |33.3 |33.3 | | |5 |1 |33.3 |33.3 |66.7 | | |6 |1 |33.3 |33.3 |100.0 | | |-----|---------|-------|-------------|---------------| | |Total|3 |100.0 |100.0 | | |-----|-----|---------|-------|-------------|---------------| 28 M> FREQUENCIES C. Frequencies |-----------------------------|---------------------------| |Output Created |22-JUN-2007 15:49:24 | |-----------------------------|---------------------------| [DataSet1] C:\Documents and Settings\Richard\My Documents \Technical\SPSS 16 Beta\LIST command taking ridiculously long.sav Statistics [suppressed] C |-----|-----|---------|-------|-------------|---------------| | | |Frequency|Percent|Valid Percent|Cumulative | | | | | | |Percent | |-----|-----|---------|-------|-------------|---------------| |Valid|7 |1 |33.3 |33.3 |33.3 | | |8 |1 |33.3 |33.3 |66.7 | | |9 |1 |33.3 |33.3 |100.0 | | |-----|---------|-------|-------------|---------------| | |Total|3 |100.0 |100.0 | | |-----|-----|---------|-------|-------------|---------------| 29 M> . RESTORE. 30 M> RESTORE. |
| Free forum by Nabble | Edit this page |
