R/psyfun.boot.R

Defines functions psyfun.boot

Documented in psyfun.boot

psyfun.boot <- function(obj, N = 100){
   n <- obj$prior.weights
   f <- fitted(obj)
   resp.bt <- matrix(rbinom(N * length(n), n, f), ncol = N)
   bt.res <- sapply(seq_len(N), function(x) {
      r <- resp.bt[, x]
      res.bt <- glm(cbind(r, n - r) ~ model.matrix(obj) - 1,
         binomial(obj$family$link))
      cc <- coef(res.bt)
      names(cc) <- names(coef(obj))
   cc
    })
    bt.res
}

Try the MPDiR package in your browser

Any scripts or data that you put into this service are public.

MPDiR documentation built on May 2, 2019, 5:54 p.m.