TEMPORARY SELECT IF

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

TEMPORARY SELECT IF

huang jialin
Hi everyone,

I was trying to run the following syntax, but SPSS did not produce any results at all. What would you recommend to change? Your inputs will be appreciated. Thanks.


TEMPORARY.
SELECT IF (ID=21012 OR ID=21013 OR ID=21125).
VECTOR item=t1r1 to t1r55.
COMPUTE BME=0.
LOOP #i=1 to 55.
    IF (item(#i)=" ") BME=BME+1.
END LOOP.
EXECUTE.

Sincerely,
Jialin Huang

Reply | Threaded
Open this post in threaded view
|

Re: TEMPORARY SELECT IF

David Marso
Administrator
EXECUTE does NOT produce output!
What do you expect this code to do?
For an easier path see
DO IF and COUNT.
Rather more accessible for what it appears you are attempting to achieve.
You would do well to review to Universals section of the FM before proceeding much further in your exploration of SPSS.  It will fill in some obvious fundamental gaps in your current understanding.
 
huang jialin wrote
Hi everyone,

I was trying to run the following syntax, but SPSS did not produce any
results at all. What would you recommend to change? Your inputs will be
appreciated. Thanks.


TEMPORARY.
SELECT IF (ID=21012 OR ID=21013 OR ID=21125).
VECTOR item=t1r1 to t1r55.
COMPUTE BME=0.
LOOP #i=1 to 55.
    IF (item(#i)=" ") BME=BME+1.
END LOOP.
EXECUTE.

Sincerely,
Jialin Huang
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?"
Reply | Threaded
Open this post in threaded view
|

Re: TEMPORARY SELECT IF

huang jialin
David,

Thanks for your comments. I am trying to count blanks in a series of variables for a single row/case.

BTW, What do you mean by FM?

Thanks.

Sincerely,
Jialin Huang



On Tue, Dec 4, 2012 at 9:28 AM, David Marso <[hidden email]> wrote:
EXECUTE does NOT produce output!
What do you expect this code to do?
For an easier path see
DO IF and COUNT.
Rather more accessible for what it appears you are attempting to achieve.
You would do well to review to Universals section of the FM before
proceeding much further in your exploration of SPSS.  It will fill in some
obvious fundamental gaps in your current understanding.


huang jialin wrote
> Hi everyone,
>
> I was trying to run the following syntax, but SPSS did not produce any
> results at all. What would you recommend to change? Your inputs will be
> appreciated. Thanks.
>
>
> TEMPORARY.
> SELECT IF (ID=21012 OR ID=21013 OR ID=21125).
> VECTOR item=t1r1 to t1r55.
> COMPUTE BME=0.
> LOOP #i=1 to 55.
>     IF (item(#i)=" ") BME=BME+1.
> END LOOP.
> EXECUTE.
>
> Sincerely,
> Jialin Huang





-----
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/TEMPORARY-SELECT-IF-tp5716642p5716643.html
Sent from the SPSSX Discussion mailing list archive at 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

Reply | Threaded
Open this post in threaded view
|

Re: TEMPORARY SELECT IF

Bruce Weaver
Administrator
FM = Fine Manual, although there is occasionally some debate about whether it is really fine.
RTFM = Read The FM.

You might also see (mainly in Jon's posts) CSR(M).  This stands for Command Syntax Reference Manual, which is the official name for the FM.

HTH.


huang jialin wrote
David,

Thanks for your comments. I am trying to count blanks in a series of
variables for a single row/case.

BTW, What do you mean by FM?

Thanks.

Sincerely,
Jialin Huang



On Tue, Dec 4, 2012 at 9:28 AM, David Marso <[hidden email]> wrote:

> EXECUTE does NOT produce output!
> What do you expect this code to do?
> For an easier path see
> DO IF and COUNT.
> Rather more accessible for what it appears you are attempting to achieve.
> You would do well to review to Universals section of the FM before
> proceeding much further in your exploration of SPSS.  It will fill in some
> obvious fundamental gaps in your current understanding.
>
>
> huang jialin wrote
> > Hi everyone,
> >
> > I was trying to run the following syntax, but SPSS did not produce any
> > results at all. What would you recommend to change? Your inputs will be
> > appreciated. Thanks.
> >
> >
> > TEMPORARY.
> > SELECT IF (ID=21012 OR ID=21013 OR ID=21125).
> > VECTOR item=t1r1 to t1r55.
> > COMPUTE BME=0.
> > LOOP #i=1 to 55.
> >     IF (item(#i)=" ") BME=BME+1.
> > END LOOP.
> > EXECUTE.
> >
> > Sincerely,
> > Jialin Huang
>
>
>
>
>
> -----
> Please reply to the list and not to my personal email.
> Those desiring my consulting or training services please feel free to
> email me.
> --
> View this message in context:
> http://spssx-discussion.1045642.n5.nabble.com/TEMPORARY-SELECT-IF-tp5716642p5716643.html
> Sent from the SPSSX Discussion mailing list archive at 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
>
--
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/).
Reply | Threaded
Open this post in threaded view
|

Re: TEMPORARY SELECT IF

Jon K Peck
In reply to this post by huang jialin
Note that regardless of the logic in the code below, since you preface it with TEMPORARY, all the data results will be thrown away after they are computed.


Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621




From:        huang jialin <[hidden email]>
To:        [hidden email],
Date:        12/04/2012 08:35 AM
Subject:        Re: [SPSSX-L] TEMPORARY SELECT IF
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




David,

Thanks for your comments. I am trying to count blanks in a series of variables for a single row/case.

BTW, What do you mean by FM?

Thanks.

Sincerely,
Jialin Huang



On Tue, Dec 4, 2012 at 9:28 AM, David Marso <david.marso@...> wrote:
EXECUTE does NOT produce output!
What do you expect this code to do?
For an easier path see
DO IF and COUNT.
Rather more accessible for what it appears you are attempting to achieve.
You would do well to review to Universals section of the FM before
proceeding much further in your exploration of SPSS.  It will fill in some
obvious fundamental gaps in your current understanding.


huang jialin wrote

> Hi everyone,
>
> I was trying to run the following syntax, but SPSS did not produce any
> results at all. What would you recommend to change? Your inputs will be
> appreciated. Thanks.
>
>
> TEMPORARY.
> SELECT IF (ID=21012 OR ID=21013 OR ID=21125).
> VECTOR item=t1r1 to t1r55.
> COMPUTE BME=0.
> LOOP #i=1 to 55.
>     IF (item(#i)=" ") BME=BME+1.
> END LOOP.
> EXECUTE.
>
> Sincerely,
> Jialin Huang





-----
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/TEMPORARY-SELECT-IF-tp5716642p5716643.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
To manage your subscription to SPSSX-L, send a message to

LISTSERV@... (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: TEMPORARY SELECT IF

huang jialin
Davide and Jon,

Thanks for your response. I appreciate it.

Sincerely,
Jialin Huang


On Tue, Dec 4, 2012 at 10:11 AM, Jon K Peck <[hidden email]> wrote:
Note that regardless of the logic in the code below, since you preface it with TEMPORARY, all the data results will be thrown away after they are computed.


Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
new phone: <a href="tel:720-342-5621" value="+17203425621" target="_blank">720-342-5621




From:        huang jialin <[hidden email]>
To:        [hidden email],
Date:        12/04/2012 08:35 AM
Subject:        Re: [SPSSX-L] TEMPORARY SELECT IF
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




David,

Thanks for your comments. I am trying to count blanks in a series of variables for a single row/case.

BTW, What do you mean by FM?

Thanks.

Sincerely,
Jialin Huang



On Tue, Dec 4, 2012 at 9:28 AM, David Marso <[hidden email]> wrote:
EXECUTE does NOT produce output!
What do you expect this code to do?
For an easier path see
DO IF and COUNT.
Rather more accessible for what it appears you are attempting to achieve.
You would do well to review to Universals section of the FM before
proceeding much further in your exploration of SPSS.  It will fill in some
obvious fundamental gaps in your current understanding.


huang jialin wrote

> Hi everyone,
>
> I was trying to run the following syntax, but SPSS did not produce any
> results at all. What would you recommend to change? Your inputs will be
> appreciated. Thanks.
>
>
> TEMPORARY.
> SELECT IF (ID=21012 OR ID=21013 OR ID=21125).
> VECTOR item=t1r1 to t1r55.
> COMPUTE BME=0.
> LOOP #i=1 to 55.
>     IF (item(#i)=" ") BME=BME+1.
> END LOOP.
> EXECUTE.
>
> Sincerely,
> Jialin Huang





-----
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/TEMPORARY-SELECT-IF-tp5716642p5716643.html
Sent from the SPSSX Discussion mailing list archive at 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



Reply | Threaded
Open this post in threaded view
|

Re: TEMPORARY SELECT IF

David Marso
Administrator
In reply to this post by Bruce Weaver
Compared to most software documentation the SPSS flavor is pretty fine.
--
ftp://public.dhe.ibm.com/software/analytics/spss/documentation/statistics/21.0/en/client/Manuals/IBM_SPSS_Statistics_Command_Syntax_Reference.pdf
--
IMNSHO the Universals section is mandatory reading.  
If you can read it and understand it then much of the remaining path will be much more accessible.
Presently you do not have comprehension of the role of TEMPORARY otherwise you would not have posted your current question.
While VECTOR/LOOP is extremely useful it is overkill for your requirements.

DO IF (your conditional ).
COUNT newvar=varlist (" ").
END IF.
Much easier to code/explain/maintain...




Bruce Weaver wrote
FM = Fine Manual, although there is occasionally some debate about whether it is really fine.
RTFM = Read The FM.

You might also see (mainly in Jon's posts) CSR(M).  This stands for Command Syntax Reference Manual, which is the official name for the FM.

HTH.


huang jialin wrote
David,

Thanks for your comments. I am trying to count blanks in a series of
variables for a single row/case.

BTW, What do you mean by FM?

Thanks.

Sincerely,
Jialin Huang



On Tue, Dec 4, 2012 at 9:28 AM, David Marso <[hidden email]> wrote:

> EXECUTE does NOT produce output!
> What do you expect this code to do?
> For an easier path see
> DO IF and COUNT.
> Rather more accessible for what it appears you are attempting to achieve.
> You would do well to review to Universals section of the FM before
> proceeding much further in your exploration of SPSS.  It will fill in some
> obvious fundamental gaps in your current understanding.
>
>
> huang jialin wrote
> > Hi everyone,
> >
> > I was trying to run the following syntax, but SPSS did not produce any
> > results at all. What would you recommend to change? Your inputs will be
> > appreciated. Thanks.
> >
> >
> > TEMPORARY.
> > SELECT IF (ID=21012 OR ID=21013 OR ID=21125).
> > VECTOR item=t1r1 to t1r55.
> > COMPUTE BME=0.
> > LOOP #i=1 to 55.
> >     IF (item(#i)=" ") BME=BME+1.
> > END LOOP.
> > EXECUTE.
> >
> > Sincerely,
> > Jialin Huang
>
>
>
>
>
> -----
> Please reply to the list and not to my personal email.
> Those desiring my consulting or training services please feel free to
> email me.
> --
> View this message in context:
> http://spssx-discussion.1045642.n5.nabble.com/TEMPORARY-SELECT-IF-tp5716642p5716643.html
> Sent from the SPSSX Discussion mailing list archive at 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?"
Reply | Threaded
Open this post in threaded view
|

Re: TEMPORARY SELECT IF

Bruce Weaver
Administrator
I fear you got the wrong end of the stick, David.  I was not casting aspersions at the SPSS FM.  I agree that it is generally fine.  I was simply referring to the fact that *some folks* in the world of newsgroups and mailing lists interpret the third letter in RTFM as something other than "fine", regardless of which manual it is, or how fine it might.  As this is suppose to be a G-Rated mailing list, I'll say no more!  ;-)


David Marso wrote
Compared to most software documentation the SPSS flavor is pretty fine.
--
ftp://public.dhe.ibm.com/software/analytics/spss/documentation/statistics/21.0/en/client/Manuals/IBM_SPSS_Statistics_Command_Syntax_Reference.pdf
--
IMNSHO the Universals section is mandatory reading.  
If you can read it and understand it then much of the remaining path will be much more accessible.
Presently you do not have comprehension of the role of TEMPORARY otherwise you would not have posted your current question.
While VECTOR/LOOP is extremely useful it is overkill for your requirements.

DO IF (your conditional ).
COUNT newvar=varlist (" ").
END IF.
Much easier to code/explain/maintain...




Bruce Weaver wrote
FM = Fine Manual, although there is occasionally some debate about whether it is really fine.
RTFM = Read The FM.

You might also see (mainly in Jon's posts) CSR(M).  This stands for Command Syntax Reference Manual, which is the official name for the FM.

HTH.


huang jialin wrote
David,

Thanks for your comments. I am trying to count blanks in a series of
variables for a single row/case.

BTW, What do you mean by FM?

Thanks.

Sincerely,
Jialin Huang



On Tue, Dec 4, 2012 at 9:28 AM, David Marso <[hidden email]> wrote:

> EXECUTE does NOT produce output!
> What do you expect this code to do?
> For an easier path see
> DO IF and COUNT.
> Rather more accessible for what it appears you are attempting to achieve.
> You would do well to review to Universals section of the FM before
> proceeding much further in your exploration of SPSS.  It will fill in some
> obvious fundamental gaps in your current understanding.
>
>
> huang jialin wrote
> > Hi everyone,
> >
> > I was trying to run the following syntax, but SPSS did not produce any
> > results at all. What would you recommend to change? Your inputs will be
> > appreciated. Thanks.
> >
> >
> > TEMPORARY.
> > SELECT IF (ID=21012 OR ID=21013 OR ID=21125).
> > VECTOR item=t1r1 to t1r55.
> > COMPUTE BME=0.
> > LOOP #i=1 to 55.
> >     IF (item(#i)=" ") BME=BME+1.
> > END LOOP.
> > EXECUTE.
> >
> > Sincerely,
> > Jialin Huang
>
>
>
>
>
> -----
> Please reply to the list and not to my personal email.
> Those desiring my consulting or training services please feel free to
> email me.
> --
> View this message in context:
> http://spssx-discussion.1045642.n5.nabble.com/TEMPORARY-SELECT-IF-tp5716642p5716643.html
> Sent from the SPSSX Discussion mailing list archive at 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
>
--
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/).
Reply | Threaded
Open this post in threaded view
|

Re: TEMPORARY SELECT IF

huang jialin
David,

For the solution you provided, I can see it work for the first criterion, like IDs. However, how can I make it work for a series of variables? Because it is the main purpose I am trying to do.

Also, if I delete TEMPORARY, the rest of the syntax works fine. But I do not know how to use all the other data again. As I tried "FILTER OFF./ USE ALL.", which does not work as well.

Thanks.

Sincerely,
Jialin Huang


On Tue, Dec 4, 2012 at 1:24 PM, Bruce Weaver <[hidden email]> wrote:
I fear you got the wrong end of the stick, David.  I was not casting
aspersions at the SPSS FM.  I agree that it is generally fine.  I was simply
referring to the fact that *some folks* in the world of newsgroups and
mailing lists interpret the third letter in RTFM as something other than
"fine", regardless of which manual it is, or how fine it might.  As this is
suppose to be a G-Rated mailing list, I'll say no more!  ;-)



David Marso wrote
> Compared to most software documentation the SPSS flavor is pretty fine.
> --
> ftp://public.dhe.ibm.com/software/analytics/spss/documentation/statistics/21.0/en/client/Manuals/IBM_SPSS_Statistics_Command_Syntax_Reference.pdf
> --
> IMNSHO the Universals section is mandatory reading.
> If you can read it and understand it then much of the remaining path will
> be much more accessible.
> Presently you do not have comprehension of the role of TEMPORARY otherwise
> you would not have posted your current question.
> While VECTOR/LOOP is extremely useful it is overkill for your
> requirements.
>
> DO IF (your conditional ).
> COUNT newvar=varlist (" ").
> END IF.
> Much easier to code/explain/maintain...
>
>
>
> Bruce Weaver wrote
>> FM = Fine Manual, although there is occasionally some debate about
>> whether it is really fine.
>> RTFM = Read The FM.
>>
>> You might also see (mainly in Jon's posts) CSR(M).  This stands for
>> Command Syntax Reference Manual, which is the official name for the FM.
>>
>> HTH.
>>
>> huang jialin wrote
>>> David,
>>>
>>> Thanks for your comments. I am trying to count blanks in a series of
>>> variables for a single row/case.
>>>
>>> BTW, What do you mean by FM?
>>>
>>> Thanks.
>>>
>>> Sincerely,
>>> Jialin Huang
>>>
>>>
>>>
>>> On Tue, Dec 4, 2012 at 9:28 AM, David Marso <

>>> david.marso@

>>> > wrote:
>>>
>>>> EXECUTE does NOT produce output!
>>>> What do you expect this code to do?
>>>> For an easier path see
>>>> DO IF and COUNT.
>>>> Rather more accessible for what it appears you are attempting to
>>>> achieve.
>>>> You would do well to review to Universals section of the FM before
>>>> proceeding much further in your exploration of SPSS.  It will fill in
>>>> some
>>>> obvious fundamental gaps in your current understanding.
>>>>
>>>>
>>>> huang jialin wrote
>>>> > Hi everyone,
>>>> >
>>>> > I was trying to run the following syntax, but SPSS did not produce
>>>> any
>>>> > results at all. What would you recommend to change? Your inputs will
>>>> be
>>>> > appreciated. Thanks.
>>>> >
>>>> >
>>>> > TEMPORARY.
>>>> > SELECT IF (ID=21012 OR ID=21013 OR ID=21125).
>>>> > VECTOR item=t1r1 to t1r55.
>>>> > COMPUTE BME=0.
>>>> > LOOP #i=1 to 55.
>>>> >     IF (item(#i)=" ") BME=BME+1.
>>>> > END LOOP.
>>>> > EXECUTE.
>>>> >
>>>> > Sincerely,
>>>> > Jialin Huang
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> -----
>>>> Please reply to the list and not to my personal email.
>>>> Those desiring my consulting or training services please feel free to
>>>> email me.
>>>> --
>>>> View this message in context:
>>>> http://spssx-discussion.1045642.n5.nabble.com/TEMPORARY-SELECT-IF-tp5716642p5716643.html
>>>> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
>>>>
>>>> =====================
>>>> To manage your subscription to SPSSX-L, send a message to
>>>>

>>> LISTSERV@.UGA

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





-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/TEMPORARY-SELECT-IF-tp5716642p5716654.html
Sent from the SPSSX Discussion mailing list archive at 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

Reply | Threaded
Open this post in threaded view
|

Re: TEMPORARY SELECT IF

David Marso
Administrator
OK:
"However, how can I make it work for a series of variables?
Because it is the main purpose I am trying to do."

You need to clearly define your question rather than relying upon our guessing!
Have you bothered to read the FM on TEMPORARY, DO IF and FILTER?
What do you mean by " the rest of the syntax works fine. ".

I believe you are missing some obvious points about TEMPORARY!

huang jialin wrote
David,

For the solution you provided, I can see it work for the first criterion,
like IDs. However, how can I make it work for a series of variables?
Because it is the main purpose I am trying to do.

Also, if I delete TEMPORARY, the rest of the syntax works fine. But I do
not know how to use all the other data again. As I tried "FILTER OFF./ USE
ALL.", which does not work as well.

Thanks.

Sincerely,
Jialin Huang
<SNIP>
>
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?"
Reply | Threaded
Open this post in threaded view
|

Re: TEMPORARY SELECT IF

Bruce Weaver
Administrator
In reply to this post by huang jialin
I probably shouldn't do this, but I can't take it any more!  ;-)

DM wrote
For an easier path see
DO IF and COUNT.
Rather more accessible for what it appears you are attempting to achieve.
What David is suggesting is something like this:

DO IF ANY(ID,21012,21013,21125).
.  COUNT BME = t1r1 to t1r55 (" ").
END IF.
DESCRIPTIVES BME.


huang jialin wrote
Hi everyone,

I was trying to run the following syntax, but SPSS did not produce any
results at all. What would you recommend to change? Your inputs will be
appreciated. Thanks.


TEMPORARY.
SELECT IF (ID=21012 OR ID=21013 OR ID=21125).
VECTOR item=t1r1 to t1r55.
COMPUTE BME=0.
LOOP #i=1 to 55.
    IF (item(#i)=" ") BME=BME+1.
END LOOP.
EXECUTE.

Sincerely,
Jialin Huang
--
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/).
Reply | Threaded
Open this post in threaded view
|

Re: TEMPORARY SELECT IF

David Marso
Administrator
Give someone a fish... teach someone to fish ....
Gut and pan fry the critter while you are at it ;-)
--
Bruce Weaver wrote
I probably shouldn't do this, but I can't take it any more!  ;-)

DM wrote
For an easier path see
DO IF and COUNT.
Rather more accessible for what it appears you are attempting to achieve.
What David is suggesting is something like this:

DO IF ANY(ID,21012,21013,21125).
.  COUNT BME = t1r1 to t1r55 (" ").
END IF.
DESCRIPTIVES BME.


huang jialin wrote
Hi everyone,

I was trying to run the following syntax, but SPSS did not produce any
results at all. What would you recommend to change? Your inputs will be
appreciated. Thanks.


TEMPORARY.
SELECT IF (ID=21012 OR ID=21013 OR ID=21125).
VECTOR item=t1r1 to t1r55.
COMPUTE BME=0.
LOOP #i=1 to 55.
    IF (item(#i)=" ") BME=BME+1.
END LOOP.
EXECUTE.

Sincerely,
Jialin Huang
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?"
Reply | Threaded
Open this post in threaded view
|

Re: TEMPORARY SELECT IF

John F Hall
In reply to this post by Bruce Weaver

Bruce

 

Now you know what the F stands for in KDF9, a computer being designed by English Electric, which was called KD9 (Kidsgrove Development 9) until an interminable meeting to decide the eventual production name, during which the CEO declared, "I don't care if you call it the KD F******* 9!" and stormed out of the meeting.  The name stuck.

 

 

John F Hall (Mr)

 

Email:     [hidden email]

Website: www.surveyresearch.weebly.com

 

 

 

 

 

 

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Bruce Weaver
Sent: 04 December 2012 20:24
To: [hidden email]
Subject: Re: TEMPORARY SELECT IF

 

I fear you got the wrong end of the stick, David.  I was not casting aspersions at the SPSS FM.  I agree that it is generally fine.  I was simply referring to the fact that *some folks* in the world of newsgroups and mailing lists interpret the third letter in RTFM as something other than "fine", regardless of which manual it is, or how fine it might.  As this is suppose to be a G-Rated mailing list, I'll say no more!  ;-)

 

 

 

David Marso wrote

> Compared to most software documentation the SPSS flavor is pretty fine.

> --

> ftp://public.dhe.ibm.com/software/analytics/spss/documentation/statist

> ics/21.0/en/client/Manuals/IBM_SPSS_Statistics_Command_Syntax_Referenc

> e.pdf

> --

> IMNSHO the Universals section is mandatory reading.

> If you can read it and understand it then much of the remaining path

> will be much more accessible.

> Presently you do not have comprehension of the role of TEMPORARY

> otherwise you would not have posted your current question.

> While VECTOR/LOOP is extremely useful it is overkill for your

> requirements.

> 

> DO IF (your conditional ).

> COUNT newvar=varlist (" ").

> END IF.

> Much easier to code/explain/maintain...

> 

> 

> 

> Bruce Weaver wrote

>> FM = Fine Manual, although there is occasionally some debate about

>> whether it is really fine.

>> RTFM = Read The FM.

>> 

>> You might also see (mainly in Jon's posts) CSR(M).  This stands for

>> Command Syntax Reference Manual, which is the official name for the FM.

>> 

>> HTH.

>> 

>> huang jialin wrote

>>> David,

>>> 

>>> Thanks for your comments. I am trying to count blanks in a series of

>>> variables for a single row/case.

>>> 

>>> BTW, What do you mean by FM?

>>> 

>>> Thanks.

>>> 

>>> Sincerely,

>>> Jialin Huang

>>> 

>>> 

>>> 

>>> On Tue, Dec 4, 2012 at 9:28 AM, David Marso &lt;

 

>>> david.marso@

 

>>> &gt; wrote:

>>> 

>>>> EXECUTE does NOT produce output!

>>>> What do you expect this code to do?

>>>> For an easier path see

>>>> DO IF and COUNT.

>>>> Rather more accessible for what it appears you are attempting to

>>>> achieve.

>>>> You would do well to review to Universals section of the FM before

>>>> proceeding much further in your exploration of SPSS.  It will fill

>>>> in some obvious fundamental gaps in your current understanding.

>>>> 

>>>> 

>>>> huang jialin wrote

>>>> > Hi everyone,

>>>> >

>>>> > I was trying to run the following syntax, but SPSS did not

>>>> > produce

>>>> any

>>>> > results at all. What would you recommend to change? Your inputs

>>>> > will

>>>> be

>>>> > appreciated. Thanks.

>>>> >

>>>> >

>>>> > TEMPORARY.

>>>> > SELECT IF (ID=21012 OR ID=21013 OR ID=21125).

>>>> > VECTOR item=t1r1 to t1r55.

>>>> > COMPUTE BME=0.

>>>> > LOOP #i=1 to 55.

>>>> >     IF (item(#i)=" ") BME=BME+1.

>>>> > END LOOP.

>>>> > EXECUTE.

>>>> >

>>>> > Sincerely,

>>>> > Jialin Huang

>>>> 

>>>> 

>>>> 

>>>> 

>>>> 

>>>> -----

>>>> Please reply to the list and not to my personal email.

>>>> Those desiring my consulting or training services please feel free

>>>> to email me.

>>>> --

>>>> View this message in context:

>>>> http://spssx-discussion.1045642.n5.nabble.com/TEMPORARY-SELECT-IF-t

>>>> p5716642p5716643.html Sent from the SPSSX Discussion mailing list

>>>> archive at 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

>>>> 

 

 

 

 

 

-----

--

Bruce Weaver

[hidden email]

http://sites.google.com/a/lakeheadu.ca/bweaver/

 

"When all else fails, RTFM."

 

NOTE: My Hotmail account is not monitored regularly.

To send me an e-mail, please use the address shown above.

 

--

View this message in context: http://spssx-discussion.1045642.n5.nabble.com/TEMPORARY-SELECT-IF-tp5716642p5716654.html

Sent from the SPSSX Discussion mailing list archive at 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

Reply | Threaded
Open this post in threaded view
|

Re: TEMPORARY SELECT IF

Bruce Weaver
Administrator
In reply to this post by David Marso
Yeah, I know.  But I was afraid the OP was going to start eating the bait.  :-)


David Marso wrote
Give someone a fish... teach someone to fish ....
Gut and pan fry the critter while you are at it ;-)
--
Bruce Weaver wrote
I probably shouldn't do this, but I can't take it any more!  ;-)

DM wrote
For an easier path see
DO IF and COUNT.
Rather more accessible for what it appears you are attempting to achieve.
What David is suggesting is something like this:

DO IF ANY(ID,21012,21013,21125).
.  COUNT BME = t1r1 to t1r55 (" ").
END IF.
DESCRIPTIVES BME.


huang jialin wrote
Hi everyone,

I was trying to run the following syntax, but SPSS did not produce any
results at all. What would you recommend to change? Your inputs will be
appreciated. Thanks.


TEMPORARY.
SELECT IF (ID=21012 OR ID=21013 OR ID=21125).
VECTOR item=t1r1 to t1r55.
COMPUTE BME=0.
LOOP #i=1 to 55.
    IF (item(#i)=" ") BME=BME+1.
END LOOP.
EXECUTE.

Sincerely,
Jialin Huang
--
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/).