Transforms posterior means \(\hat{\gamma}_2\) and variances corresponding to transformed auxiliary regressors \(Z_2\) back to regression coefficients \(\hat{\beta}\) of original regressors \(X_1\) and \(X_2\).
gammaToBeta(
posterior,
y,
Z1,
Z2,
Delta1,
D2,
sigma,
Z1inv,
method = "original",
svdZ1
)
Object returned from computePosterior
.
Response \(y\).
Transformed focus regressors \(Z_1\).
Transformed auxiliary regressors \(Z_1\).
\(\Delta_1\) or \(\bar{\Delta}_1\).
From semiorthogonalize
, if postmult = FALSE
was used, then D2 = \(\Delta_2 T \Lambda^{-1/2}\), where \(T\) are the
eigenvectors of \(\Xi\) and \(\Lambda\) the diagonal matrix containing
the corresponding eigenvalues. If postmult = TRUE
was used, then
D2 = \(\Delta_2 T \Lambda^{-1/2} T^{\top} = \Delta_2 \Xi^{-1/2}\).
Prespecified or estimated standard deviation of the error term.
\((Z_{1}^{\top} Z_{1})^{-1}\).
Character. \(\hat{\gamma}_1\) is obtained from a linear
regression of \(Z_1\) on pseudo-responses \(y - Z_2 \hat{\gamma}_2\).
If method = original
, then we use lm.fit
to perform
the linear regression, if method = "svd"
, then reuse the SVD of
\(Z_1\) in svdZ1
to perform the regression.
Optional, only needed if method = "svd"
. SVD of \(Z_1\)
computed using svd
.
The same transformations also work for GLMs, where we replace \(X_1\),
\(X_2\), \(Z_1\) and \(Z_2\) with \(\bar{X}_1\), \(\bar{X}_2\),
\(\bar{Z}_1\) and \(\bar{Z}_2\), respectively. Generally, we need to
replace all variables with their corresponding "bar" version. Further,
for GLMs sigma
is always 1.
See magnus2016wals;textualWALS, deluca2018glm;textualWALS and huynhwals;textualWALS for the definitions of the variables.