confint.mdyplFit | R Documentation |
"mdyplFit"
objectMethod for computing confidence intervals for one or more
regression parameters in a "mdyplFit"
object
## S3 method for class 'mdyplFit'
confint(object, parm, level = 0.95, hd_correction = FALSE, se_start, ...)
object |
a fitted model object. |
parm |
a specification of which parameters are to be given confidence intervals, either a vector of numbers or a vector of names. If missing, all parameters are considered. |
level |
the confidence level required. |
hd_correction |
if |
se_start |
a vector of starting values for the state evolution
equations. See the |
... |
additional argument(s) for methods. |
Ioannis Kosmidis [aut, cre]
ioannis.kosmidis@warwick.ac.uk
mdyplFit()
, summary.mdyplFit()
## Not run:
set.seed(123)
n <- 2000
p <- 800
set.seed(123)
betas <- c(rnorm(p / 4, mean = 7, sd = 1), rep(0, 3 * p / 4))
X <- matrix(rnorm(n * p, 0, 1/sqrt(n)), nrow = n, ncol = p)
probs <- plogis(drop(X %*% betas))
y <- rbinom(n, 1, probs)
fit_mdypl <- glm(y ~ -1 + X, family = binomial(), method = "mdyplFit")
wald_ci <- confint(fit_mdypl)
adj_wald_ci <- confint(fit_mdypl, hd_correction = TRUE)
ag_coverage <- function(cis, beta) mean((cis[, 1] < beta) & (cis[, 2] > beta))
ag_coverage(wald_ci, betas)
ag_coverage(adj_wald_ci, betas)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.