Hi, I want to bootstrap the likelihood ratio test for testing linear restrictions on the parameters of a regression model. The aim is to perform a size and power analysis. My question is, as indicated by the subject, how do I approximate the null distribution? The code that I ran looks like
> boot.test <- function(data, indeces, maxit=20) { + y1 <- fit1+e1[indeces] + mod1 <- glm(y1 ~ X1-1, maxit=maxit) + y2 <- fit2+e2[indeces] + mod2 <- glm(y2~1, maxit=maxit) + t <- 2*(logLik(mod1)-logLik(mod2)) + t + } > boot.lrtest <- boot(data=M1, statistic=boot.test, R=1999, maxit=100) However, I suspect that I am not bootstrapping under the null hypothesis. How do I perform the bootstrap under the null? I would really appriciate any help, I feel rather lost. /Anders [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.