tests/testthat/test-compute_cAIC_for_model_set.R

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)

test_that("Output is correct", {
  expect_match(class(cAIC_model_set), "list")
  expect_length(cAIC_model_set, 13)
})
KatarzynaReluga/postcAIC documentation built on Jan. 25, 2022, 12:33 a.m.