tableTest: Table Test

Description Usage Arguments Examples

View source: R/z_deprecated.R

Description

This function summarizes and tests the differences of numerical and dichotomous variables only across some factor. The summary number is either the mean of a numeric variable for the number and percentage of values that are the second of the two factors in a dichotomous variable. Missing values are removed before the summary statistic, but the number missing is not reported. Furthermore, a p-value is reported testing the differences of the means or counts across the groups factor. The p-value is derived from an ANOVA for continuous variables or from a chi-squared test via monte-carlo simulation using 100,000 bootstrap replicates.

Usage

1
tableTest(x, group, digits.mean = 2, digits.percentage = 0)

Arguments

x

Vector of data which to summarize. Should be used for numerical and dichotomous variables only.

group

The factor for which to test the x variable across.

digits.mean

The mean is rounded and displayed using this many digits.

digits.percentage

The percentage is rounded and displayed using this many digits.

Examples

1
2
3
4
5
X <- data.frame('some.continuous'=runif(300),'some.factor'=factor(rbinom(300,1,0.3)))
X$some.other.factor <- factor(rbinom(300,1,0.5))
tableTest(x=X$some.continuous,group=X$some.other.factor)
tableTest(x=X$some.factor,group=X$some.other.factor)
CBapply(X[ ,c('some.continuous','some.factor')],tableTest,group=X$some.other.factor)

cole-brokamp/CB documentation built on May 13, 2019, 8:49 p.m.