https://uoe.sharepoint.com/sites/PPLSLearningResources
Sections of this guide are:
- Meeting, presentation and communication tools (chat/boards etc.)
- Recording tools
- FAQ
https://uoe.sharepoint.com/sites/PPLSLearningResources
Sections of this guide are:
| create.vechsR <- function (A0, S0, F0 = NULL, Ax = NULL, Sx = NULL) { | |
| if (is.matrix(A0)) { | |
| A0 = as.mxMatrix(A0, name = "A0") | |
| }else{ | |
| A0@name = "A0" | |
| } if (is.matrix(S0)) { | |
| S0 = as.mxMatrix(S0, name = "S0") | |
| }else{ | |
| S0@name = "S0" | |
| } |
| These code snippets have been tested on R 3.1.0 and Mac OS 10.9.3. They presumably do *not* work on R 2.X! | |
| ## Enter these commands in the Mac OS Terminal | |
| # use faster vecLib library | |
| cd /Library/Frameworks/R.framework/Resources/lib | |
| ln -sf /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Versions/Current/libBLAS.dylib libRblas.dylib | |
| # return to default settings | |
| cd /Library/Frameworks/R.framework/Resources/lib |
| # mate ~/.R/Makevars | |
| # The following statements are required to use the clang4 binary | |
| CC=/usr/local/clang4/bin/clang | |
| CXX=/usr/local/clang4/bin/clang++ | |
| CXX1X=/usr/local/clang4/bin/clang++ | |
| CXX98=/usr/local/clang4/bin/clang++ | |
| CXX11=/usr/local/clang4/bin/clang++ | |
| CXX14=/usr/local/clang4/bin/clang++ | |
| CXX17=/usr/local/clang4/bin/clang++ | |
| LDFLAGS=-L/usr/local/clang4/lib |
| data(demoOneFactor) | |
| manifests <- names(demoOneFactor) | |
| latents <- c("G1", "G2") | |
| fit2 <- mxRun(mxModel("Two Factor", type="RAM", | |
| manifestVars = manifests, latentVars = latents, | |
| mxPath(from = latents[1], to=manifests[1:3]), | |
| mxPath(from = latents[2], to=manifests[4:5]), | |
| mxPath(from = manifests, arrows = 2), | |
| mxPath(from = latents, arrows = 2, free = FALSE, values = 1.0), |
| library("umx") | |
| con <- url("https://www.dropbox.com/s/r9e3om73viquzfq/disc.rda?raw=1") | |
| print(load(con)); close(con) | |
| manifests = c("q1", "q2", "q3", "q4", "q5", "q6", "q7") | |
| latents <- c("F1", "F2") # 2 factors | |
| m1 <- mxModel("twoFactors", type="RAM", manifestVars = manifests, latentVars = latents, | |
| mxPath("F1", to = manifests), | |
| mxPath("F2", to = manifests), | |
| mxPath(latents, arrows = 2, free = FALSE, values = 1), |
| # ============================ | |
| # = How heritable is height? = | |
| # ============================ | |
| require(umx) | |
| data(twinData) # ?twinData from Australian twins. | |
| # Pick the variables | |
| selDVs = c("ht1", "ht2") | |
| mzData <- twinData[twinData$zygosity %in% "MZFF", ] | |
| dzData <- twinData[twinData$zygosity %in% "DZFF", ] |
Haimovitz, K., & Dweck, C. S. (2016). What Predicts Children's Fixed and Growth Intelligence Mind-Sets? Not Their Parents' Views of Intelligence but Their Parents' Views of Failure. Psychological Science. doi:10.1177/0956797616639727
require(umx)
data = sem::readMoments(file = "", diag = TRUE)
1
.29 1
.29 -.06 1
.24 .17 -.07 1