combi_cell {etable}R Documentation

Dichotomous and continuous variable combination cell function

Description

Calculates different statistics depending on the type of variable.

Usage

combi_cell(x, y, z, w, cell_ids, row_ids, col_ids, vnames, vars, n_min,
              digits=3, style=1)

Arguments

x

The x variable for calculations, if not using y

y

The y variable for calculations, if not using x

z

NOT USED

w

Weights for x or y variable.

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

Minimum n in the cell for useful calculation. Cells with n<n_min deliver no output.

digits

Integer indicating the number of significant digits.

style

Type of representation.

  • 1 N, Proportion, Median, Q1, Q3

  • 2 N, Proportion, Mean, SD

Author(s)

Andreas Schulz <ades-s@web.de>

Examples



sex     <- factor(rbinom(1000, 1, 0.4),  labels=c('Men', 'Women'))
height  <- rnorm(1000, mean=1.7, sd=0.1)
weight  <- rnorm(1000, mean=70, sd=5)
bmi     <- weight/height^2
event   <- factor(rbinom(1000, 1, 0.1), labels=c('no',  'yes'))
d<-data.frame(sex, height, weight, bmi, event)

tabular.ade(x_vars=names(d), cols=c('sex','ALL'), rnames=c('Gender'),
            data=d, FUN=combi_cell)



[Package etable version 1.3.1 Index]