I am currently working on a huge data set and would like to compute the variance for a combination of my parameter estimates. I would like to read in data from the vcov matrix into a data set and then compute the variance. I am using **tidyverse** and in particular I am using **mutate** to try and read in the variance covariance components. I have created a toy data set due to the confidentiality issues for my data.

```
library(MASS)
library(tidyverse)
mod <- lm(Gas ~ Temp +Insul+0, whiteside)
#model summary
summary(mod)
#variance covariance matrix
vcov(mod)
# Now I want to read in the variance covariance matrix: To obtain the variance
# of say a linear combination of some parameters: Beta_Temp + Beta_InsulBefore
# Now I have a bew dataset: data2 where I want to use Covariate1:Covariate3 as
# indices to obtain my covariances.
data2 <- as.data.frame(cbind(Covariate1=c("Temp","InsulBefore","InsulAfter"),
Covariate2=c("InsulBefore","InsulAfter","Temp"),
Covariate3=c("InsulAfter","Temp","InsulBefore")))
# I get the variances
data3<- data2 |> mutate(Variances=diag(vcov(mod))[Covariate1])
# I have issues trying to get the covariances
data4<- data3 |> mutate(Cov12=(vcov(mod)[Covariate1,Covariate2]))
## Cov12 is a matrix but I want it to be a column with only values from the
## covariance of Temp:InsulBefore, InsulBefore:InsulAfter and InsulAfter:Temp.
## This is just a toy data as I can't share the real data for confidentiality
## reasons.
```