ld: Listwise deletion

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Listwise deletion

Usage

1
ld(mat)

Arguments

mat

a matrix or a dataframe

Details

This function implements the listwise deletion on a given dataset, removing all the rows or units containing at least one missing value

Value

The matrix/dataframe in input with the rows/units with missing values removed

Author(s)

Alessandro Barbiero, Giancarlo Manzi, Pier Alda Ferrari

See Also

meanimp, modeimp, medianimp

Examples

1
2
3
4
5
6
7
n<-10
m<-4
mat<-matrix(rnorm(n*m),n,m)
mat[c(3,6),1]<-NA
mat[10,2]<-NA
mat
ld(mat)

Example output

Loading required package: homals
Loading required package: sampling
Loading required package: mvtnorm
Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl_init' failed, running with rgl.useNULL = TRUE 
3: .onUnload failed in unloadNamespace() for 'rgl', details:
  call: fun(...)
  error: object 'rgl_quit' not found 
            [,1]       [,2]        [,3]        [,4]
 [1,]  0.9072428  1.2945645  0.58611798  0.11050595
 [2,] -0.3272897  0.5934294 -0.64420036  0.65428167
 [3,]         NA  0.3511400  0.06278335  0.40290164
 [4,]  1.1976259  0.8866322  0.76335671  0.81932553
 [5,]  2.5639706 -0.7339339  0.68164027  0.12846884
 [6,]         NA  2.2075620  0.13955061  0.08727724
 [7,]  0.3166348  0.6200734  0.02256115  0.24354689
 [8,] -0.7567373  0.2587236  0.68860419 -1.09723040
 [9,] -0.4273475 -0.6573919 -0.92416926 -1.20426796
[10,]  1.3392306         NA -0.39021714  0.57837263
           [,1]       [,2]        [,3]       [,4]
[1,]  0.9072428  1.2945645  0.58611798  0.1105060
[2,] -0.3272897  0.5934294 -0.64420036  0.6542817
[3,]  1.1976259  0.8866322  0.76335671  0.8193255
[4,]  2.5639706 -0.7339339  0.68164027  0.1284688
[5,]  0.3166348  0.6200734  0.02256115  0.2435469
[6,] -0.7567373  0.2587236  0.68860419 -1.0972304
[7,] -0.4273475 -0.6573919 -0.92416926 -1.2042680

ForImp documentation built on May 2, 2019, 8:17 a.m.