Generate <- function(condition, fixed_objects) {
X <- rep(0:1, each = 50)
y <- 10 + 5 * X + rnorm(100, 0, .2)
data.frame(y, X)
}
Analyse <- function(condition, dat, fixed_objects) {
mod <- lm(y ~ X, dat)
so <- summary(mod)
ret <- c(SE = so$coefficients[,"Std. Error"],
est = so$coefficients[,"Estimate"])
ret
}
Summarise <- function(condition, results, fixed_objects) {
MSRSE(SE = results[,1:2], SD = results[,3:4])
}
results <- runSimulation(replications=500, generate=Generate,
analyse=Analyse, summarise=Summarise)
results
Run the code above in your browser using DataLab