Setting or retrieving weights of an event sequence object.
Event sequence objects can be weighted. Weights are used by other functions such as
seqecmpgroup to compute weighted statistics.
An event sequence object (
Numerical vector containing weights
seqeweight returns a numerical vector containing the weights associated to each event sequence.
Matthias Studer (with Gilbert Ritschard for the help page)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
##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.seqe <- seqecreate(biofam.seq, weighted=FALSE) ## Using the weights seqeweight(biofam.seqe) <- biofam$wp00tbgs ## Now seqefsub accoounts for weights unless weighted is set to FALSE fsubseq <- seqefsub(biofam.seqe, pMinSupport=0.01) ## Searching for weighted susbsequences which best ## discriminate the birth cohort discr <- seqecmpgroup(fsubseq, group=biofam$birthyr>=1940) plot(discr[1:15])
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.