calcularResumenDatosTabulados {RcmdrPlugin.TeachStat}R Documentation

Summary statistics for tabulated data

Description

calcularResumenDatosTabulados performs the main statistical summary for tabulated data (mean, standard deviation, coefficient of variation, skewness, kurtosis, quantile and mode) are calculated. Also it allows to obtain the frequency table (with classmark, amplitude and density).

Usage

calcularResumenDatosTabulados(l_inf, l_sup, ni, 
                              statistics = c("mean", "sd", "se(mean)", "IQR",
                              "quantiles", "cv", "skewness", "kurtosis"),
                              quantiles = c(0, 0.25, 0.5, 0.75, 1), 
                              tablaFrecuencia = FALSE)

Arguments

l_inf

numeric vector with the lower limit of each interval.

l_sup

numeric vector with the upper limit of each interval.

ni

numeric vector with the frequency of occurrence of values in the range between the lower limit and upper limit [l_inf [i-1], l_sup [i]).

statistics

any of "mean", "sd", "se(mean)", "quantiles", "cv" (coefficient of variation - sd/mean), "skewness", "kurtosis" or "mode"; defaulting to c("mean", "sd", "quantiles", "IQR").

quantiles

quantiles to report; by default is c(0, 0.25, 0.5, 0.75, 1).

tablaFrecuencia

logical value indicating whether or not to display the frequency table, by default is FALSE.

Details

calcularResumenDatosTabulados performs an analysis of tabulated data (frequently used in statistics when the number of distinct values is large or when dealing with continuous quantitative variables), represented by a table of statistics (arithmetic mean, standard deviation, interquartile range, coefficient of variation, asymmetry, kurtosis, and quantile).

It also allows to show the frequency table of the tabulated variable by selecting tablaFrecuencia=TRUE. The class mark, amplitude and density are added to the frequency table.

The LOWER LIMIT or L[i-1] and UPPER LIMIT or L[i] vectors, represent the data of continuous quantitative variables in class intervals of the form [L[i-1], L[i]) where i = 1, .. ., k.

Value

calcularResumenDatosTabulados() returns a list of two elements:

.numsummary

an object of class "numSummary" containing the numerical summary of the tabulated variable.

.table

a matrix containing the values of the frequency table.

See Also

cut

Examples


data(cars93)
cortes <- seq(from=1500, to=4250, by=250)
aa <- cut( cars93$Weight, breaks=cortes, dig.lab=4)
ni <- table(aa)
l_inf <- cortes[-length(cortes)]
l_sup <- cortes[-1]
agrup <- data.frame(l_inf,l_sup,ni)
head(agrup)

calcularResumenDatosTabulados(agrup$l_inf, agrup$l_sup, agrup$Freq)
calcularResumenDatosTabulados(agrup$l_inf, agrup$l_sup, agrup$Freq, tabla=TRUE)

bb <- calcularResumenDatosTabulados(agrup$l_inf, agrup$l_sup, agrup$Freq,
                                    statistics=c("mean","mode") )
bb
str(bb)
class(bb$.summary)
class(bb$.table)

[Package RcmdrPlugin.TeachStat version 1.1.3 Index]