Syntax to get save all subjects/people with complete data

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

Syntax to get save all subjects/people with complete data

3J LEMA
Dear SPSS Users,

My rows are people who participated in the survey with around 50 items(placed in the columns).  Some people did not bother to indicate their response in the survey - these are missing values or blanks in my SPSS file.  May I know the syntax on how to save another SPSS file so that it contains only the complete data?

Thank you for your help.

Lema
===================== 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: Syntax to get save all subjects/people with complete data

Nkem Ntonghanwah

*If wish to exclude all rows with missing values for one or more variables from variable Q1 to variable Q50
Use.

FILTER OFF.
USE ALL.
SELECT IF (NMISS(Q1 TO Q50)>0).
EXECUTE.

*The save in a new data file.

*A better option is to copy the selected case into a new data set.

DATASET COPY  CleanFile.
DATASET ACTIVATE  CleanFile.
FILTER OFF.
USE ALL.
SELECT IF (NMISS(Q1 TO Q50)>0).
EXECUTE.

*Alternative for single variables eg. Q4 .
USE ALL.
SELECT IF (NVALID(Q4)=0).
EXECUTE.

OR
FILTER OFF.
USE ALL.
SELECT IF (NMISS(Q_site)>0).
EXECUTE.


On Sat, Jun 13, 2020 at 8:48 PM 3J LEMA <[hidden email]> wrote:
Dear SPSS Users,

My rows are people who participated in the survey with around 50 items(placed in the columns).  Some people did not bother to indicate their response in the survey - these are missing values or blanks in my SPSS file.  May I know the syntax on how to save another SPSS file so that it contains only the complete data?

Thank you for your help.

Lema
===================== 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: Syntax to get save all subjects/people with complete data

spss.giesel@yahoo.de
In reply to this post by 3J LEMA
Hi, Lema,

if you want the complete cases and if your items are numeric you can use:

COMPUTE NotValid = NMISS(Item1 TO Item50).
SELECT IF NotValid = 0.
EXECUTE.
SAVE OUTFILE = "...\CompleteCases.sav".

The syntax reference Guide says:

"COMPUTE determines the number of missing values for each case. For each case without missing values, the value of NotValid is 0. For each case with one missing value, the value of NotValid is 1, and so on. Both system- and user-missing values are counted."

Good luck,
Mario

Munich, Germany


Am Sonntag, 14. Juni 2020, 02:48:14 MESZ hat 3J LEMA <[hidden email]> Folgendes geschrieben:


Dear SPSS Users,

My rows are people who participated in the survey with around 50 items(placed in the columns).  Some people did not bother to indicate their response in the survey - these are missing values or blanks in my SPSS file.  May I know the syntax on how to save another SPSS file so that it contains only the complete data?

Thank you for your help.

Lema
===================== 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: Syntax to get save all subjects/people with complete data

Art Kendall
SPSS has many ways of dealing with missing data.  What is the context for
this LISTWISE deletion?
Why not just have user-missing values?
How will your reasoning take into account that some people did not not
respond to some/all of the items?

You use the term "items"   are these items meant to be parts of summative
scales, e.g, attitudes, knowledge, etc.?
or are you just using another word for 'variables' or 'columns'?

COMPUTE NotValid = NMISS(Item1 TO Item50).
FREQUENCIES VARIABLES = NotValid.
SELECT IF NotValid = 0.
EXECUTE. * not needed'.
SAVE OUTFILE = "...\CompleteCases.sav".





-----
Art Kendall
Social Research Consultants
--
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
Art Kendall
Social Research Consultants