3 responses to “Poisson regression with two random effects: Better Mata code”

  1. Juan Suarez

    Hi John,

    How do you set up the data file to be read by the stata?. I am trying to reproduce Case study 8: Growth of sea cows from your book Bayesian Analysis with stata. What I did was to copy and paste the data that comes with winbugs (Dugongs: nonlinear growth curve ) in the stata do-editor and saved in to a txt file (data.txt). I created a separate file for the model and inits and I put everything in the same folder to be read by STATA. Then, I prepared a script file with the model.txt, the data.txt and inits.txt as in your book. However,when I run the script file I doesn’t work. The data file can’t be read. I suspect that the data file is not well set up. I tried different ways without success. For ejample
    Fist option

    list(x = c( 1.0, 1.5, 1.5, 1.5, 2.5, 4.0, 5.0, 5.0, 7.0,
    8.0, 8.5, 9.0, 9.5, 9.5, 10.0, 12.0, 12.0, 13.0,
    13.0, 14.5, 15.5, 15.5, 16.5, 17.0, 22.5, 29.0, 31.5),
    Y = c(1.80, 1.85, 1.87, 1.77, 2.02, 2.27, 2.15, 2.26, 2.47,
    2.19, 2.26, 2.40, 2.39, 2.41, 2.50, 2.32, 2.32, 2.43,
    2.47, 2.56, 2.65, 2.47, 2.64, 2.56, 2.70, 2.72, 2.57), N = 27)
    No success

    Second option

    x y
    1 1.80
    1.5 1.85
    …..
    31.5 2.57
    No success either.
    Can you help please?

    Juan Suarez
    Biochemistry Student
    Concordia University
    Montreal. Canada

  2. Juan Suarez

    Thank you very much!

    Juan Reynel

Leave a Reply

Network-wide options by YD - Freelance Wordpress Developer