descript | R Documentation |
This function computes summary statistics for one or more than one variables, optionally by a grouping and/or split variable.
descript(..., data = NULL,
print = c("all", "default", "n", "nNA", "pNA", "m", "se.m", "var", "sd",
"min", "p25", "med", "p75", "max", "range", "iqr", "skew", "kurt"),
group = NULL, split = NULL, sort.var = FALSE, na.omit = FALSE, digits = 2,
as.na = NULL, write = NULL, append = TRUE, check = TRUE, output = TRUE)
... |
a numeric vector, matrix or data frame with numeric variables,
i.e., factors and character variables are excluded from |
data |
a data frame when specifying one or more variables in the
argument |
print |
a character vector indicating which statistical measures to be
printed on the console, i.e. |
group |
a numeric vector, character vector or factor as grouping variable.
Alternatively, a character string indicating the variable name
of the grouping variable in |
split |
a numeric vector, character vector or factor as split variable.
Alternatively, a character string indicating the variable name
of the split variable in |
sort.var |
logical: if |
na.omit |
logical: if |
digits |
an integer value indicating the number of decimal places to be used. |
as.na |
a numeric vector indicating user-defined missing values,
i.e. these values are converted to |
write |
a character string naming a file for writing the output into
either a text file with file extension |
append |
logical: if |
check |
logical: if |
output |
logical: if |
Returns an object of class misty.object
, which is a list with following
entries:
call |
function call |
type |
type of analysis |
data |
list with the input specified in |
args |
specification of function arguments |
result |
result table(s) |
Takuya Yanagida takuya.yanagida@univie.ac.at
Rasch, D., Kubinger, K. D., & Yanagida, T. (2011). Statistics in psychology - Using R and SPSS. John Wiley & Sons.
ci.mean
, ci.mean.diff
, ci.median
,
ci.prop
, ci.prop.diff
, ci.var
,
ci.sd
, freq
, crosstab
,
multilevel.descript
, na.descript
.
# Example 1a: Descriptive statistics for 'mpg'
descript(mtcars$mpg)
# Example 1b: Alternative specification using the 'data' argument
descript(mpg, data = mtcars)
# Example 2: Descriptive statistics, print results with 3 digits
descript(mtcars$mpg, digits = 3)
# Example 3a: Descriptive statistics for x1, print all available statistical measures
descript(mtcars$mpg, print = "all")
# Example 3b: Descriptive statistics for x1, print default plus median
descript(mtcars$mpg, print = c("default", "med"))
# Example 4a: Descriptive statistics for 'mpg', 'cyl', and 'disp'
descript(mtcars[, c("mpg", "cyl", "disp")])
# Example 4b: Alternative specification using the 'data' argument
descript(mpg:disp, data = mtcars)
# Example 5a: Descriptive statistics, analysis by 'vs' separately
descript(mtcars[, c("mpg", "cyl", "disp")], group = mtcars$vs)
# Example 5b: Alternative specification using the 'data' argument
descript(mpg:disp, data = mtcars, group = "vs")
# Example 6: Descriptive statistics, analysis by 'vs' separately, sort by variables
descript(mtcars[, c("mpg", "cyl", "disp")], group = mtcars$vs, sort.var = TRUE)
# Example 7: Descriptive statistics, split analysis by 'am'
descript(mtcars[, c("mpg", "cyl", "disp")], split = mtcars$am)
# Example 8a: Descriptive statistics,analysis by 'vs' separately, split analysis by 'am'
descript(mtcars[, c("mpg", "cyl", "disp")], group = mtcars$vs, split = mtcars$am)
# Example 8b: Alternative specification using the 'data' argument
descript(mpg:disp, data = mtcars, group = "vs", split = "am")
## Not run:
# Example 11a: Write results into a text file
descript(mtcars[, c("mpg", "cyl", "disp")], write = "Descript.txt")
# Example 11b: Write results into an Excel file
descript(mtcars[, c("mpg", "cyl", "disp")], write = "Descript.xlsx")
result <- descript(mtcars[, c("mpg", "cyl", "disp")], output = FALSE)
write.result(result, "Descript.xlsx")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.