Learn R Programming

mice (version 2.7)

cci: Extracts (in)complete case indicator

Description

Extracts (in)complete case indicator

Usage

## S3 method for class 'data.frame':
cci(x)
## S3 method for class 'matrix':
cci(x)
## S3 method for class 'mids':
cci(x)
## S3 method for class 'data.frame':
ici(x)
## S3 method for class 'matrix':
ici(x)
## S3 method for class 'mids':
ici(x)

Arguments

x
An R object. Currently supported are methods for the following classes: mids, data.frame and matrix. In addition, x can be a vector of any kind.

Value

  • A logical vector indicating the complete and the incomplete cases, with a length of nrow(x) if x is a data.frame or matrix, and with length length(x) in other cases.

Details

This array is useful for extracting subsets of the complete and incomplete data. Missing values in x are coded as NA.

See Also

na.omit, cc, ic, code{ccn}, code{link{icn}}

Examples

Run this code
cci(nhanes) # indicator for 13 complete cases 
  ici(nhanes) # indicator for 12 rows with incomplete cases 
  f <- cci(nhanes[,c("bmi","hyp")]) # complete data for bmi and hyp
  nhanes[f,] # obtain all data from those with complete bmi and hyp

Run the code above in your browser using DataLab