[R] 2 time dependend states and probability transition matrix
ozric at web.de
Thu Sep 18 17:34:11 CEST 2003
Thanks, yes a good and simple starting point, how to
integrate Bayes should my own challenge.
----- Original Message -----
From: "Spencer Graves" <spencer.graves at pdf.com>
To: "Christian Schulz" <ozric at web.de>
Cc: <r-help at stat.math.ethz.ch>
Sent: Thursday, September 18, 2003 4:25 PM
Subject: Re: [R] 2 time dependend states and probability transition matrix
> I don't know if I understand what you want, but I wonder if the
> following might help:
> > Ptrans <- data.frame(Jan=LETTERS[rep(1:2, 5)],
> + June=LETTERS[rep(1:2, each=5)])
> > (table(Ptrans$Jan, Ptrans$June)/dim(Ptrans))
> A B
> A 0.3 0.2
> B 0.2 0.3
> hope this helps. spencer graves
> Christian Schulz wrote:
> >have got anybody experience or a starting
> >point for me, how i can program a function
> >which calculate me a probability transition matrix with a data.frame and
> >I have some independend variable and a class variable
> >for two states - in example one from Jan2003 and the same variables from
> >Now i would like to calculate the probability that PERSON X change
> >from classA to classB between this time-period dependend from
> >the independend variables.
> >Until now i think about an "easy" function what use the Bayes-Theorem,
but it's too bad that i'm
> >not a mathematican.
> >Thanks for any starting point, idea, link or paper!
> >I now the msm package, but think it's complex for my intention!?
> > [[alternative HTML version deleted]]
> >R-help at stat.math.ethz.ch mailing list
> R-help at stat.math.ethz.ch mailing list
More information about the R-help