View source: R/lm_betaselect_methods.R
confint.lm_betaselect | R Documentation |
Return the confidence
interval of the regression
coefficients in the output of
lm_betaselect()
or
glm_betaselect()
.
## S3 method for class 'lm_betaselect'
confint(
object,
parm,
level = 0.95,
method = c("boot", "bootstrap", "ls"),
type = c("beta", "standardized", "raw", "unstandardized"),
warn = TRUE,
boot_type = c("perc", "bc"),
...
)
## S3 method for class 'glm_betaselect'
confint(
object,
parm,
level = 0.95,
trace = FALSE,
test = c("LRT", "Rao"),
method = c("boot", "bootstrap", "default", "ls"),
type = c("beta", "standardized", "raw", "unstandardized"),
warn = TRUE,
boot_type = c("perc", "bc"),
transform_b = NULL,
...
)
object |
The output of
|
parm |
The terms for which the confidence intervals are returned. If missing, the confidence intervals of all terms will be returned. |
level |
The level of confidence, default is .95, returning the 95% confidence interval. |
method |
The method used to
compute the confidence intervals/
If bootstrapping was
requested when calling
|
type |
String. If
|
warn |
Logical. Whether a warning
will be raised is OLS (or WLS)
confidence intervals are
requested for the model with some
variables standardized (i.e., |
boot_type |
The type of
bootstrap confidence intervals.
Currently, it supports |
... |
Optional arguments. Ignored. |
trace |
Logical. Whether profiling
will be traced. See
|
test |
The test used for
profiling. See stats::confint.glm
for details.
ignored if |
transform_b |
The function
to be used to transform the
confidence limits. For example,
if set to |
The type of confidence intervals depends on the object. If bootstrapping was requested, by default it returns the percentile bootstrap confidence intervals. Otherwise, it returns the default confidence intervals.
Support for other type of confidence intervals may be added in the future.
A p by 2 matrix of the confidence intervals, p being the number of coefficients.
Shu Fai Cheung https://orcid.org/0000-0002-9871-9448
lm_betaselect()
data(data_test_mod_cat)
# bootstrap should be set to 2000 or 5000 in real studies
lm_beta_x <- lm_betaselect(dv ~ iv*mod + cov1 + cat1,
data = data_test_mod_cat,
to_standardize = "iv",
do_boot = TRUE,
bootstrap = 100,
iseed = 1234)
confint(lm_beta_x)
confint(lm_beta_x, method = "ls")
confint(lm_beta_x, type = "raw")
data_test_mod_cat$p <- scale(data_test_mod_cat$dv)[, 1]
data_test_mod_cat$p <- ifelse(data_test_mod_cat$p > 0,
yes = 1,
no = 0)
# bootstrap should be set to 2000 or 5000 in real studies
logistic_beta_x <- glm_betaselect(p ~ iv*mod + cov1 + cat1,
data = data_test_mod_cat,
family = binomial,
to_standardize = "iv",
do_boot = TRUE,
bootstrap = 100,
iseed = 1234)
confint(logistic_beta_x, method = "default")
confint(logistic_beta_x, type = "raw")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.