View source: R/lm_betaselect_methods.R
vcov.lm_betaselect | R Documentation |
glm_betaselect
ObjectsCompute the
variance-covariance matrix of
estimates in the output of
lm_betaselect()
or
glm_betaselect()
.
## S3 method for class 'lm_betaselect'
vcov(
object,
method = c("boot", "bootstrap", "ls", "default"),
type = c("beta", "standardized", "raw", "unstandardized"),
warn = TRUE,
...
)
## S3 method for class 'glm_betaselect'
vcov(
object,
method = c("boot", "bootstrap", "ls", "default"),
type = c("beta", "standardized", "raw", "unstandardized"),
warn = TRUE,
...
)
object |
The output of
|
method |
The method used to
compute the variance-covariance
matrix. If bootstrapping was
requested when calling
|
type |
String. If
|
warn |
Logical. WHether a warning
will be raised is OLS (or WLS)
variance-covariance matrix is
requested for the model with some
variables standardized (i.e., |
... |
Other arguments to be
passed to |
The type of variance-covariance matrix depends on the object. If bootstrapping was requested, by default it returns the bootstrap variance-covariance matrix. Otherwise, it returns the default variance-covariance matrix and raises a warning.
Support for other type of variance-covariance matrix will be added.
A matrix of the variances and covariances of the parameter estimates.
Shu Fai Cheung https://orcid.org/0000-0002-9871-9448
lm_betaselect()
and
glm_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)
vcov(lm_beta_x)
# A warning is expected for the following call
vcov(lm_beta_x, method = "ls")
vcov(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)
vcov(logistic_beta_x)
# A warning is expected for the following call
vcov(logistic_beta_x, method = "default")
vcov(logistic_beta_x, type = "raw")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.