Hi,
I'm having trouble understanding how to construct a random number generator
for a parametric bootstrap. My aim is to bootstrap a Likelihood Ratio
statistic (under the null) for a linear model. The function at this point
is given by
boot.test.n01 <- function(data, indeces, maxit=20) {
y1 <- fit1+se(e2)*rnorm(314)
mod1 <- glm(y1 ~ X1-1, maxit=maxit)
y2 <- fit2+se(e2)*rnorm(314)
mod2 <- glm(y2~1, maxit=maxit)
t <- 2*(logLik(mod1)-logLik(mod2))
t
}
boot.lrtest.n01 <- boot(data=M1, statistic=boot.test.n01, R=3999, maxit=100,
sim="parametric", ran.gen=???, mle=???)
fit1 & fit2 are vectors containing fitted values, the se() is the standard
error of a residual vector, e2, which I'm using as an estimate of the
variance. I'm not sure if I have constructed the function "boot.test.n01"
correctly with respect to the bootstrap dependent variables y1 & y2.
Furthermore I'm rather lost when it comes to how to construct the random
number generator (as indicated by ???) and what to use as MLE's (as
indicated by ???). I would really appriciate any help that I could get.
Sincerely,
/Anders
[[alternative HTML version deleted]]