Description Usage Arguments Value See Also Examples
This function estimates all submodels.
1 | EstAllModels(X, Xnew, y, s)
|
X |
A design matrix. |
Xnew |
Design matrix used for predictions. |
y |
Vector of the response. |
s |
Matrix where the rows correspond to a submodel. |
Returns a list with the following:
SEs |
Variances of the submodels. |
coefficients |
Coefficients from each submodel. |
K |
The number of included variables in each submodel. |
etilde |
Matrix of residuals (for MMA). Each column corresponds to residuals from a submodel. |
eJMA |
The matrix of error terms for JMA. Each column corresponds to jackknife residuals in the submodels. |
AIC |
The AIC values for the models. |
BIC |
The BIC values for the models. |
preds |
The predictions from all submodels. |
1 2 3 4 5 6 7 8 9 10 | ## Generate some data
Xdata <- matrix(rnorm(100), 25, 4)
ydata <- matrix(rowSums(Xdata) + rnorm(25), 25, 1)
Xnewdata <- matrix(rnorm(100), 25, 4)
## Get the submodel matrix
smatrix <- Generate.S(Fix.X = 1, Potential.X = 3, avertype = "nested")
## Estimate all submodels
allMods <- EstAllModels(X = Xdata, Xnew = Xnewdata, y = ydata, s = smatrix)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.