vcov | R Documentation |

Returns the variance-covariance matrix for the predicted values from `object`

.

```
## S3 method for class 'ggeffects'
vcov(
object,
vcov_fun = NULL,
vcov_type = NULL,
vcov_args = NULL,
vcov.fun = vcov_fun,
vcov.type = vcov_type,
vcov.args = vcov_args,
verbose = TRUE,
...
)
```

`object` |
An object of class |

`vcov_fun` |
Variance-covariance matrix used to compute uncertainty estimates (e.g., for confidence intervals based on 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. A (variance-covariance) matrix A function which returns a covariance matrix (e.g., `stats::vcov()` )A string which indicates the estimation type for the heteroscedasticity-consistent variance-covariance matrix, e.g. `vcov_fun = "HC0"` . Possible values are`"HC0"` ,`"HC1"` ,`"HC2"` ,`"HC3"` ,`"HC4"` ,`"HC4m"` , and`"HC5"` , which will then call the`vcovHC()` -function from the**sandwich**package, using the specified type. Further possible values are`"CR0"` ,`"CR1"` ,`"CR1p"` ,`"CR1S"` ,`"CR2"` , and`"CR3"` , which will call the`vcovCR()` -function from the**clubSandwich**package.A string which indicates the name of the `vcov*()` -function from the**sandwich**or**clubSandwich**packages, e.g.`vcov_fun = "vcovCL"` , which is used to compute (cluster) robust standard errors for predictions.
If See details in this vignette. |

`vcov_type` |
Character vector, specifying the estimation type for the
robust covariance matrix estimation (see |

`vcov_args` |
List of named vectors, used as additional arguments that
are passed down to |

`vcov.fun` , `vcov.type` , `vcov.args` |
Deprecated. Use |

`verbose` |
Toggle messages or warnings. |

`...` |
Currently not used. |

The returned matrix has as many rows (and columns) as possible combinations
of predicted values from the `predict_response()`

call. For example, if there
are two variables in the `terms`

-argument of `predict_response()`

with 3 and 4
levels each, there will be 3*4 combinations of predicted values, so the returned
matrix has a 12x12 dimension. In short, `nrow(object)`

is always equal to
`nrow(vcov(object))`

. See also 'Examples'.

The variance-covariance matrix for the predicted values from `object`

.

```
data(efc)
model <- lm(barthtot ~ c12hour + neg_c_7 + c161sex + c172code, data = efc)
result <- predict_response(model, c("c12hour [meansd]", "c161sex"))
vcov(result)
# compare standard errors
sqrt(diag(vcov(result)))
as.data.frame(result)
# only two predicted values, no further terms
# vcov() returns a 2x2 matrix
result <- predict_response(model, "c161sex")
vcov(result)
# 2 levels for c161sex multiplied by 3 levels for c172code
# result in 6 combinations of predicted values
# thus vcov() returns a 6x6 matrix
result <- predict_response(model, c("c161sex", "c172code"))
vcov(result)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.