Description Usage Arguments Details Value Examples
Function postOBSP_CI
provides post-OBSP confidence intervals
for mixed parameters
1 2 3 4 5 6 7 8 9 10 11 12 13 | postOBSP_CI(
X,
y,
clusterID,
X_cluster_full = NULL,
model = "NERM",
covariate_selection_matrix = NULL,
modelset = "all_subsets",
intercept = FALSE,
common = NULL,
boot = 1000,
alpha = 0.05
)
|
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: |
boot |
Number of bootstrap samples.
Default: |
alpha |
Construct 1 - alpha confidence intervals.
Default: |
Parameter boot
is needed for the calculation of the bootstrap
post-OBSP MSE of mixed effects.
List with elements:
OBSP_min |
Index of the selected model |
OBSP_models |
cAIC for all considered parameters |
postOBSP_up |
Upper boundary of CI for mixed effects |
postOBSP_do |
Lower boundary of CI for mixed effects |
mu_hat_sel |
Mixed effects of the selected model |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | # Define basic parameters -------------------------------------------------
n = 15
m_i = 5
m_total = n * m_i
beta = c(2.25, -1.1, 2.43, rep(0, 2))
sig_e = 1
sig_u = 1
X = simulations_n15_mi5
X_intercept = cbind(rep(1, m_total), X)
clusterID = rep(1:n, each = m_i)
# Create responses, errors and random effects -------------------
e_ij = rnorm(m_total, 0, sig_e)
u_i = rnorm(n, 0, sig_u)
u_i_aug = rep(u_i, each = m_i)
y = X_intercept%*% beta + u_i_aug + e_ij
# Post-OBSP inference ----------------------------------------
postOBSP_CI_results = postOBSP_CI(X, y,
clusterID,
X_cluster_full = NULL,
model = "NERM",
covariate_selection_matrix = NULL,
modelset = "part_subset",
intercept = FALSE,
common = c(1:2),
boot = 250)
plot(postOBSP_CI_results)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.