Learn R Programming

TraMineR (version 1.6-2)

seqstatf: State frequencies in the all sequence data set

Description

Frequency of each state of the alphabet in the all sequence data set.

Usage

seqstatf(seqdata, weighted = TRUE)

Arguments

seqdata
a sequence object as defined by the seqdef function.
weighted
if TRUE, frequencies account for the weights assigned to the state sequence object (see seqdef). Set to FALSE if you want ignore the weights. If no weights were assigned during the creation of the sequen

Value

  • a data.frame with as many rows as the number of states in the alphabet and two columns, one for the raw frequencies (Freq) and one for the percentage frequencies.

Details

The seqstatf function computes the (weighted) raw and percentage frequency of each state of the alphabet in seqdata, i.e the (weighted) sum of the occurences of a state in seqdata.

See Also

seqstatd for the state distribution by time point (position), seqistatd for the state distribution within each sequence.

Examples

Run this code
## Creating a sequence object from the actcal data set
data(actcal)
actcal.lab <- c("> 37 hours", "19-36 hours", "1-18 hours", "no work")
actcal.seq <- seqdef(actcal, 13:24, labels=actcal.lab)

## States frequencies
seqstatf(actcal.seq)

## Example with weights
data(ex1)
ex1.seq <- seqdef(ex1, 1:13, weights=ex1$weights)

## Unweighted
seqstatf(ex1.seq, weighted=FALSE)

## Weighted
seqstatf(ex1.seq, weighted=TRUE)

Run the code above in your browser using DataLab