Description Usage Arguments Examples
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.
1 |
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. |
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.