Learn R Programming

TraMineR (version 2.2-10)

ex2: Example data sets with weighted and unweighted sequence data

Description

Example data sets used to demonstrate the handling of weights. The 'ex2.weighted' data set contains 6 sequences with weights inflating to 100 sequences (sum of weights is 100). The second data frame 'ex2.unweighted' contains the corresponding 100 sequences.

The sequences are, in both data frames, in the 'seq' column, and weights in the 'weight' column of 'ex2.weighted'.

The alphabet is made of four possible states: A, B, C and D.

These data sets are mainly intended to test and illustrate the handling of weights in TraMineR's functions. Weighted results obtained with 'ex2.weighted' data set should be exactly the same as unweighted results obtained with the 'ex2.unweighted' data set.

Usage

data(ex2)

Arguments

Format

The command data(ex2) generates two data frames:
ex2.weighted: a data frame with 6 rows, 1 variable containing sequences as character strings, 1 weight variable.
ex2.unweighted: a data frame with 100 rows, 1 variable containing sequences as character strings.

Examples

Run this code
data(ex2)

ex2w.seq <- seqdef(ex2.weighted, 1, weights=ex2.weighted$weight)
ex2u.seq <- seqdef(ex2.unweighted)

Run the code above in your browser using DataLab