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
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)<
2 matches
Mail list logo