oppsum_grupp | R Documentation |
This function allows you to create a table with summary statistics for one variable over groups defined by another variable. The table will show the following summary statistics: the number of nonmissing observations, the average (mean), the median, the 25th and 75th percentiles, the standard deviation, the minimum, the maximum, and the number of missing observations.
oppsum_grupp(dataset, variable, by.var, export = NULL, norsk = NULL)
dataset |
Your dataset (a data.frame-type object). |
variable |
The variable for which you want summary statistics (should ideally be a numeric variable). |
by.var |
The variable that defines the groups over which the statistics are calculated (should ideally be a categorical variable with not more than 10 unique categories). |
export |
Should the result be made export-ready (TRUE/FALSE)? |
norsk |
Results in Norwegian (NB)? |
The result can be printed in an "export-ready" fashion, meaning it can be copied and pasted into a Word document and there transformed into a publication-quality table. The function will provide warnings in some cases where user selections might be problematic.
A data.frame or, if export function is switched on (export=TRUE), a printed out table formatted for easy export to MS Word.
## Not run:
# Load mtcars
data(mtcars)
# Simple
oppsum_grupp(dataset = mtcars,
variable = "drat",
by.var = "gear")
# With export function
result <- oppsum_grupp(dataset = mtcars,
variable = "mpg",
by.var = "cyl",
export = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.