No cases after temporary select if

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

No cases after temporary select if

John F Hall

I was checking numbers after finding duplicate cases from both 2015 and 2016  in my cumulative file for British Social Attitudes.  The file is OK now, but can anyone explain what happened here? 

 

use all.

temp.

select if ((caseid ge 99959) and (caseid le 104286)).

freq rsex.

 

 

Person 1 SEX

 

Frequency

Percent

Valid Percent

Cumulative Percent

Valid

Male

1904

44.0

44.0

44.0

Female

2424

56.0

56.0

100.0

Total

4328

100.0

100.0

 

 

 

 

use all.

temp.

select if ((caseid lt 99959) and (caseid gt 104286)).

freq rsex.

 

 

Warnings

No cases were input to this procedure. Either there are none in the working data file or all of them have been filtered out.

Execution of this command stops.

 

 

 

 

 

John F Hall  MA (Cantab) Dip Ed (Dunelm)

[Retired academic survey researcher]

 

Email:          [hidden email]

Website:     Journeys in Survey Research

Course:       Survey Analysis Workshop (SPSS)

Research:   Subjective Social Indicators (Quality of Life)

 

===================== 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: No cases after temporary select if

John F Hall

Chris

I know, but the commands work if used in reverse order.  The first command specifies all cases inside a range, the second, all cases outside.  USE ALL should  restore all cases, no?   New file has 102900 cases and 11588 variables and will be uploaded to UKDS and Natcen once I've sorted the glitches in incorrect measurement levels and some leftover variable labelling from early waves.

John

 

John F Hall  MA (Cantab) Dip Ed (Dunelm)

[Retired academic survey researcher]

 

Email:          [hidden email]

Website:     Journeys in Survey Research

Course:       Survey Analysis Workshop (SPSS)

Research:   Subjective Social Indicators (Quality of Life)

 

From: Chris Stride <[hidden email]>
Sent: 22 July 2018 10:19
To: John F Hall <[hidden email]>
Subject: RE: No cases after temporary select if

 

You used and rather than or!


From: [hidden email]
Sent: ‎22/‎07/‎2018 08:58
To: [hidden email]
Subject: No cases after temporary select if

I was checking numbers after finding duplicate cases from both 2015 and 2016  in my cumulative file for British Social Attitudes.  The file is OK now, but can anyone explain what happened here? 

 

use all.

temp.

select if ((caseid ge 99959) and (caseid le 104286)).

freq rsex.

 

 

Person 1 SEX

 

Frequency

Percent

Valid Percent

Cumulative Percent

Valid

Male

1904

44.0

44.0

44.0

Female

2424

56.0

56.0

100.0

Total

4328

100.0

100.0

 

 

 

 

use all.

temp.

select if ((caseid lt 99959) and (caseid gt 104286)).

freq rsex.

 

 

Warnings

No cases were input to this procedure. Either there are none in the working data file or all of them have been filtered out.

Execution of this command stops.

 

 

 

 

 

John F Hall  MA (Cantab) Dip Ed (Dunelm)

[Retired academic survey researcher]

 

Email:          [hidden email]

Website:     Journeys in Survey Research

Course:       Survey Analysis Workshop (SPSS)

Research:   Subjective Social Indicators (Quality of Life)

 

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

===================== 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: No cases after temporary select if

David Marso-2
In reply to this post by John F Hall
Of course the last selection will result in null set. Put down the beer my friend.

=====================
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: No cases after temporary select if

John F Hall
OK, I surrender.  Too early for beer, but village fête on today.  Just sorting dozens of variables with incorrect measurement levels caused by either SPSS heuristics or automatic archiving software at UKDS.

John F Hall  MA (Cantab) Dip Ed (Dunelm)
[Retired academic survey researcher]

Email:          [hidden email]
Website:     Journeys in Survey Research
Course:       Survey Analysis Workshop (SPSS)
Research:   Subjective Social Indicators (Quality of Life)

-----Original Message-----
From: SPSSX(r) Discussion <[hidden email]> On Behalf Of David Marso
Sent: 22 July 2018 10:21
To: [hidden email]
Subject: Re: No cases after temporary select if

Of course the last selection will result in null set. Put down the beer my friend.

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

=====================
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: No cases after temporary select if

David Marso
Administrator
As Chris Stride mentioned, you needed OR rather than AND.

~(A & B) IFF ~A V ~B.

Philosophy 101.



John F Hall wrote
> OK, I surrender.  Too early for beer, but village fête on today.  Just
> sorting dozens of variables with incorrect measurement levels caused by
> either SPSS heuristics or automatic archiving software at UKDS.
>
> John F Hall  MA (Cantab) Dip Ed (Dunelm)
> [Retired academic survey researcher]
>
> Email:          

> johnfhall@

>  
> Website:     Journeys in Survey Research
> Course:       Survey Analysis Workshop (SPSS)
> Research:   Subjective Social Indicators (Quality of Life)
>
> -----Original Message-----
> From: SPSSX(r) Discussion &lt;

> SPSSX-L@.UGA

> &gt; On Behalf Of David Marso
> Sent: 22 July 2018 10:21
> To:

> SPSSX-L@.UGA

> Subject: Re: No cases after temporary select if
>
> Of course the last selection will result in null set. Put down the beer my
> friend.
>
> =====================
> 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
>
> =====================
> 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





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

Re: No cases after temporary select if

John F Hall
In reply to this post by David Marso-2

Once I'd got rid of the duplicate cases, there was a further problem of serial numbers: 27000001 ff for 2015 2800001 ff for 2016 which put the years out of sequence when sorting, so caseid was recalculated after the sort. 

 

do if (year eq 2016) .

compute newsserial = sserial-2520000.

else if (year eq 2015) .

compute newsserial = sserial-24300000.

else if (year ge 1983 and year le 2014).

compute newsserial = sserial.

end if.

sort cases by year (d) caseid (a).

compute caseid = $casenum.

freq rsex.

 

Person 1 SEX

 

Frequency

Percent

Valid Percent

Cumulative Percent

Valid

Male

45333

44.1

44.1

44.1

Female

57567

55.9

55.9

100.0

Total

102900

100.0

100.0

 

 

The moules/frîtes at the fête were excellent, as was the beer.

 

John F Hall  MA (Cantab) Dip Ed (Dunelm)

[Retired academic survey researcher]

 

Email:          [hidden email]

Website:     Journeys in Survey Research

Course:       Survey Analysis Workshop (SPSS)

Research:   Subjective Social Indicators (Quality of Life)

 

-----Original Message-----
From: John F Hall <[hidden email]>
Sent: 22 July 2018 12:21
To: 'David Marso' <[hidden email]>; '[hidden email]' <[hidden email]>
Subject: RE: No cases after temporary select if

 

OK, I surrender.  Too early for beer, but village fête on today.  Just sorting dozens of variables with incorrect measurement levels caused by either SPSS heuristics or automatic archiving software at UKDS.

 

John F Hall  MA (Cantab) Dip Ed (Dunelm) [Retired academic survey researcher]

 

Email:          [hidden email]

Website:     Journeys in Survey Research

Course:       Survey Analysis Workshop (SPSS)

Research:   Subjective Social Indicators (Quality of Life)

 

-----Original Message-----

From: SPSSX(r) Discussion <[hidden email]> On Behalf Of David Marso

Sent: 22 July 2018 10:21

To: [hidden email]

Subject: Re: No cases after temporary select if

 

Of course the last selection will result in null set. Put down the beer my friend.

 

=====================

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

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