Description Usage Format Source Examples

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.

1 |

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.

The brain of the TraMineR package team.

1 2 3 4 | ```
data(ex2)
ex2w.seq <- seqdef(ex2.weighted, 1, weights=ex2.weighted$weight)
ex2u.seq <- seqdef(ex2.unweighted)
``` |

```
TraMineR stable version 2.0-6 (Built: "Mon,)
Website: http://traminer.unige.ch
Please type 'citation("TraMineR")' for citation information.
[>] 4 distinct states appear in the data:
1 = A
2 = B
3 = C
4 = D
[>] state coding:
[alphabet] [label] [long label]
1 A A A
2 B B B
3 C C C
4 D D D
[>] sum of weights: 100 - min/max: 1/40
[>] 6 sequences in the data set
[>] min/max sequence length: 12/12
[>] 4 distinct states appear in the data:
1 = A
2 = B
3 = C
4 = D
[>] state coding:
[alphabet] [label] [long label]
1 A A A
2 B B B
3 C C C
4 D D D
[>] 100 sequences in the data set
[>] min/max sequence length: 12/12
```

TraMineR documentation built on Jan. 30, 2018, 3:01 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.