File: PowerError.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 (21 lines) | stat: -rw-r--r-- 651 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
library(OpenMx)
library(testthat)
data(demoOneFactor)

latents  = c("G")
manifests = names(demoOneFactor)

m1 <- mxModel("One Factor", type = "RAM", 
	manifestVars = manifests, latentVars = latents, 
	mxPath(from = latents, to = manifests),
	mxPath(from = manifests, arrows = 2, values=.2),
	mxPath(from = latents, arrows = 2, free = FALSE, values = 1.0),
	mxPath(from = "one", to = manifests),
	mxData(cov(demoOneFactor), type='cov',
	       numObs=nrow(demoOneFactor), means=colMeans(demoOneFactor))
)

fm <- omxSetParameters(m1, "One Factor.M[1,1]", values = .1, free=FALSE)

expect_error(mxPowerSearch(m1, fm),
             "contains 'cov' data")