Description Usage Arguments Details Value Author(s) See Also Examples
tabkris_2
computes descriptive statistics for data
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | tabkris_2(
data,
names = NULL,
varint = NULL,
lang = "en",
method = NULL,
test = FALSE,
pres_quant = c("med"),
pres_quali = c("n", "per"),
default_method = c("cont", "bino", "cate", "ordo"),
default_test = c("stud", "chisq", "chisq", "chisq"),
explicit_na = FALSE,
digits = 2,
return_table = TRUE,
auto_detect = TRUE,
lev_co = 10,
verbose = FALSE
)
|
data |
Dataframe to describe or a "desctable" object |
names |
Vectors of variables to display in the final table, length of
|
varint |
Variable to stratify on, factor only |
lang |
Language to display, default |
method |
Vectors of variables to customize the methods used for description, length of data columns |
test |
Either a logical indicating statistical tests execution or a
vectors of variables to customize the tests, length of data columns.
Default |
pres_quant |
Descriptive statistics for quantitative variables. Possible
values are |
pres_quali |
Descriptive statistics for qualitative variables. Possible
values are |
default_method |
Default method to compute the table for each variable.
Default |
default_test |
Default test to apply for each variable type. Default
|
explicit_na |
Whether to display NA in description, Default |
digits |
Number of significant number to display, default |
return_table |
Whether to return a dataframe or an object to customize
option easily, default |
auto_detect |
Whether to automatically detect variable type,
transforming to factors numeric variable with moderate levels (< 10),
default |
lev_co |
Numeric. When auto_detect is |
verbose |
Logical. Display information about transformation of
variables. default |
The tabkris_2
function is a function to describe a set of
data. Main purpose is to create a typical table one in biomedical
litterature, either a patient characteristic table or population
characteristic table.
names
is a vector to name the variable of data. Default will use the
colnames of data.
varint
is a variable to stratify the analysis. It must be included
in the initial dataset. It will not be displayed in the final table if
chosen as the stratifying variable
lang
is useful to choose the language for the final display. The
default is english. French is also supported.
default_method
and method
are used to set the methods used
for display. default_method must be length 4, to set the default method for
continuous, binomial, categorical and ordered variable. method
must
be length of data columns, used to fine-tune every method for each
variable.
default_test
and test
are used to set the tests performed.
default_test must be lenght 4, to set the default method for continuous,
binomial, categorical and ordered variable. test
must be length of
data columns, used to fine-tune every test for each variable.
pres_quant
is used to set the display of quantitative variable.
mean (SD)
, median [IQR]
and range
are available,
default is median
.
pres_quali
is used to set the display of qualitative variable.
"n"
for number, "total"
to add "/ total" and "per"
for
percentages, default is "n / per"
.
explicit_na
is used to display.
digits
is the number of digits to display for numbers. Usually if
n < 100
, digits = 0
if 100< n < 200
, digits = 1
else digits = 2
.
return_table
choose if the user wants to directly display a table or
if the user wants to get an object with parametrable objects.
auto_detect
will test if each column can be coerced to a factor
(i.e. having between 2 and 10 levels) and change the type of variable if
so.
lev_co
will set the number of maximum levels to coerce a column in a
factor
Depending on argument return_table
, an object of class
data.frame, which is the descriptive table or an object of class
"desctable"
, which is a customizable object.
Yves Gallien yves.gallien@gmail.com, 2019
https://github.com/Ygall/CRUF for manual and examples.
1 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.