File: test-svylme.R

package info (click to toggle)
r-cran-parameters 0.24.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,852 kB
  • sloc: sh: 16; makefile: 2
file content (27 lines) | stat: -rw-r--r-- 674 bytes parent folder | download
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
skip_on_cran()
skip_on_os(c("mac", "linux", "solaris"))

skip_if_not_installed("withr")
skip_if_not_installed("survey")
skip_if_not_installed("lme4")
skip_if_not_installed("svylme")

withr::with_environment(
  new.env(),
  test_that("model_parameters svylme", {
    data(api, package = "survey")
    # two-stage cluster sample
    dclus2 <- survey::svydesign(
      id = ~ dnum + snum,
      fpc = ~ fpc1 + fpc2,
      data = apiclus2
    )
    m <- svylme::svy2lme(
      api00 ~ ell + mobility + api99 + (1 + api99 | dnum),
      design = dclus2,
      method = "nested"
    )
    mp <- model_parameters(m)
    expect_snapshot(print(mp))
  })
)