View source: R/summary.quali.R
summary.quali | R Documentation |
DESCRIPCIO DE LA FUNCIO
## S3 method for class 'quali'
summary(
data,
x,
group = NULL,
include.NA = FALSE,
patt.NA = "NA",
format = "html",
nround = 1,
test = NULL,
show.pval = TRUE,
show.all = TRUE,
show.n = TRUE,
show.stat = FALSE,
byrow = FALSE,
sub.ht = TRUE,
var.tidy = TRUE
)
data |
data frame, list or environment (or object coercible by 'as.data.frame' to a data frame) containing the variables in the model. If they are not found in 'data', the variables are taken from 'environment(formula)'. |
x |
factor variable. |
group |
factor variable. Outcome |
format |
a character string; possible values are ht, r, no. Default value is "ht". |
nround |
integer indicating the number of decimal places (round) or significant digits (signif) to be used. Negative values are allowed (see ‘Details’). Default value is 2. |
test |
character string indicating the test to use. Possible values are 'Fisher','Chi'. Default value is NULL |
show.pval |
logical indicating whether p-value of overall groups significance ('p.overall' column) is displayed or not. Default value is TRUE. |
show.all |
logical indicating whether the 'ALL' column (all data without stratifying by groups) is displayed or not. Default value is FALSE if grouping variable is defined, and FALSE if there are no groups. |
show.n |
ogical indicating whether number of individuals analyzed for each row-variable is displayed or not in the 'descr' table. Default value is TRUE. |
byrow |
logical or NA. Percentage of categorical variables must be reported by rows (TRUE), by columns (FALSE) or by columns and rows to sum up 1 (NA). Default value is FALSE, which means that percentages are reported by columns (withing groups). |
# set.seed(1)
# data <- df <- data.frame(MUT = factor(c(rep("A", 12),rep("B",13))),
# var = factor(sample(c("Yes", "no"), 25, replace = T)))
# tab <- summary.quali(x = "var", data = df)
# summary.quali(group = "MUT",x = "var", data = df, show.all = F)
# tab <- summary.quali(group = "MUT",x = "var", data = df, byrow = T)
# kable(tab$summary,escape = F, row.names = F,align = "c", txt_caption = tab$txt_caption) %>%
# kable_styling(latex_options = c("striped","hold_position", "repeat_header"), font_size = 14) %>%
# row_spec(0,background = "#993489", color = "white")
# mtc_bis %>% summary.quali( x = gear, group = vs)
# summary.quali( mtc_bis, x = gear, group = vs)
# mtc_bis %>% summary.quali( x = "gear", group = "vs")
# summary.quali( mtc_bis, x = "gear", group = "vs")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.