Re: [R] MCMC_glm models

2011-03-07 Thread Jorge Ivan Velez
Hi Nick, The following would be one way of doing what you want: # function to estimate one model foo <- function(mu = 9.244655, n = 50){ X <- rpois(n, mu) glm(X ~ Y, family = poisson) # note I am using family = poisson } B <- 1000 # number of samples -- change accordingly Y <- 19

[R] MCMC_glm models

2011-03-07 Thread Nicholas M. Caruso
Hello, I am trying to run multiple glm models for a dataset and need some help First, i generated a matrix of abundance for 1 populations based on the mean and variance of my dataset X <- replicate(1, rpois(50, 9.244655)) and entered the years as row names Y <- c(1960:2009) rownames(X)<