[R] Simple Coding problem ?

Calvin L. Williams, Ph.D. calvinw at ces.clemson.edu
Sun Apr 21 16:33:20 CEST 2002

```R-users,

This may be a simple problem, but I don't have an intuition of
how simple it could be. Suppose I have a sequence of numbers
corresponding to a series of diagnoses on the same patient
over a sequence of time. The diagnoses are coded 1,2,3,4,5, but
could come in a sequence like 1,3,2,5,3,5,...etc. Is there a simple
way to count the number of times a 1 diagnosis is followed by a 2, or
a 3, ... A 2 by a 1, or 3,....etc. It's almost like a mover-stayer problem.
I think.

I know this seems simple but any help would be appreciated.

Cheers,
Calvin

--

====================  Calvin L. Williams, Ph.D.  ====================
Department of Mathematical Sciences, Clemson University
Box 340975 ,   0-323 Martin Hall
Clemson, South Carolina 29634-0975
VOICE: (864) 656-5241  or leave message (864) 654-7187
EMAIL: calvinw at ces.clemson.edu
FAX: 1-(864) 656-5230
WWW:   http://www.ces.clemson.edu/~calvinw/
============================================================
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

```