cci: Complete case indicator

Description Usage Arguments Value Author(s) See Also Examples

View source: R/cci.R

Description

The complete case indicator is useful for extracting the subset of complete cases. The function cci(x) calls complete.cases(x). The companion function ici() selects the incomplete cases.

Usage

1
cci(x)

Arguments

x

An R object. Currently supported are methods for the following classes: mids.

Value

Logical vector indicating the complete cases.

Author(s)

Stef van Buuren, 2017.

See Also

complete.cases, ici, cc

Examples

1
2
3
4
cci(nhanes) # indicator for 13 complete cases
cci(mice(nhanes, maxit = 0))
f <- cci(nhanes[, c("bmi", "hyp")]) # complete data for bmi and hyp
nhanes[f, ] # obtain all data from those with complete bmi and hyp

Example output

Attaching package:miceThe following object is masked frompackage:stats:

    filter

The following objects are masked frompackage:base:

    cbind, rbind

 [1] FALSE  TRUE FALSE FALSE  TRUE FALSE  TRUE  TRUE  TRUE FALSE FALSE FALSE
[13]  TRUE  TRUE FALSE FALSE  TRUE  TRUE  TRUE FALSE FALSE  TRUE  TRUE FALSE
[25]  TRUE
 [1] FALSE  TRUE FALSE FALSE  TRUE FALSE  TRUE  TRUE  TRUE FALSE FALSE FALSE
[13]  TRUE  TRUE FALSE FALSE  TRUE  TRUE  TRUE FALSE FALSE  TRUE  TRUE FALSE
[25]  TRUE
   age  bmi hyp chl
2    2 22.7   1 187
5    1 20.4   1 113
7    1 22.5   1 118
8    1 30.1   1 187
9    2 22.0   1 238
13   3 21.7   1 206
14   2 28.7   2 204
15   1 29.6   1  NA
17   3 27.2   2 284
18   2 26.3   2 199
19   1 35.3   1 218
20   3 25.5   2  NA
22   1 33.2   1 229
23   1 27.5   1 131
24   3 24.9   1  NA
25   2 27.4   1 186

mice documentation built on Nov. 24, 2021, 5:06 p.m.

Related to cci in mice...