calcular_frecuencia: Frequency distributions for qualitative variables

Description Usage Arguments Value See Also Examples

View source: R/estadisticadescriptiva.R

Description

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

Usage

1
2
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

1
2
3
4
5
6
7
8
9
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 Jan. 13, 2021, 7:54 p.m.