Description Usage Arguments Value Author(s) See Also Examples
The function produces summary tables for continuous
variables. The obtained tables can be used directly in R, with LaTeX
and HTML (by using the xtable
function) or Markdown
(e.g. by using the function kable
).
1 2 3 4 5 6 7 8 9 | summarize_numeric(data,
variables = names(data), variable.labels = labels, labels = NULL,
group = NULL, test = !is.null(group), colnames = NULL,
digits = 2, digits.pval = 3, smallest.pval = 0.001,
sep = !is.null(group), sanitize = TRUE,
drop = TRUE, show.NAs = any(is.na(data[, variables])),
## additional specific arguments
count = TRUE, mean_sd = TRUE, quantiles = TRUE,
incl_outliers = TRUE, ...)
|
data |
data set to be used. |
variables |
variables that should be included in the table.
For details see |
variable.labels, labels |
labels for the variables.
For details see |
group |
character specifying a grouping factor.
For details see |
test |
logical or charachter specifying test for group differences.
For details see |
colnames |
a vector of character strings of appropriate length.
For details see |
digits |
number of digits to round to. Per default all values are rounded to two digits. |
digits.pval |
number of significant digits used for p-values. |
smallest.pval |
determines the smallest p-value to be printed exactly.
For details see |
sep |
logical (default: |
sanitize |
logical (default: |
drop |
logical (default: |
show.NAs |
logical. Determines if the number of missings (NAs) is displayed as
a separate column. Per default, |
count |
(logical) indicator if number of complete cases ("n") should be
included in the table (default: |
mean_sd |
(logical) indicator if mean and standard deviation should be
included in the table (default: |
quantiles |
(logical) indicator if quantiles (including min and max) should be
included in the table (default: |
incl_outliers |
Per default we use |
... |
additional arguments. Currently not used. |
A special data.frame
with additional class summary
containing the computed statistics is returned from function
summarize
. Addtional attributes required for the
xtable.summary
or print.xtable.summary
function are contained as attributes. These are extracted using the
function get_option
.
Benjamin Hofner
For details see link{summarize}
and link{summarize_factor}
.
Conversion to LaTeX tables can be done using
xtable.summary
and print.xtable.summary
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | if (require("nlme")) {
## Use dataset Orthodont
data(Orthodont, package = "nlme")
## Get summary for continuous variables
summarize(Orthodont, type = "numeric")
## Change statistics to display
summarize(Orthodont, quantiles = FALSE, type = "numeric")
summarize(Orthodont, quantiles = FALSE, count = FALSE, type = "numeric")
summarize(Orthodont, mean_sd = FALSE, type = "numeric")
## for more examples see ?summarize
}
|
Loading required package: car
Loading required package: carData
Loading required package: xtable
Attaching package: 'papeR'
The following object is masked from 'package:utils':
toLatex
Loading required package: nlme
Factors are dropped from the summary
Factors are dropped from the summary
Factors are dropped from the summary
Factors are dropped from the summary
N Min Q1 Median Q3 Max
1 distance 108 16.5 22 23.75 26 31.5
2 age 108 8.0 9 11.00 13 14.0
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.