zero_vcov | R Documentation |
Transforms entries of variance-covariance of the coefficients corresponding to the non-focal variables to zero.
zero_vcov(m, focal_vars, complete)
focal_vars |
a character vector specifying the variable(s) appearing on the right side of the formula of the fitted model. The entries of this variable with be non-zero. |
complete |
logical indicating if the full variance-covariance matrix should be returned. |
mod |
fitted model object or a full variance-covariance matrix with terms appearing the same way they appear in the coefficients. |
a variance-covariance matrix of the estimated parameters with non-zero entry corresponding to the focal variable.
set.seed(4567)
x <- rnorm(100, 3, 5)
y <- 0.4 + 0.7*x + rnorm(100)
df <- data.frame(y = y, x = x)
m1 <- lm(y ~ x, df)
print(zero_vcov(m1, "x"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.