File: test-weight.R

package info (click to toggle)
r-cran-openmx 2.21.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 14,412 kB
  • sloc: cpp: 36,577; ansic: 13,811; fortran: 2,001; sh: 1,440; python: 350; perl: 21; makefile: 5
file content (19 lines) | stat: -rw-r--r-- 709 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
library(OpenMx)
library(testthat)

data("nhanesDemo")


m <- mxModel("testing weitghs", type = "RAM", manifestVars =c("fpl", "age", "psu"),
  mxPath(from = "age", to = "fpl", arrows = 1, free = T, values = 0.5),
  mxPath(from = "psu", to = "fpl", arrows = 1, free = T, values = 0.5),
  mxPath(from = "one", to = c("fpl", "age", "psu"), arrows = 1, free = T, values = 0.5),
  mxPath(from = "age", to = "age", arrows = 2, free = T, values = 1),
  mxPath(from = "psu", to = "psu", arrows = 2, free = T, values = 1),
  mxPath(from = "fpl", to = "fpl", arrows = 2, free = T, values = 1),
  mxData(nhanesDemo, type = "raw", weight = "persWeight")
 )

mo <- try(mxRun(m))

omxCheckEquals(is(mo, "try-error"), FALSE)