Description Usage Arguments Details Author(s) Examples
View source: R/xpssFrequencies.R
R Implementation of the SPSS Function FREQUENCIES
.
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"))
|
x |
a (non-empty) data.frame or input data of class |
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 |
barchart |
plot a barchart. Default for |
piechart |
plot a piechart. Default for |
histogram |
plot a histogram. Default for |
ntiles |
divides the distribution in a specific percentage amount of categories. multiple dividing in distributions is allowed. Default is |
percentiles |
displays the value between customized percentiles. Default is |
statistics |
Method which enumerate the descriptive statistics. Default is |
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:
barchart
histogram
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. |
Bastian Wiessner
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))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.