Does not delete rows containing NAs, but does add details concerning the distribution of the response variable if options(na.detail.response=TRUE). This na.action is primarily for use with describe.formula.

na.keep(mf)

Arguments

mf

a model frame

Value

the same model frame with the "na.action" attribute

Author

Frank Harrell
Department of Biostatistics
Vanderbilt University
fh@fharrell.com

Examples

options(na.action="na.keep", na.detail.response=TRUE)
x1 <- runif(20)
x2 <- runif(20)
x2[1:4] <- NA
y <- rnorm(20)
describe(y ~ x1*x2)
#> y ~ x1 * x2 
#> 
#>  3  Variables      20  Observations
#> --------------------------------------------------------------------------------
#> y 
#>        n  missing distinct     Info     Mean  pMedian      Gmd      .05 
#>       20        0       20        1   0.5325   0.4939    1.119  -0.8197 
#>      .10      .25      .50      .75      .90      .95 
#>  -0.4727  -0.1475   0.4853   1.0986   1.6863   2.1644 
#> 
#> -1.16574883123691 (1, 0.05), -0.801519724681961 (1, 0.05), -0.436144476347289
#> (1, 0.05), -0.343153920303788 (1, 0.05), -0.209102198192578 (1, 0.05),
#> -0.126904017137299 (1, 0.05), -0.109327479845157 (1, 0.05), 0.0974798286223241
#> (1, 0.05), 0.230709584804438 (1, 0.05), 0.249672556336925 (1, 0.05),
#> 0.720971343417438 (1, 0.05), 0.757439171202452 (1, 0.05), 0.777161056708044 (1,
#> 0.05), 1.0633707135635 (1, 0.05), 1.09064766183607 (1, 0.05), 1.12238112989498
#> (1, 0.05), 1.57060265007158 (1, 0.05), 1.63438625444144 (1, 0.05),
#> 2.15333898664332 (1, 0.05), 2.373837071297 (1, 0.05)
#> --------------------------------------------------------------------------------
#> x1 
#>        n  missing distinct     Info     Mean  pMedian      Gmd      .05 
#>       20        0       20        1   0.4655   0.4583   0.3036   0.1442 
#>      .10      .25      .50      .75      .90      .95 
#>   0.1640   0.2960   0.4576   0.6545   0.7831   0.8481 
#> 
#> 0.0154153716284782 (1, 0.05), 0.150934895034879 (1, 0.05), 0.165450467262417
#> (1, 0.05), 0.179470645496622 (1, 0.05), 0.291054098401219 (1, 0.05),
#> 0.29762477427721 (1, 0.05), 0.314000332029536 (1, 0.05), 0.318190819351003 (1,
#> 0.05), 0.319687753682956 (1, 0.05), 0.425557632697746 (1, 0.05),
#> 0.489622781053185 (1, 0.05), 0.532547577284276 (1, 0.05), 0.561916371108964 (1,
#> 0.05), 0.572317101992667 (1, 0.05), 0.629931556759402 (1, 0.05),
#> 0.728267216356471 (1, 0.05), 0.738537542056292 (1, 0.05), 0.776514194672927 (1,
#> 0.05), 0.842133556725457 (1, 0.05), 0.961686386261135 (1, 0.05)
#> --------------------------------------------------------------------------------
#> x2 
#>        n  missing distinct     Info     Mean  pMedian      Gmd      .05 
#>       16        4       16        1   0.5522   0.5506   0.3769  0.09266 
#>      .10      .25      .50      .75      .90      .95 
#>  0.15564  0.23750  0.63616  0.85547  0.91802  0.93747 
#>                                                                          
#> Value      0.0178 0.1176 0.1937 0.2235 0.2422 0.3520 0.4467 0.6190 0.6533
#> Frequency       1      1      1      1      1      1      1      1      1
#> Proportion  0.062  0.062  0.062  0.062  0.062  0.062  0.062  0.062  0.062
#>                                                            
#> Value      0.7137 0.7529 0.8476 0.8790 0.8995 0.9366 0.9402
#> Frequency       1      1      1      1      1      1      1
#> Proportion  0.062  0.062  0.062  0.062  0.062  0.062  0.062
#> --------------------------------------------------------------------------------