# xpssDescriptives: Simple descriptive statistics In translateSPSS2R: Toolset for Translating SPSS-Syntax to R-Code

## Description

R Implementation of the SPSS Function `Descriptives`

## Usage

 ```1 2 3``` ```xpssDescriptives(x, variables, missing = "variable", statistics = c("mean", "max", "min", "stddev"), save = FALSE, ztrans = list(varname = NULL, zname = NULL)) ```

## Arguments

 `x` a (non-empty) data.frame or input data of class `"xpssFrame"`. `variables` atomic character or character vector with the name of the variables. `missing` atomic character which specifiy the missing method. The method indicates what should happen when the data contains NAs. Default is `"variable"`. `statistics` atomic chracter or character vector which determine the descriptiv statistics. Default are `"mean"`, `"max"`, `"min"`, `"stddev"`. `save` logical indicator. TRUE adds the z-score of each variable to `x`. Default is FALSE. `ztrans` list which specifies variables for z-transformation and name of z-transformed variables. Read Details for further information.

## Details

The xpssDescriptives function provides a set of descriptive statistic tools.

`missing:`

 `variable` removes user-, and system-missing data explicitly for every variable. `listwise` performs a listwise-deletion. `include` includes all user-defined missing values.

`statistics:`

 `kurtosis` calculates the bulge of the variable. `max` displays the maximum of the variable. `mean` calculates the arithmetic mean, respectively the midpoint of the variable. `min` displays the minimum of the variable. `kurtosis` calculates the bulge of the variable. `range` displays the span between the minimum and the maximum value. `sekurtosis` calculates the standrard error of the bulge of the variable. `semean` displays the standard error of the arithmetic mean. `seskewness` calculates the standrard error of the inclination of the variable. `skewness` calculates the inclination of the variable. `stddev` displays the standard deviation of the variable. `sum` calculates the sum of each observation within the variable. `variance` displays the variance.

`ztrans` input, is a list with elements varname and zname. `varname` and `zname` are either atomic characters or character vectors.
It is necessary that either both parameters are filled or blank.

## Value

Output is a list object with descriptive statistic parameters. The specific outcomes of the selected variables are stored in a list object. Every variable is stored in a different list element.

If the parameter `save` is TRUE, a matrix with z-transformed values will be appended at the end of the list. If `ztrans` is blank, the name of the matrix will be Z*varname*. Otherwise whether `ztrans` is not empty the user specified description in `zname` will be the name of the z-transformed matrix of the variable `varname`.

Bastian Wiessner

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34``` ```data(fromXPSS) ## Analyzing Variable V5, Output contains default statistics xpssDescriptives(x=fromXPSS, variables="V5") ## Analyzing Variable V7_1, Output contains default statistics ## and z-score of Variable V7_1 xpssDescriptives(x=fromXPSS, variables="V7_1", save = TRUE) ## Analyzing Variable V7_2, Output contains default statistics ## and z-score of Variable V7_2 store in myZname xpssDescriptives(x=fromXPSS, variables="V7_2", save = TRUE, ztrans = list(varname = "V7_2", zname = "myZname")) ## Analyzing Variable V7_2, Output contains kurtosis, skewness, semean and mean ## missing values are included ## z-score get calculated and store in myZname xpssDescriptives(x=fromXPSS, variables="V7_2", statistics=c("kurtosis", "skewness", "semean", "mean"), missing="include", save = TRUE, ztrans = list(varname = "V7_2", zname = "myZname")) ```

translateSPSS2R documentation built on May 30, 2017, 4:31 a.m.