Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

seqeweight

Setting or retrieving weights of an event sequence object.


Description

Event sequence objects can be weighted. Weights are used by other functions such as seqefsub or seqecmpgroup to compute weighted statistics.

Usage

seqeweight(eseq, s)
seqeweight(eseq, s) <- value

Arguments

eseq

An event sequence object (seqelist).

value

Numerical vector containing weights

s

Deprecated. Use eseq instead.

Value

seqeweight returns a numerical vector containing the weights associated to each event sequence.

Author(s)

Matthias Studer (with Gilbert Ritschard for the help page)

Examples

##Starting with states sequences
##Loading data
data(biofam)
## Creating state sequences
biofam.seq <- seqdef(biofam,10:25,informat='STS')

## Creating event sequences from biofam
biofam.eseq <- seqecreate(biofam.seq, weighted=FALSE)

## Using the weights
seqeweight(biofam.eseq) <- biofam$wp00tbgs

## Now seqefsub accounts for weights unless weighted is set to FALSE
fsubseq <- seqefsub(biofam.eseq, pmin.support=0.01)

## Searching for weighted susbsequences which best
## discriminate the birth cohort
discr <- seqecmpgroup(fsubseq, group=biofam$birthyr>=1940)
plot(discr[1:15])

TraMineR

Trajectory Miner: a Toolbox for Exploring and Rendering Sequences

v2.2-1
GPL (>= 2)
Authors
Alexis Gabadinho [aut, cph], Matthias Studer [aut, cph] (<https://orcid.org/0000-0002-6269-1412>), Nicolas M"{u}ller [aut], Reto B"{u}rgin [aut], Pierre-Alexandre Fonta [aut], Gilbert Ritschard [aut, cre, cph] (<https://orcid.org/0000-0001-7776-0903>)
Initial release
2020-10-24

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.