| descriptives | R Documentation |
Compute descriptive statistics of numeric variables of a data set (number of observations, minimum, maximum, mean, standard deviaiton). The output is printed as a LaTeX table that mimics the look of SPSS output.
descriptives(data, variables)
## S3 method for class 'descriptives_SPSS'
to_SPSS(object, digits = 2, ...)
## S3 method for class 'descriptives_SPSS'
print(x, version = r2spss_options$get("version"), ...)
data |
a data frame containing the variables. |
variables |
a character vector specifying numeric variables for which to compute descriptive statistics. |
object, x |
an object of class |
digits |
an integer giving the number of digits after the comma to be printed in the SPSS table. |
... |
additional arguments to be passed down to
|
version |
a character string specifying whether the table should
mimic the look of recent SPSS versions ( |
The print method first calls the to_SPSS method followed
by to_latex. Further customization can be done by calling
those two functions separately, and modifying the object returned by
to_SPSS.
An object of class "descriptives_SPSS" with the following components:
classesa character vector giving the (first) class of the variables of interest.
descriptivesa data frame containing the descriptive statistics.
nan integer giving the number of observations.
The to_SPSS method returns an object of class "SPSS_table"
which contains all relevant information in the required format to produce
the LaTeX table. See to_latex for possible components and
how to further customize the LaTeX table based on the returned object.
The print method produces a LaTeX table that mimics the look of SPSS
output.
LaTeX tables that mimic recent versions of SPSS (version = "modern")
may require several LaTeX compilations to be displayed correctly.
Andreas Alfons
# load data
data("Eredivisie")
# compute descriptive statistics for market value and age
descriptives(Eredivisie, c("MarketValue", "Age"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.