[Traminer-users] Nominal autocorrelation
Gilbert Ritschard
Gilbert.Ritschard at unige.ch
Mon Apr 30 09:34:43 CEST 2012
Hi Peter,
Using the seqformat() function to transform your sequences into SRS
(shifted-replicated sequence) form (see Ritschard & al., 2009), it is
easy to compute some nominal auto-association of any order. Here is an
example where we compute an auto-cv of order 1 (cv being Cramer's v).
libarary(TraMineR)
data(biofam)
biofam.srs <- seqformat(biofam[,10:25], from="STS", to="SRS")
nc <- ncol(biofam.srs)
x1 <- table(biofam.srs[,nc],biofam.srs[,nc-1])
chisq <- chisq.test(x1, correct=FALSE)$statistic
names(chisq) <- ""
cv1 <- sqrt(chisq/(sum(x1)*min(dim(x1)-1)))
print(cv1)
Reference for the SRS format:
Ritschard, G., Gabadinho, A., Studer, M. & Müller, N.S. (2009),
"Converting between various sequence representations", In Ras, Z. &
Dardzinska, A. (eds) /Advances in Data Management/. Series: /Studies in
Computational Intelligence/. Volume 223, pp. 155-175. Berlin: Springer.
(preprint available on the TraMineR page)
Cheer.
Gilbert
On 24-Apr-12 21:15, Peter Flom wrote:
>
> Good afternoon
>
> I just got TraMineR – what a great package! It’s going to save me a
> lot of time and effort.
>
> I have a data set with a bunch of sequences of nominal states (for
> now, anyway, 80 sequences, with each having one of two states, but it
> may also be necessary to do this with 4 states and more sequences)
>
> My client wants some nominal equivalent of autocorrelation. Looking
> through the documentation, the closest thing seems to be turbulence,
> or perhaps inverse of turbulence, but that’s per sequence, not per
> data set. Of course, I could find mean or median turbulence, or mean
> or median inverted turbulence, but I wondered if there is some already
> developed measure for what I want.
>
> Thanks in advance
>
> Peter
>
> Peter Flom
>
> Peter Flom Consulting
>
> http://www.statisticalanalysisconsulting.com/
>
> http://www.IAmLearningDisabled.com
>
>
>
> _______________________________________________
> Traminer-users mailing list
> Traminer-users at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users
--
Gilbert Ritschard, Department of Economics and
Institute for Demographic and Life Course Studies,
University of Geneva, 40, bd du Pont-d'Arve, CH-1211 Genève 4, Switzerland
http://mephisto.unige.ch
More information about the Traminer-users
mailing list