walsFit | R Documentation |
Workhorse function behind wals
and walsGLM
.
walsFit(
X1,
X2,
y,
sigma = NULL,
prior = weibull(),
method = "original",
svdTol = .Machine$double.eps,
svdRtol = 1e-06,
keepUn = FALSE,
eigenSVD = TRUE,
prescale = TRUE,
postmult = FALSE,
...
)
X1 |
Design matrix for focus regressors. Usually includes a constant
(column full of 1s) and can be generated using |
X2 |
Design matrix for auxiliary regressors. Usually does not include
a constant column and can also be generated using |
y |
Response as vector. |
sigma |
if NULL (default), then the variance of the error term is estimated, see p.136 of \insertCitemagnus2016wals;textualWALS. If sigma is specified, then the unrestricted estimator is divided by sigma before performing the Bayesian posterior mean estimation. |
prior |
Object of class |
method |
Specifies method used. Available methods are
|
svdTol |
Tolerance for rank of matrix |
svdRtol |
Relative tolerance for rank of matrix |
keepUn |
If |
eigenSVD |
If |
prescale |
If |
postmult |
If
where
instead of
See \insertCitehuynhwals;textualWALS for more details. The latter is used
in the original MATLAB code for WALS in the linear regression model
\insertCitemagnus2010growth,deluca2011stata,kumar2013normallocation,magnus2016walsWALS,
see eq. (12) of \insertCitemagnus2016wals;textualWALS.
The first form is required in eq. (9) of \insertCitedeluca2018glm;textualWALS.
It is not recommended to set |
... |
Arguments for internal function |
A list containing
coef |
Model averaged estimates of all coefficients. |
beta1 |
Model averaged estimates of the coefficients of the focus regressors. |
beta2 |
Model averaged estimates of the coefficients of the auxiliary regressors. |
gamma1 |
Model averaged estimates of the coefficients of the transformed focus regressors. |
gamma2 |
Model averaged estimates of the coefficients of the transformed auxiliary regressors. |
vcovBeta |
Estimated covariance matrix of the regression coefficients. |
vcovGamma |
Estimated covariance matrix of the coefficients of the transformed regressors. |
sigma |
Estimated or prespecified standard deviation of the error term. |
prior |
|
method |
Stores |
betaUn1 |
If |
betaUn2 |
If |
gammaUn1 |
If |
gammaUn2 |
If |
fitted.values |
Estimated conditional means of the data. |
residuals |
Residuals, i.e. response - fitted mean. |
X1names |
Names of the focus regressors. |
X2names |
Names of the auxiliary regressors. |
k1 |
Number of focus regressors. |
k2 |
Number of auxiliary regressors. |
n |
Number of observations. |
condition |
Condition number of the matrix
|
wals, walsGLM.
X <- model.matrix(gdpgrowth ~ lgdp60 + equipinv + school60 + life60 + popgrowth
+ law + tropics + avelf + confucian, data = GrowthMPP)
X1 <- X[, c("(Intercept)", "lgdp60", "equipinv", "school60", "life60", "popgrowth")]
X2 <- X[, c("law", "tropics", "avelf", "confucian")]
y <- GrowthMPP$gdpgrowth
walsFit(X1, X2, y, prior = weibull(), method = "svd")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.