This function takes a data frame of nominal variables and possible grouping, weighting and subset variables and provides a LaTeX table of descriptive statistics seperately per group and jointly for all observations, per variable
1 2 3 4 5 6 | tableNominal2(vars, weights = NA, subset = NA, group = NA,
miss.cat = NA, print.pval = c("none", "fisher", "chi2"),
pval.bound = 10^-4, fisher.B = 2000, vertical = TRUE, cap = "",
lab = "", col.tit.font = c("bf", "", "sf", "it", "rm"),
font.size = "tiny", longtable = TRUE, nams = NA, cumsum = FALSE,
varSizeN = "0.15", levSizeN = "0.05", ...)
|
vars |
A list of nominal variables |
weights |
Optional vector of weights of each observation |
subset |
Optional logical vector, indicates subset of observations to be used |
group |
Optional grouping vector |
miss.cat |
Vector specifying the factors in vars that should have their NAs transformed to a separate category |
pval.bound |
p-values below pval.bound are formatted as < pval.bound |
fisher.B |
Number of simulations to compute p-value for Fisher's exact test. Note that in the function fisher.test the option simulate.p.value is set to TRUE, unless fisher.B == Inf which asks for the exact computation |
vertical |
If TRUE, add vertical lines to the table, separating labels and groups, if applicable |
cap |
The caption of the resulting LaTeX table |
lab |
The label of the resulting LaTeX table |
col.tit.font |
Choose the font for the column titles here (default: boldface) |
font.size |
Font size for the generated table in LaTeX |
longtable |
If TRUE, function makes use of package longtable in LaTex to generate tables that span more than one page. If FALSE, generates a table in tabular environment |
nams |
A vector of strings, containing the names corresponding to the variables in vars, if vars is not a data frame but a list of variables. These are then the names that appear in the LaTeX table. This option is only kept for backward compatibility. |
cumsum |
f TRUE, the cumulative sums of the percentages are included for every level of the grouping variable |
varSizeN |
Size of the column containing the variables |
... |
Arguments pass through to print.xtable |
print.pvalAdd |
p-values of Fisher's exact or χ^2 test for a difference of distributions between groups to the table, if there is more than one group |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.