Using a robust regression for covariate adjustment, @adamSales uncovered in commit b36f2fb that flexida tags v0.1.1 and beyond generated sandwich variance calculations that were only satisfied for square, symmetric bread matrices. This was due to less careful attention to transposition of matrices when forming the output of estfun.DirectAdjusted.
The solution can be illustrated through matrix multiplication. We aim to estimate sandwich variances $A^{-1}MA^{-T}$, whose lower right submatrix corresponding to the covariance matrix of the ITT effects is derived below:
$\Phi$ and $\Psi$ are the matrices of empirical estimating equations for the covariate adjustment and ITT effect models, respectively (estfun(camod) and estfun.base_S3Class(dmod)).
One important note is that the sandwich has an $A{22}^{-1}$ on the lefthand side and an $A{22}^{-T}$ on the righthand side. The second important note is that the portion in brackets corresponds to the crossproduct of estfun.DirectAdjusted(). The matrix in brackets suggests that estfun.DirectAdjusted should be $\Psi - \Phi A{11}^{-T}A{21}^{T}$.
This looks right to me, thanks. (It prompted a few spec corrections (b5b1266), changing $\Psi - \Phi A{11}^{-1}A{21}^t$'s to $\Psi - \Phi A{11}^{-t}A{21}^t$.)
Using a robust regression for covariate adjustment, @adamSales uncovered in commit b36f2fb that flexida tags
v0.1.1
and beyond generated sandwich variance calculations that were only satisfied for square, symmetric bread matrices. This was due to less careful attention to transposition of matrices when forming the output ofestfun.DirectAdjusted
.The solution can be illustrated through matrix multiplication. We aim to estimate sandwich variances $A^{-1}MA^{-T}$, whose lower right submatrix corresponding to the covariance matrix of the ITT effects is derived below:
$\Phi$ and $\Psi$ are the matrices of empirical estimating equations for the covariate adjustment and ITT effect models, respectively (
estfun(camod)
andestfun.base_S3Class(dmod)
).One important note is that the sandwich has an $A{22}^{-1}$ on the lefthand side and an $A{22}^{-T}$ on the righthand side. The second important note is that the portion in brackets corresponds to the crossproduct of
estfun.DirectAdjusted()
. The matrix in brackets suggests thatestfun.DirectAdjusted
should be $\Psi - \Phi A{11}^{-T}A{21}^{T}$.