- OpenMx source tarballs are now up on our webserver (oops)
- Nobody took the bait to build IFA models with OpenMx (as far as I know)
- LISREL help
- Should we have type = “LISREL”?
- Implement plot() for lisrel
- Example in Rd using raw data and means matrices
library(pwr) | |
power.t.test(n = 300, delta = NULL, sd = 1, sig.level = 0.05, power = .8, type = "paired", alternative = "one.sided") | |
# Paired t test power calculation | |
# | |
# n = 300 | |
# delta = 0.1438957 | |
# sd = 1 | |
# sig.level = 0.05 | |
# power = 0.8 | |
# alternative = one.sided |
data(myFADataRaw, package = "OpenMx") | |
latents = c("G") | |
manifests = names(myFADataRaw) | |
myFADataRaw = myFADataRaw[, manifests] | |
m1 <- mxModel("m1", type="RAM", manifestVars = manifests, latentVars = latents, | |
mxPath(from = latents, to = manifests, values = 0), | |
mxPath(from = manifests, arrows = 2), # manifest residuals | |
mxPath(from = latents, arrows = 2, free = F, values = 1), # latents fixed@1 | |
mxData(cov(myFADataRaw, use = "complete"), type = "cov", numObs = nrow(myFADataRaw)) | |
) |
require(OpenMx) | |
data(demoOneFactor) | |
manifests <- names(demoOneFactor) | |
latents <- c("G") | |
m1 <- mxModel("One Factor", type="RAM", | |
manifestVars = manifests, | |
latentVars = latents, | |
mxPath(from=latents, to=manifests), | |
mxPath(from=manifests, arrows=2), | |
mxPath(from=latents, arrows=2, |
Package existing teaching as TA ships
http://www.jobs.ac.uk/job/ATU280/graduate-teaching-assistant-x2-psychological-sciences
if (mxOption(NULL, "Default optimizer") == 'NLOPT') stop("SKIP") | |
library("devtools"); library("ggplot2"); | |
# library("umx") | |
# library("umx.twin") | |
devtools::document("~/bin/umx"); devtools::install("~/bin/umx"); | |
devtools::document("~/bin/umx.twin"); devtools::install("~/bin/umx.twin"); | |
demand("formula.tools") # for residualizing inline |
library(ggplot2) | |
library(scales) | |
gal_per_l = 0.219969 | |
mi_per_km = 0.621371 | |
l100km = seq(2, 13, by = .1) | |
l_per_km = l100km/100 | |
l_per_mi = l_per_km/mi_per_km | |
gal_per_mi = l_per_mi * gal_per_l | |
mpg = 1/gal_per_mi |
# Updated for umx 1.7+ 2017-06-12 04:28PM | |
# Notes: If you're on Mac or Unix, install the parallelOpenMx to get parallel (4x speedup or more) | |
# source('http://openmx.psyc.virginia.edu/getOpenMx.R') | |
library(umx) | |
umx_set_optimizer("NPSOL") # good optimizer for these data | |
umx_set_cores(detectCores()) # Max cores for speed | |
nSimulations = 1000 # Number of simulations | |
nMZpairs = nDZpairs = 500 # Number of twin pairs | |
pvalues = rep(NA, nSimulations) # placeholder for the p-values from mxCompare-ing the 2 models you are testing |