问题 I'm trying to simulate GLM functions in R including stochastic uncertainty. I compared a formula-based approach to the R-based simulate() function and get different results. Not sure what I (probably its me and not R) am doing wrong. I start by creating a simulation cohort: set.seed(1) library(MASS) d <- mvrnorm(n=3000, mu=c(30,12,60), Sigma=matrix(data=c(45, 5, 40, 5, 15, 13, 40, 13, 300), nrow=3)) d[,1] <- d[,1]^2 Fit the model: m <- glm(formula=d[,1]~d[,2] + d[,3], family=gaussian(link=