miss_cell: Missing values cell function

Description Usage Arguments Author(s) Examples

View source: R/miss_cell.R

Description

Counting the number of missing values in each cell.

Usage

1
2
miss_cell(x, y, z, w, cell_ids, row_ids, col_ids, vnames, vars, n_min,
          pct = FALSE, digits = 0, prefix='', suffix='')

Arguments

x

The x variable

y

NOT USED

z

NOT USED

w

NOT USED (The number of missing will not be weighted!).

cell_ids

Index vector for selecting values in cell.

row_ids

NOT USED

col_ids

NOT USED

vnames

NOT USED

vars

NOT USED

n_min

NOT USED

pct

Logical asking whatever to draw absolute or relative frequency of missing values.

digits

Integer indicating the number of decimal places.

prefix

Free text added in each cell bevor results.

suffix

Free text added in each cell after results.

Author(s)

Andreas Schulz <ades-s@web.de>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
sex     <- factor(rbinom(1000, 1, 0.4),  labels=c('Men', 'Women'))
height  <- rnorm(1000, mean=1.66, sd=0.1)
height[which(sex=='Men')]<-height[which(sex=='Men')]+0.1
weight  <- rnorm(1000, mean=70, sd=5)
decades <- rbinom(1000, 3, 0.5)
decades <- factor(decades, labels=c('[35,45)','[45,55)','[55,65)','[65,75)'))
d<-data.frame(sex, decades, height, weight)
d$height[round(runif(250,1,1000))]<- NA
d$weight[round(runif(25 ,1,1000))]<- NA

tabular.ade(x_vars=c('height', 'weight'), xname=c('Height [m]','Weight [kg]'),
        cols=c('sex','decades','ALL'), cnames=c('Gender', 'Age decades'),
        data=d, FUN=miss_cell, prefix='Miss:')

etable documentation built on May 22, 2021, 5:07 p.m.