Skip to content
Prev 68498 / 398513 Next

Proba( Ut+2=1 / ((Ut+1==1) && (Ut==1))) ?

maybe something like this:

x <- sample(c(1, -1), 100, TRUE)
y <- rle(x)
##
ind1 <- y$length[y$value == 1]
sum(ind1[ind1 > 2] - 2)
ind2 <- y$length[y$value == -1]
##
sum(ind1[ind1 > 2] - 2)


could be helpful.

Best,
Dimitris

----
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/16/336899
Fax: +32/16/337015
Web: http://www.med.kuleuven.ac.be/biostat/
     http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm


----- Original Message ----- 
From: "vincent" <vincent at 7d4.com>
To: <r-help at stat.math.ethz.ch>
Sent: Monday, April 25, 2005 6:03 PM
Subject: [R] Proba( Ut+2=1 / ((Ut+1==1) && (Ut==1))) ?