[Traminer-users] Variance of a sequence

Alexis Gabadinho alexis.gabadinho at unige.ch
Thu Jan 23 12:44:57 CET 2014


Hi Niek,

The variance is computed using the outcome of the seqdur function:

s1 <- seqdef("A-A-B-B-C-C-A-A-A-A")
x <- seqdur(s1)
x

n <- sum(!is.na(x))
var <- 1/n * sum((x - mean(x, na.rm = TRUE))^2, na.rm = TRUE)
var

Best regards,
Alexis

Le 23/01/2014 12:23, Niek Frans a écrit :
> Hello everyone,
>
> This is probably a very simple question, but I've spend a couple of 
> hours trying to find the answer without any luck, so I thought it try 
> it here.
>
> I'm trying to explain the Turbulence measure by Elzinga, but I'm stuck 
> trying to compute the variance of the state-duration for the sequence. 
> Could anyone explain how the variance of a sequence is calculated? I 
> know it has something to do with the sequence length and the 
> consecutive length of remaining in one state, but I can't find the 
> exact formula anywhere.
>
> Kind regards,
>
>
> Niek
>
>
> _______________________________________________
> 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/traminer-users/attachments/20140123/4128c6c1/attachment.html>


More information about the Traminer-users mailing list