group-p: Adds proportion of occurrences to each level names

Description Usage Arguments Details Author(s) See Also Examples

Description

Adds the proportion of occurrences of each level to the corresponding level name.

Usage

1

Arguments

group

A group variable.

weights

Vector of weights of same length as the group variable.

Details

The group variable can be a factor or a numerical variable. In the latter case it is transformed to a factor.

Author(s)

Gilbert Ritschard

See Also

seqplot.

Examples

1
2
3
4
5
6
data(actcal)
actcal <- actcal[1:100,]
actcal.seq <- seqdef(actcal[,13:24])
seqdplot(actcal.seq, group=group.p(actcal$sex))

levels(group.p(actcal$sex, weights=runif(length(actcal$sex))))

Example output

Loading required package: TraMineR

TraMineR stable version 2.0-7 (Built: "Sat,)
Website: http://traminer.unige.ch
Please type 'citation("TraMineR")' for citation information.

TraMineRextras stable version 0.4.1 (Built: 2017-09-21)
Functions provided by this package are still in test
    and subject to changes in future releases.
 [>] 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
[1] "man (51.1%)"   "woman (48.9%)"

TraMineRextras documentation built on Feb. 1, 2018, 5:03 p.m.