[R] Data preparation for MCMCbinaryChange
Shige Song
shigesong at gmail.com
Tue May 18 03:46:03 CEST 2010
Dear All,
Since no one has answered my previous question, let me revise it a
little and ask again.
My data set contains about 10,000 women born in 60 months. The outcome
variable is a binary variable indicating whether one has certain
health problems. My hypothesis is that the 60 months in which these
women were born can be divided into three distinctive periods with
respect to the binary dependent variable. I have tried simple logistic
regression model with dummy variables representing the three periods,
which works reasonably well. Now I would like to go a step further and
let the three distinctive periods identify themselves, which seems to
be what Bayesian change point model does.
The MCMCbinaryChange function in the MCMCpack package seems to be the
right tool. My question is: how should I organize my data so that it
can be directly fed to the function? The example in the documentation
uses simulated data example, which I don't quite understand. I would
appreciate if somebody can show me an example using real world data (a
dataframe).
Many thanks.
Best,
Shige
More information about the R-help
mailing list