Re: Repeated set of command by two conditions

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

Re: Repeated set of command by two conditions

David Marso-2
DEFINE !MyCode (!POS !TOKENS(1) /!POS !TOKENS(1) /!POS !TOKENS(1)/!POS !TOKENS(1) )
!DO !x=!3 !TO !4
TEMPORARY.
SELECT IF (!2= EQ !x) .
EXAMINE VARIABLES=!1
  /PLOT BOXPLOT HISTOGRAM NPPLOT
  /COMPARE GROUPS
  /STATISTICS DESCRIPTIVES EXTREME
  /CINTERVAL 95
  /MISSING LISTWISE
  /NOTOTAL.
TEMPORARY.
SELECT IF !2=!x.
GRAPH
  /HISTOGRAM(NORMAL)=!1.
!DOEND
!ENDDEFINE.

SORT CASES  BY STAT.
SPLIT FILE SEPARATE BY STAT.
!MyCode Fatr Loc 1 5.
SPLIT FILE OFF.

=====================
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: Repeated set of command by two conditions

David Marso
Administrator
Really freaking weird:
This was on UGA and apparently originated from Nabble but it didn't show up
on Nabble.
I replied from my moderator account and it showed here but not the original
missive.
---
Original with context:


Subject:Repeated set of command by two conditions
 From:Faisal <[hidden email]>

Date:Fri, 27 Oct 2017 12:40:43 -0700

Hello,
I would like to run a set of commands by three health status (STAT) in five
different locations (LOC: 1,2,3,4,5). I used the following set of commands
that works. However, it is not an efficient way as I have to: i) run the
entire set 5 times for 5 different LOC; and ii) include "temporary with
select if" twice to perform Examine and Graph procedures.

Is there a simple way to do this without affecting my original data set?

SORT CASES  BY STAT.
SPLIT FILE SEPARATE BY STAT.
TEMPORARY.
SELECT IF LOC=1.
EXAMINE VARIABLES=FATR
  /PLOT BOXPLOT HISTOGRAM NPPLOT
  /COMPARE GROUPS
  /STATISTICS DESCRIPTIVES EXTREME
  /CINTERVAL 95
  /MISSING LISTWISE
  /NOTOTAL.
SORT CASES  BY STAT.
SPLIT FILE SEPARATE BY STAT.
TEMPORARY.
SELECT IF LOC=1.
GRAPH
  /HISTOGRAM(NORMAL)=FATR.
SPLIT FILE OFF.

thanks
Faisal



--
*Sent from: http://spssx-discussion.1045642.n5.nabble.com/*

=====================
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



-----
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
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
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"