Syntax runs fine but not with INCLUDE or INSERT :-(

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

Syntax runs fine but not with INCLUDE or INSERT :-(

Ruben Geert van den Berg
Dear all,
 
The syntax below runs fine on its own. However, if I try to include it with INCLUDE or INSERT in a 'Master syntax', it doesn't work. INCLUDE renders error messages related to the OMS command (or at least it seems) and INSERT seems to have trouble with switching between the different datasets. Does anybody understand what's going wrong and how to fix it?
 
Admittedly, I don't have any previous experience with either INCLUDE or INSERT.

TIA!
 
Ruben van den Berg
 
P.s. I'm sorry about all comments being in Dutch!
 
***Syntax:

DATAS CLO ALL.
GET FIL 'F4341_3A.sav'.
DATAS COP alldata.
DATAS ACT alldata.
MATC FIL FIL alldata
/KEEP INTNR V150_1 to V150_171.
DATAS DEC Labels.
OMS
/SEL TAB
/IF COM=['File Information'] sub=['Variable Values']
/DES FOR=SAV
OUTFILE=Labels.
VIE=NO.
DISP DIC.
OMSEND.
DATAS DEC Mis_v150.
DATAS ACT Labels.
AGG OUT Mis_v150
/BRE Var1
/Missing=N.
DATAS ACT mis_v150.
***Nieuwe dataset met hoogste gelabelde waarde per var aanmaken
STRING Misval (A3).
COMP Misval=STRING(Missing,N3).
EXE.
***Voor latere bewerking
*COMP Misval=LTRIM(Misval,'0').
*EXE.
***Leading zeros knippen
DEL VAR sps.
STRING sps (A100).
COMP sps=CONCAT("MIS VAL ",Var1,"(",LTRIM(Misval,"0"),").").
EXE.
***sps wordt dus de mis val per var
MATC FIL FIL*
/KEEP sps
EXE.
***Alles weggooien behalve sps
SAV TRA OUT 'misval_v150.sps'
/TYP TABTEXT.
***Opslaan als syntax
DATAS ACT alldata.
INC  'misval_v150.sps'.
***MIS VAL specificeren
COU NO_MIS_V150=V150_1 to V150_171 (MIS).
EXE.
FRE NO_MIS_V150.
***FF checken dat elke resp max 1 mis val heeft -> klopt
STRING V16 (A256).
COMP V16="Geen WO opleiding".
DO REP VARS=V150_1 to V150_171.
DO IF MIS(VARS)=0.
COMP V16=VALUELABEL (VARS).
END IF.
END REP.
EXE.
***In elkaar schuiven van V150
FRE V16.
SOR CAS by INTNR (A).
SAV OUT 'V150_done.sav'
/KEEP INTNR V16
/COM.
DATAS CLO Alldata.
DATAS CLO Labels.
DATAS CLO Mis_v150.






What can you do with the new Windows Live? Find out
Reply | Threaded
Open this post in threaded view
|

Re: Syntax runs fine but not with INCLUDE or INSERT :-(

Marta Garcia-Granero
2009/5/19 Ruben van den Berg <[hidden email]>

The syntax below runs fine on its own. However, if I try to include it with INCLUDE or INSERT in a 'Master syntax', it doesn't work. INCLUDE renders error messages related to the OMS command (or at least it seems) and INSERT seems to have trouble with switching between the different datasets. Does anybody understand what's going wrong and how to fix it?
 
I think you must indent the subcommands. Besides, I think you have one extra "." in the middle if the OMS command (right after "OUTFILE=LABELS"). See if my modified version works

Regards,
Marta

Modified syntax:

 DATAS CLO ALL.
GET FIL 'F4341_3A.sav'.
DATAS COP alldata.
DATAS ACT alldata.
MATC FIL FIL alldata
  /KEEP INTNR V150_1 to V150_171.
DATAS DEC Labels.
OMS
  /SEL TAB
  /IF COM=['File Information'] sub=['Variable Values']
  /DES FOR=SAV
  OUTFILE=Labels
  VIE=NO.
DISP DIC.
OMSEND.
DATAS DEC Mis_v150.
DATAS ACT Labels.
AGG OUT Mis_v150
 /BRE Var1
 /Missing=N.
DATAS ACT mis_v150.
***Nieuwe dataset met hoogste gelabelde waarde per var aanmaken
STRING Misval (A3).
COMP Misval=STRING(Missing,N3).
EXE.
***Voor latere bewerking
*COMP Misval=LTRIM(Misval,'0').
*EXE.
***Leading zeros knippen
DEL VAR sps.
STRING sps (A100).
COMP sps=CONCAT("MIS VAL ",Var1,"(",LTRIM(Misval,"0"),").").
EXE.
***sps wordt dus de mis val per var
MATC FIL FIL*
  /KEEP sps.
EXE.
***Alles weggooien behalve sps
SAV TRA OUT 'misval_v150.sps'
 / TYP TABTEXT.
***Opslaan als syntax
DATAS ACT alldata.
INC  'misval_v150.sps'.
***MIS VAL specificeren
COU NO_MIS_V150=V150_1 to V150_171 (MIS).
EXE.
FRE NO_MIS_V150.
***FF checken dat elke resp max 1 mis val heeft -> klopt
STRING V16 (A256).
COMP V16="Geen WO opleiding".
DO REP VARS=V150_1 to V150_171.
DO IF MIS(VARS)=0.
COMP V16=VALUELABEL (VARS).
END IF.
END REP.
EXE.
***In elkaar schuiven van V150
FRE V16.
SOR CAS by INTNR (A).
SAV OUT 'V150_done.sav'
  /KEEP INTNR V16
  /COM.
DATAS CLO Alldata.
DATAS CLO Labels.
DATAS CLO Mis_v150.


Reply | Threaded
Open this post in threaded view
|

Re: Syntax runs fine but not with INCLUDE or INSERT :-(

Peck, Jon

INCLUDE uses batch syntax rules.  INSERT uses interactive rules by default and is generally preferred.

The syntax below includes comment lines that are not terminated by a period.  They will therefore absorb the following command.  So while it might run, it probably wouldn't do what was intended.

 

Remember that *-style comments are commands and need to be terminated like any other command.

 

HTH,

Jon Peck

 


From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Marta Garcia-Granero
Sent: Tuesday, May 19, 2009 1:31 AM
To: [hidden email]
Subject: Re: [SPSSX-L] Syntax runs fine but not with INCLUDE or INSERT :-(

 

2009/5/19 Ruben van den Berg <[hidden email]>


The syntax below runs fine on its own. However, if I try to include it with INCLUDE or INSERT in a 'Master syntax', it doesn't work. INCLUDE renders error messages related to the OMS command (or at least it seems) and INSERT seems to have trouble with switching between the different datasets. Does anybody understand what's going wrong and how to fix it?
 

I think you must indent the subcommands. Besides, I think you have one extra "." in the middle if the OMS command (right after "OUTFILE=LABELS"). See if my modified version works

Regards,
Marta

Modified syntax:

 DATAS CLO ALL.
GET FIL 'F4341_3A.sav'.
DATAS COP alldata.
DATAS ACT alldata.
MATC FIL FIL alldata
  /KEEP INTNR V150_1 to V150_171.
DATAS DEC Labels.
OMS
  /SEL TAB
  /IF COM=['File Information'] sub=['Variable Values']
  /DES FOR=SAV
  OUTFILE=Labels
  VIE=NO.
DISP DIC.
OMSEND.
DATAS DEC Mis_v150.
DATAS ACT Labels.
AGG OUT Mis_v150
 /BRE Var1
 /Missing=N.
DATAS ACT mis_v150.
***Nieuwe dataset met hoogste gelabelde waarde per var aanmaken
STRING Misval (A3).
COMP Misval=STRING(Missing,N3).
EXE.
***Voor latere bewerking
*COMP Misval=LTRIM(Misval,'0').
*EXE.
***Leading zeros knippen
DEL VAR sps.
STRING sps (A100).
COMP sps=CONCAT("MIS VAL ",Var1,"(",LTRIM(Misval,"0"),").").
EXE.
***sps wordt dus de mis val per var
MATC FIL FIL*
  /KEEP sps.
EXE.
***Alles weggooien behalve sps
SAV TRA OUT 'misval_v150.sps'
 / TYP TABTEXT.
***Opslaan als syntax
DATAS ACT alldata.
INC  'misval_v150.sps'.
***MIS VAL specificeren
COU NO_MIS_V150=V150_1 to V150_171 (MIS).
EXE.
FRE NO_MIS_V150.
***FF checken dat elke resp max 1 mis val heeft -> klopt
STRING V16 (A256).
COMP V16="Geen WO opleiding".
DO REP VARS=V150_1 to V150_171.
DO IF MIS(VARS)=0.
COMP V16=VALUELABEL (VARS).
END IF.
END REP.
EXE.
***In elkaar schuiven van V150
FRE V16.
SOR CAS by INTNR (A).
SAV OUT 'V150_done.sav'
  /KEEP INTNR V16
  /COM.
DATAS CLO Alldata.
DATAS CLO Labels.
DATAS CLO Mis_v150.

 

Reply | Threaded
Open this post in threaded view
|

Re: Syntax runs fine but not with INCLUDE or INSERT :-(

Oliver, Richard
In reply to this post by Ruben Geert van den Berg
INCLUDE doesn't work because your syntax doesn't adhere to batch rules, which require that command continuation lines be indented.
 
To diagnose the INSERT problem, it would be helpful to have the specific error message -- but keep in mind that relative paths in file specifications are relative to the current application working directory, which may not be what you think it is, unless you use the CD command to explicitly set the working directory.


From: SPSSX(r) Discussion on behalf of Ruben van den Berg
Sent: Tue 5/19/2009 12:16 AM
To: [hidden email]
Subject: Syntax runs fine but not with INCLUDE or INSERT :-(

Dear all,
 
The syntax below runs fine on its own. However, if I try to include it with INCLUDE or INSERT in a 'Master syntax', it doesn't work. INCLUDE renders error messages related to the OMS command (or at least it seems) and INSERT seems to have trouble with switching between the different datasets. Does anybody understand what's going wrong and how to fix it?
 
Admittedly, I don't have any previous experience with either INCLUDE or INSERT.

TIA!
 
Ruben van den Berg
 
P.s. I'm sorry about all comments being in Dutch!
 
***Syntax:

DATAS CLO ALL.
GET FIL 'F4341_3A.sav'.
DATAS COP alldata.
DATAS ACT alldata.
MATC FIL FIL alldata
/KEEP INTNR V150_1 to V150_171.
DATAS DEC Labels.
OMS
/SEL TAB
/IF COM=['File Information'] sub=['Variable Values']
/DES FOR=SAV
OUTFILE=Labels.
VIE=NO.
DISP DIC.
OMSEND.
DATAS DEC Mis_v150.
DATAS ACT Labels.
AGG OUT Mis_v150
/BRE Var1
/Missing=N.
DATAS ACT mis_v150.
***Nieuwe dataset met hoogste gelabelde waarde per var aanmaken
STRING Misval (A3).
COMP Misval=STRING(Missing,N3).
EXE.
***Voor latere bewerking
*COMP Misval=LTRIM(Misval,'0').
*EXE.
***Leading zeros knippen
DEL VAR sps.
STRING sps (A100).
COMP sps=CONCAT("MIS VAL ",Var1,"(",LTRIM(Misval,"0"),").").
EXE.
***sps wordt dus de mis val per var
MATC FIL FIL*
/KEEP sps
EXE.
***Alles weggooien behalve sps
SAV TRA OUT 'misval_v150.sps'
/TYP TABTEXT.
***Opslaan als syntax
DATAS ACT alldata.
INC  'misval_v150.sps'.
***MIS VAL specificeren
COU NO_MIS_V150=V150_1 to V150_171 (MIS).
EXE.
FRE NO_MIS_V150.
***FF checken dat elke resp max 1 mis val heeft -> klopt
STRING V16 (A256).
COMP V16="Geen WO opleiding".
DO REP VARS=V150_1 to V150_171.
DO IF MIS(VARS)=0.
COMP V16=VALUELABEL (VARS).
END IF.
END REP.
EXE.
***In elkaar schuiven van V150
FRE V16.
SOR CAS by INTNR (A).
SAV OUT 'V150_done.sav'
/KEEP INTNR V16
/COM.
DATAS CLO Alldata.
DATAS CLO Labels.
DATAS CLO Mis_v150.






What can you do with the new Windows Live? Find out
Reply | Threaded
Open this post in threaded view
|

OT Sobel test

William Dudley WNDUDLEY

For some tiem I have been using the Soble test as a test of mediation effect.  A reviewer recenlty commented that Sobel recently (2007??)
described errors with mediation analyses and with his well known test.


I have not been able to locate a citation for Soble in which he points out these error and
I wonder if others out there know of and can point me to this work.

Thanks

William N. Dudley, PhD
Associate Dean for Research
The School of Health and Human Performance Office of Research
The University of North Carolina at Greensboro
126 HHP Building, PO Box 26170
Greensboro, NC 27402-6170
VOICE 336.2562475
FAX 336.334.3238
Reply | Threaded
Open this post in threaded view
|

Re: OT Sobel test

Swank, Paul R

Look for Kris Preacher’s site at University of Kansas. I know that there are three different formulas for standard errors for the Sobel test but I have not heard about these so-called errors. Preacher also has a macro for bootstrapping mediation effects and this is more powerful. Also Davis MacKinnon’s site has good information on alternatives.

 

Dr. Paul R. Swank,

Professor and Director of Research

Children's Learning Institute

University of Texas Health Science Center-Houston

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of William Dudley WNDUDLEY
Sent: Tuesday, May 19, 2009 7:58 AM
To: [hidden email]
Subject: OT Sobel test

 


For some tiem I have been using the Soble test as a test of mediation effect.  A reviewer recenlty commented that Sobel recently (2007??)
described errors with mediation analyses and with his well known test.


I have not been able to locate a citation for Soble in which he points out these error and
I wonder if others out there know of and can point me to this work.

Thanks

William N. Dudley, PhD
Associate Dean for Research
The School of Health and Human Performance Office of Research
The University of North Carolina at Greensboro
126 HHP Building, PO Box 26170
Greensboro, NC 27402-6170
VOICE 336.2562475
FAX 336.334.3238