xpssFrequencies: Simple descriptive statistics

Description Usage Arguments Details Author(s) Examples

View source: R/xpssFrequencies.R

Description

R Implementation of the SPSS Function FREQUENCIES.

Usage

1
2
3
4
5
6
xpssFrequencies(x, variables, missing = NULL, barchart = list(plot = FALSE,
  min = NULL, max = NULL, freq = NULL, percent = NULL), piechart = list(plot =
  FALSE, min = NULL, max = NULL, freq = NULL, percent = NULL, missing = FALSE),
  histogram = list(plot = FALSE, min = NULL, max = NULL, freq = NULL, percent
  = NULL, normal = FALSE), ntiles = NULL, percentiles = NULL,
  statistics = c("mean", "stddev", "minimum", "maximum"))

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 "NULL". Optionally it is possible to include user-defined missing values with "include".

barchart

plot a barchart. Default for plot is NULL. If plot is TRUE an default barchart will be plotted. Optional for customized barchart a list with the following arguments has to be assigned minimum(n), maximum(n) to bound lower and upper values which are not plotted. See notes for more.

piechart

plot a piechart. Default for plot is NULL. If plot is TRUE an default an default piechart will be plotted. Optional for customized piechart a list with the following arguments has to be assigned minimum(n), maximum(n) to bound lower and upper values which are not plotted. See notes for more.

histogram

plot a histogram. Default for plot is NULL. If plot is TRUE an default histogram will be plotted. Optional for customized histogram a list with the following arguments has to be assigned minimum(n), maximum(n) to bound lower and upper values which are not plotted. With normal a overlapping normal distrubtion line will drawn. Default is FALSE. See notes for more.

ntiles

divides the distribution in a specific percentage amount of categories. multiple dividing in distributions is allowed. Default is NULL.

percentiles

displays the value between customized percentiles. Default is NULL.

statistics

Method which enumerate the descriptive statistics. Default is mean, stddev, minimum, maximum. Optional arguments are all,kurtosis, median, mode, none, range, sekurt, semean, seskew, skewness, sum, variance.

Details

The xpssFrenquencies function provides a set of descriptive statistic tools. The function delivers frequency tables containing value labels, values, frequencies, percentages of the selected variables in the dataset. Furthermore, xpssFrequency supplies three types of visualization of categorical or continous numerical:

  1. barchart

  2. histogram

  3. piechart

It is possible to customize the graphics by indiviual parameters. If TRUE is set, the default graphic will be plotted.

individual graphic parameter (for all charts):

max=n Cut the amount of maximum till n elements.
min=n Cut the amount of n till minimum elements.
freq=n Displays the distrubtion in absolute values on the basis of a user-defined maxima, the maxima has to be higher then the maxima of the distribtion, freq=max(n) is the default. (except piechart).
percent=n Displays the distrubtion in relative values on the basis of a user-defined maxima, the maxima has to be higher then the maxima of the distribtion, percent=max(n) is the default. (except piechart).

individual graphic parameter (for histogram):

normal=T Draws a overlapping normal curve.

individual graphic parameter (for piechart):

missing=T Displays or excludes Missing Values.

statistics:

kurtosis calculates the bulge of the variable.
maxixmum displays the maximum of the variable.
mean calculates the arithmetic mean.
median calculates the median.
minimum displays the minimum of the variable.
mode displays the modal value of the variable.
none displays no statistics.
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.

Author(s)

Bastian Wiessner

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
data(fromXPSS)
xpssFrequencies(x=fromXPSS,
 variables=c("V5"))

xpssFrequencies(x=fromXPSS,
 variables=c("V3","V7_2"),
 ntiles=c(0.25,0.3),
 percentiles=c(0.23,0.46,0.88))

xpssFrequencies(x=fromXPSS,
 variables=c("V3","V7_2"),
 histogram=list(plot=TRUE))

 xpssFrequencies(x=fromXPSS,
 variables=c("V3"),
 piechart=list(plot=TRUE,min=0,max=2))

 xpssFrequencies(x=fromXPSS,
 variables=c("V3"),
 barchart=list(plot=TRUE,precent=50))

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