% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/robust_estimation.R
\name{standard_error_robust}
\alias{standard_error_robust}
\alias{p_value_robust}
\alias{ci_robust}
\title{Robust estimation}
\usage{
standard_error_robust(
  model,
  vcov_estimation = "HC",
  vcov_type = NULL,
  vcov_args = NULL,
  component = "conditional",
  ...
)

p_value_robust(
  model,
  vcov_estimation = "HC",
  vcov_type = NULL,
  vcov_args = NULL,
  component = "conditional",
  method = NULL,
  ...
)

ci_robust(
  model,
  ci = 0.95,
  method = NULL,
  vcov_estimation = "HC",
  vcov_type = NULL,
  vcov_args = NULL,
  component = "conditional",
  ...
)
}
\arguments{
\item{model}{A model.}

\item{vcov_estimation}{String, indicating the suffix of the
\verb{vcov*()}-function from the \pkg{sandwich} or \pkg{clubSandwich}
package, e.g. \code{vcov_estimation = "CL"} (which calls
\code{\link[sandwich:vcovCL]{sandwich::vcovCL()}} to compute clustered covariance matrix
estimators), or \code{vcov_estimation = "HC"} (which calls
\code{\link[sandwich:vcovHC]{sandwich::vcovHC()}} to compute
heteroskedasticity-consistent covariance matrix estimators).}

\item{vcov_type}{Character vector, specifying the estimation type for the
robust covariance matrix estimation (see
\code{\link[sandwich:vcovHC]{sandwich::vcovHC()}} or \code{clubSandwich::vcovCR()}
for details). Passed down as \code{type} argument to the related \verb{vcov*()}-function
from the  \pkg{sandwich} or \pkg{clubSandwich} package and hence will be
ignored if there is no \code{type} argument (e.g., \code{sandwich::vcovHAC()} will
ignore that argument).}

\item{vcov_args}{List of named vectors, used as additional arguments that are
passed down to the \pkg{sandwich}-function specified in
\code{vcov_estimation}.}

\item{component}{Should all parameters or parameters for specific model
components be returned?}

\item{...}{Arguments passed to or from other methods. For
\code{standard_error()}, if \code{method = "robust"}, arguments
\code{vcov_estimation}, \code{vcov_type} and \code{vcov_args} can be passed
down to \code{standard_error_robust()}.}

\item{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): \code{"residual"},
\code{"normal"}, \code{"likelihood"}, \code{"satterthwaite"}, \code{"kenward"}, \code{"wald"},
\code{"profile"}, \code{"boot"}, \code{"uniroot"}, \code{"ml1"}, \code{"betwithin"}, \code{"hdi"},
\code{"quantile"}, \code{"ci"}, \code{"eti"}, \code{"si"}, \code{"bci"}, or \code{"bcai"}. See section
\emph{Confidence intervals and approximation of degrees of freedom} in
\code{\link[=model_parameters]{model_parameters()}} for further details.}

\item{ci}{Confidence Interval (CI) level. Default to \code{0.95} (\verb{95\%}).}
}
\value{
A data frame.
}
\description{
\code{standard_error_robust()}, \code{ci_robust()} and \code{p_value_robust()}
attempt to return indices based on robust estimation of the variance-covariance
matrix, using the packages \pkg{sandwich} and \pkg{clubSandwich}.
}
\note{
These functions rely on the \pkg{sandwich} or \pkg{clubSandwich} package
(the latter if \code{vcov_estimation = "CR"} for cluster-robust standard errors)
and will thus only work for those models supported by those packages.
}
\examples{
if (require("sandwich", quietly = TRUE)) {
  # robust standard errors, calling sandwich::vcovHC(type="HC3") by default
  model <- lm(Petal.Length ~ Sepal.Length * Species, data = iris)
  standard_error_robust(model)
}
\dontrun{
if (require("clubSandwich", quietly = TRUE)) {
  # cluster-robust standard errors, using clubSandwich
  iris$cluster <- factor(rep(LETTERS[1:8], length.out = nrow(iris)))
  standard_error_robust(
    model,
    vcov_type = "CR2",
    vcov_args = list(cluster = iris$cluster)
  )
}
}
}
\seealso{
Working examples cam be found \href{https://easystats.github.io/parameters/articles/model_parameters_robust.html}{in this vignette}.
}
