Description Usage Arguments Details Value Examples
View source: R/compute_cAIC_for_model_set.R
Function compute_cAIC_for_model_set
computes
cAIC for different models in the model set
1 2 3 4 5 6 7 8 9 10 11 | compute_cAIC_for_model_set(
X,
y,
clusterID,
X_cluster_full = NULL,
model = "NERM",
covariate_selection_matrix = NULL,
modelset = "all_subsets",
intercept = FALSE,
common = NULL
)
|
X |
Matrix with covariates for fixed effects |
y |
Vector of responses |
clusterID |
Vector with cluster labels |
X_cluster_full |
Matrix with cluster level covariates
for fixed effects of the full model. Default: |
model |
Type of mixed model: NERM, FHM, RIRS (random slopes and random intercepts) |
covariate_selection_matrix |
Matrix composed of zeros and ones
indicating fixed models in each parameter. Default: |
modelset |
Type of model set:
|
intercept |
Is column of ones, representing the intercept, present in X
Default: |
common |
A vector indicating variables forced to be
present in each model. Default: |
model
- for the moment, only NERM is supported
covariate_selection_matrix
- necessary only if modelset = NULL
List with parameters:
cAIC_min |
Index of selected model |
cAIC_models |
cAIC for all considered parameters |
degcAIC_models |
Penalty for all considered models |
beta_sel |
Fixed effects of the selected model |
mu_sel |
Mixed effects of the selected model |
indices_sel |
Indices of the selected covariates among full covariate set |
sig_u_sel |
Variance parameter of random effects of the selected model |
sig_e_sel |
Variance parameter of errors of the selected model |
X_full |
Matrix with fixed effects covariates of the full model |
X_cluster_full |
Matrix with cluster level covariates for fixed effects of the full model |
modelset_matrix |
Matrix composed of zeros and ones. Ones correspond to covariate in a model which is represented in nth row |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | n = 10
m_i = 5
m_total = 50
clusterID = rep(1:n, m_i)
p = 10
beta = rep(2, p)
u_i = rnorm(n, 0, 2)
u_i_aug = rep(u_i, each = m_i)
X = matrix(rnorm(m_total * p), m_total, p)
y = X%*%beta + u_i_aug + rnorm(m_total, 0, 1)
cAIC_model_set =
compute_cAIC_for_model_set(X, y, clusterID,
model = "NERM",
covariate_selection_matrix = NULL,
modelset = "part_subset",
common = c(1:8),
intercept = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.