standard_error {parameters} | R Documentation |
Standard Errors
Description
standard_error()
attempts to return standard errors of model
parameters.
Usage
standard_error(model, ...)
## Default S3 method:
standard_error(
model,
component = "all",
vcov = NULL,
vcov_args = NULL,
verbose = TRUE,
...
)
## S3 method for class 'factor'
standard_error(model, force = FALSE, verbose = TRUE, ...)
## S3 method for class 'glmmTMB'
standard_error(
model,
effects = "fixed",
component = "all",
verbose = TRUE,
...
)
## S3 method for class 'merMod'
standard_error(
model,
effects = "fixed",
method = NULL,
vcov = NULL,
vcov_args = NULL,
...
)
Arguments
model |
A model. |
... |
Arguments passed to or from other methods. |
component |
Model component for which standard errors should be shown.
See the documentation for your object's class in |
vcov |
Variance-covariance matrix used to compute uncertainty estimates (e.g., for robust standard errors). This argument accepts a covariance matrix, a function which returns a covariance matrix, or a string which identifies the function to be used to compute the covariance matrix.
|
vcov_args |
List of arguments to be passed to the function identified by
the |
verbose |
Toggle warnings and messages. |
force |
Logical, if |
effects |
Should standard errors for fixed effects ( |
method |
Method for computing degrees of freedom for
confidence intervals (CI) and the related p-values. Allowed are following
options (which vary depending on the model class): |
Value
A data frame with at least two columns: the parameter names and the standard errors. Depending on the model, may also include columns for model components etc.
Note
For Bayesian models (from rstanarm or brms), the standard error is the SD of the posterior samples.
Examples
model <- lm(Petal.Length ~ Sepal.Length * Species, data = iris)
standard_error(model)
if (require("sandwich") && require("clubSandwich")) {
standard_error(model, vcov = "HC3")
standard_error(model,
vcov = "vcovCL",
vcov_args = list(cluster = iris$Species)
)
}