calcular_frecuencia: Frequency distributions for qualitative variables

View source: R/estadisticadescriptiva.R

calcular_frecuenciaR Documentation

Frequency distributions for qualitative variables

Description

Performs frequency distribution for qualitative, nominal and/or ordinal variables. For ordinal variables, the requested quantile is calculated.

Usage

calcular_frecuencia(df.nominal, ordenado.frec = FALSE,df.ordinal,
                    cuantil.p = 0.5,iprint = TRUE, ...)

Arguments

df.nominal

data.frame with factor type components (including character type) that are interpreted as nominal variables.

ordenado.frec

table ordered frequencies depending on their frequency (only used for nominal variables).

df.ordinal

data.frame with factor type components (including character type) that are interpreted as ordinal variables.

cuantil.p

requested quantile value (only used for ordinal variables).

iprint

logical value indicating whether or not to display the frequency table.

...

further arguments to be passed to or from methods.

Value

calcular_frecuencia returns a list of three elements:

.nominal

a matrix containing the table of frequency distribution for nominal variables (ni = absolute frequencies and fi = relative frequencies).

.ordinal

a matrix containing the table of frequency distribution for ordinal variables (ni = absolute frequencies, fi = relative frequencies, Ni = absolute cumulative frequency, Fi = cumulative absolute frequencies).

df.cuantil

data frame containing the quantiles.

See Also

table , cumsum

Examples

data(cars93)
aa <- calcular_frecuencia(df.nominal=cars93["Type"], ordenado.frec=TRUE, df.ordinal=NULL, 
                          cuantil.p=0.5, iprint = TRUE)
calcular_frecuencia(df.nominal=NULL, ordenado.frec=TRUE, df.ordinal=cars93["Airbags"], 
                    cuantil.p=0.25, iprint = TRUE)
bb <- calcular_frecuencia(df.nominal=cars93["Type"], ordenado.frec=TRUE, 
                          df.ordinal=cars93["Airbags"], cuantil.p=0.25, iprint = FALSE)
str(bb)
bb

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