calcularResumenVariablesContinuas: Summary statistics for continuous variables

calcularResumenVariablesContinuasR Documentation

Summary statistics for continuous variables

Description

calcularResumenVariablesContinuas gives the main statistical summary for continuous variables (mean, standard deviation, coefficient of variation, skewness, kurtosis and quantiles). Also builds the frequency table (with classmark, amplitude and density).

Usage

calcularResumenVariablesContinuas(data,
                                  statistics = c("mean", "sd", "se(mean)", "IQR",
                                  "quantiles", "cv", "skewness", "kurtosis"),
                                  quantiles = c(0, 0.25, 0.5, 0.75, 1), groups = NULL,
                                  tablaFrecuencia = FALSE, cortes="Sturges", ...)

Arguments

data

data.frame with the continuous variables.

statistics

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

quantiles

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

groups

optional variable, typically a factor, to be used to partition the data. By default is NULL.

tablaFrecuencia

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

cortes

one of:

  • a numeric vector of two or more unique cut points,

  • a single number (greater than or equal to 2) giving the number of intervals into which data is to be cut,

  • a character string naming an algorithm to compute the number of intervals into which data is to be cut (see 'Details')

by default is Sturges.

...

further arguments to be passed to numSummary.

Details

calcularResumenVariablesContinuas performs a descriptive analysis of continuous variables (quantitative variables that take infinite distinct values into an interval), generating a table of statistics (arithmetic mean, standard deviation, interquartile range, coefficient of variation, skewness, kurtosis, and quantiles) optionally allowing the partition of the data by a factor variable (groups).

It also allows to show the frequency table of selected continuous variables by selecting tablaFrecuencia=TRUE. Moreover it also allows to divide the range of the variables into intervals given by the argument cortes (breaks). See more info in cut and in hist.

Value

calcularResumenVariablesContinuas returns a list of two elements:

.numsummary

an object of class "numSummary" containing the numerical summary of the continuous variables.

.table

a matrix containing the values of the frequency table.

See Also

numSummary, cut, hist

Examples

## Not run: 
data(cars93)
calcularResumenVariablesContinuas(data=cars93["FuelCapacity"],group=NULL)
calcularResumenVariablesContinuas(data=cars93["FuelCapacity"],group=cars93$Airbags)
bb <- calcularResumenVariablesContinuas(data=cars93["FuelCapacity"],group=cars93$Airbags,
                                        tablaFrecuencia=TRUE)
str(bb)
bb
bb$.summary
class(bb$.summary)

calcularResumenVariablesContinuas(data=cars93["MidPrice"], tablaFrecuencia=TRUE)
calcularResumenVariablesContinuas(data=cars93["MidPrice"], tablaFrecuencia=TRUE, cortes=5)
calcularResumenVariablesContinuas(data=cars93["MidPrice"], tablaFrecuencia=TRUE,
                                  cortes=c(7,14,21,28,63))
calcularResumenVariablesContinuas(data=cars93["MidPrice"], tablaFrecuencia=TRUE,
                                  cortes="Scott")                                
calcularResumenVariablesContinuas(data=cars93["MidPrice"], groups=cars93$Airbags, 
                                  tablaFrecuencia=TRUE, cortes=5)

## End(Not run)

RcmdrPlugin.TeachStat documentation built on Nov. 14, 2023, 5:08 p.m.