50% off | Unlimited Data & AI Learning

Last chance! 50% off unlimited learning

Sale ends in


translateSPSS2R (version 1.0.0)

xpssFrequencies: Simple descriptive statistics

Description

R Implementation of the SPSS Function FREQUENCIES.

Usage

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)
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 mi
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
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,

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): rll{ 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): rll{ normal=T Draws a overlapping normal curve. } individual graphic parameter (for piechart): rll{ missing=T Displays or excludes Missing Values. } statistics: rll{ 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.}

Examples

Run this code
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))

Run the code above in your browser using DataLab