FAQ/cc - CBU statistics Wiki

Upload page content

You can upload content for the page named below. If you change the page name, you can also upload content for another page. If the page name is empty, we derive the page name from the file name.

File to load page content from
Page name
Comment
Type the odd characters out in each group: abz2a 125t7 HhHaHh year.s 5433r21 worl3d

location: FAQ / cc

Identifying complete cases in SPSS and R

Identifies complete cases using variables A and B. You will need to insert a comma separated list of your variable names in place of a,b in the NMISS statement. Incomplete cases are filtered out of all succeeding analyses. To enable deletion of incomplete cases the file is also sorted so that the complete cases are at the top of the file.

DEFINE MISS (!POS !CMDEND).
COMPUTE NM=NMISS(!1). 
EXE. 
COMPUTE NMC=0. 
IF (NM EQ 0) NMC=1. 
FILTER BY NMC. 
SORT CASES BY NMC (D). 
EXE. 
!ENDDEFINE.

This can then be run using a comma separated list of variable names.

MISS A,B.
EXE.

To use all cases in the file:

FILTER OFF.

In R the function na.omit extracts complete cases from the data frame. In the example below the data.frame, cc, contains complete cases.

x <- read.spss("raw65n.sav")
x1 <- data.frame(x)
cc <- na.omit(x1)