{"id":26681190,"url":"https://github.com/openmx/openmx","last_synced_at":"2025-04-09T09:03:50.939Z","repository":{"id":3349043,"uuid":"4393940","full_name":"OpenMx/OpenMx","owner":"OpenMx","description":"Repository for the OpenMx Structural Equation Modeling package ","archived":false,"fork":false,"pushed_at":"2024-04-12T13:30:34.000Z","size":34828,"stargazers_count":84,"open_issues_count":105,"forks_count":33,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-04-14T12:28:48.152Z","etag":null,"topics":["behavior-genetics","c-plus-plus","estimation","graphical-models","growth-curves","item-response-theory","multilevel-models","openmx","psychology","r","statistics","structural-equation-modeling"],"latest_commit_sha":null,"homepage":"http://openmx.ssri.psu.edu","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpenMx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2012-05-21T13:38:34.000Z","updated_at":"2024-04-25T21:41:44.904Z","dependencies_parsed_at":"2023-02-18T08:16:05.566Z","dependency_job_id":"bcd6da97-88e6-4cd5-bd26-76f2da9ee39a","html_url":"https://github.com/OpenMx/OpenMx","commit_stats":{"total_commits":8530,"total_committers":49,"mean_commits":"174.08163265306123","dds":0.6606096131301289,"last_synced_commit":"24af40ed046c12eacf3ffd6e21d504c37200ec26"},"previous_names":[],"tags_count":108,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenMx%2FOpenMx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenMx%2FOpenMx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenMx%2FOpenMx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenMx%2FOpenMx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenMx","download_url":"https://codeload.github.com/OpenMx/OpenMx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248008628,"owners_count":21032556,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["behavior-genetics","c-plus-plus","estimation","graphical-models","growth-curves","item-response-theory","multilevel-models","openmx","psychology","r","statistics","structural-equation-modeling"],"created_at":"2025-03-26T07:14:39.969Z","updated_at":"2025-04-09T09:03:50.921Z","avatar_url":"https://github.com/OpenMx.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenMx \u003cimg src=\"https://openmx.ssri.psu.edu/sites/default/files/guineapig.png\" align=\"right\" width=\"120\" /\u003e\n\n\u003c!-- badges: start --\u003e\n[![Build Status](https://api.travis-ci.com/OpenMx/OpenMx.svg?branch=master)](https://app.travis-ci.com/github/OpenMx/OpenMx)\n[![Codecov test coverage](https://codecov.io/gh/OpenMx/OpenMx/branch/master/graph/badge.svg)](https://app.codecov.io/gh/OpenMx/OpenMx?branch=master)\n[![cran version](http://www.r-pkg.org/badges/version/OpenMx)](https://cran.r-project.org/package=OpenMx)\n[![Monthly Downloads](https://cranlogs.r-pkg.org/badges/OpenMx)](https://cranlogs.r-pkg.org/badges/OpenMx)\n[![Total Downloads](https://cranlogs.r-pkg.org/badges/grand-total/OpenMx)](https://cranlogs.r-pkg.org/badges/grand-total/OpenMx)\n[![DOI](https://img.shields.io/badge/doi-110.1007/s11336--014--9435--8-yellow.svg?style=flat)](https://doi.org/10.1007/s11336-014-9435-8)\n\u003c!-- badges: end --\u003e\n\n\u003e OpenMx is a [Structural Equation Modeling](https://en.wikipedia.org/wiki/Structural_equation_modeling)\npackage that encourages users to treat model specifications as something to be generated\nand manipulated programmatically.\n\n# TOC\n\n- [Overview](#overview)\n- [Installation](#installation)\n  * [Development versions](#development-versions)\n- [Documentation](#documentation)\n- [Quick usage examples](#quick-usage-examples)\n  * [Simple regression in path specification](#simple-regression-in-path-specification)\n  * [Simple regression using matrix algebra](#simple-regression-using-matrix-algebra)\n- [Related work](#related-work)\n- [Community and getting help](#community-and-getting-help)\n  * [Training](#training)\n- [Contributing](#contributing)\n\n\n# Overview\n\nOpenMx is the next generation of the Mx structural equation modeling tool. It is an R package activelly maintained and supported with the work of developers around the globe. It is designed to allow the user the most freedom possible while specifying structural equation models, therefore providing minimal defaults. This helps the user know that each specification/optimization decision comes with their own assumptions and influences model interpretation.\n\n\n# Installation\n\nThe package is on CRAN and should be installed with:\n\n```r\ninstall.packages(\"OpenMx\")\n```\n\n## Development versions\n\nDevelopers commit to the `master` branch.  Intrepid users are encouraged to install the `master` branch. In order to install locally clone this repo and run:\n\n```r\nmake cran-install # for the CRAN version\nmake install      # for the version with the proprietary NPSOL optimizer\n```\n\n\nThe `stable` branch can be considered our current alpha release.\n\nThe `stable` branch is updated automatically when all `models/passing`\nand `models/nightly` tests pass along with `make cran-check`.\n\n\nOn macOS, this can be installed as a binary via travis:\n\n```r\n\ninstall.packages(\"https://vipbg.vcu.edu/vipbg/OpenMx2/software/bin/macosx/travis/OpenMx_latest.tgz\")\n\n```\n\n\n# Documentation\n\n\nOpenMx can fit  everything from confirmatory factor analyses,\nthrough multiple group, mixture distribution, categorical threshold,\nmodern test theory, differential equations, state space, and many others. Models may be specified as RAM or LISREL paths, or directly in matrix algebra. Fit functions include ML (summary and full information) and WLS.\n\n\nThe package manual can be accessed online in the [link](https://vipbg.vcu.edu/vipbg/OpenMx2/docs//OpenMx/latest/), and as a pdf from the [link](https://vipbg.vcu.edu/vipbg/OpenMx2/docs//OpenMx/latest/OpenMxUserGuide.pdf). The manual includes example models and scripts for the most common cases.\n\n\n\n# Quick usage examples\n\n\nPath specifications are matematically complete and is often considered an easier approach to teaching and analysis. The path below represents a simple regression:\n\n![path](https://vipbg.vcu.edu/vipbg/OpenMx2/docs//OpenMx/latest/_images/SimpleRegression.png)\n\n\n\n## Simple regression in path specification\n\nOne can specify the above model using the following code:\n\n```r\nrequire(OpenMx)\n\ndata(myRegDataRaw)  # load data\nnames(myRegDataRaw)  # get names\nSimpleDataRaw \u003c- myRegDataRaw[,c(\"x\",\"y\")]  # take only what is needed\n\ndataRaw      \u003c- mxData( observed=SimpleDataRaw,  type=\"raw\" )\n# variance paths\nvarPaths     \u003c- mxPath( from=c(\"x\",\"y\"), arrows=2,\n                        free=TRUE, values = c(1,1), labels=c(\"varx\",\"residual\") )\n# regression weights\nregPaths     \u003c- mxPath( from=\"x\", to=\"y\", arrows=1,\n                        free=TRUE, values=1, labels=\"beta1\" )\n# means and intercepts\nmeans        \u003c- mxPath( from=\"one\", to=c(\"x\",\"y\"), arrows=1,\n                        free=TRUE, values=c(1,1), labels=c(\"meanx\",\"beta0\") )\n\nuniRegModel  \u003c- mxModel(model=\"Simple Regression Path Specification\", type=\"RAM\",\n                        dataRaw, manifestVars=c(\"x\",\"y\"), varPaths, regPaths, means)\n\nuniRegFit \u003c- mxRun(uniRegModel) # run it\nsummary(uniRegFit)\n```\n\nAnd the following output should appear in your R environment:\n\n```\nSummary of Simple Regression Path Specification\n\nfree parameters:\n      name matrix row col   Estimate  Std.Error A\n1    beta1      A   y   x 0.48311962 0.07757687\n2     varx      S   x   x 1.10531952 0.15631652\n3 residual      S   y   y 0.66520320 0.09407411\n4    meanx      M   1   x 0.05415975 0.10513428\n5    beta0      M   1   y 2.54776414 0.08166814\n\nModel Statistics:\n               |  Parameters  |  Degrees of Freedom  |  Fit (-2lnL units)\n       Model:              5                    195              536.8226\n   Saturated:              5                    195                    NA\nIndependence:              4                    196                    NA\nNumber of observations/statistics: 100/200\n\nInformation Criteria:\n      |  df Penalty  |  Parameters Penalty  |  Sample-Size Adjusted\nAIC:       146.8226               546.8226                 547.4609\nBIC:      -361.1856               559.8484                 544.0572\nCFI: NA\nTLI: 1   (also known as NNFI)\nRMSEA:  0  [95% CI (NA, NA)]\nProb(RMSEA \u003c= 0.05): NA\nTo get additional fit indices, see help(mxRefModels)\ntimestamp: 2022-05-01 09:53:24\n```\n\n## Simple regression using matrix algebra\n\nSince OpenMx is considered the specialist tool, you are probably more interested in the flexibility provided by the fact that you can build your own formulas. So going back to the simple regression, now in the formula (equivalent to the path specified in previous section):\n\n![simple regression](https://vipbg.vcu.edu/vipbg/OpenMx2/docs//OpenMx/latest/_images/math/363ea6ab84c0c97a7d183a4621616c7753040acb.png)\n\nIt can be implemented with the following code:\n\n\n```r\nrequire(OpenMx)\n\ndata(myRegDataRaw)  # load data\nSimpleDataRaw \u003c- myRegDataRaw[,c(\"x\",\"y\")]  # take only what is needed\n\n# create a data object\ndataRaw      \u003c- mxData( observed=SimpleDataRaw, type=\"raw\" )\n\n# A matrix\nmatrA        \u003c- mxMatrix( type=\"Full\", nrow=2, ncol=2,\n                          free=c(F,F,T,F), values=c(0,0,1,0),\n                          labels=c(NA,NA,\"beta1\",NA), byrow=TRUE, name=\"A\" )\n\n# S matrix\nmatrS        \u003c- mxMatrix( type=\"Symm\", nrow=2, ncol=2,\n                          free=c(T,F,F,T), values=c(1,0,0,1),\n                          labels=c(\"varx\",NA,NA,\"residual\"), byrow=TRUE, name=\"S\" )\n\n# Filter matrix\nmatrF        \u003c- mxMatrix( type=\"Iden\", nrow=2, ncol=2, name=\"F\" )\n\n# M matrix\nmatrM        \u003c- mxMatrix( type=\"Full\", nrow=1, ncol=2,\n                          free=c(T,T), values=c(0,0),\n                          labels=c(\"meanx\",\"beta0\"), name=\"M\")\n\n# Which expectation? RAM in this case\nexpRAM       \u003c- mxExpectationRAM(\"A\",\"S\",\"F\",\"M\", dimnames=c(\"x\",\"y\"))\n\n# Run a maximum likelihood\nfunML        \u003c- mxFitFunctionML()\n\n# Name it, pass the objects on to a final model object\nuniRegModel  \u003c- mxModel(\"Simple Regression Matrix Specification\",\n                        dataRaw, matrA, matrS, matrF, matrM, expRAM, funML)\n\n# Run it!\nuniRegFit \u003c- mxRun(uniRegModel)\n\nsummary(uniRegFit)\n```\n\n\nNow the output looks like:\n\n\n```\nRunning Simple Regression Matrix Specification with 5 parameters\nSummary of Simple Regression Matrix Specification\n\nfree parameters:\n      name matrix row col   Estimate  Std.Error A\n1    beta1      A   2   1 0.48311963 0.07757699\n2     varx      S   1   1 1.10531937 0.15631498\n3 residual      S   2   2 0.66520312 0.09407369\n4    meanx      M   1   x 0.05416001 0.10513400\n5    beta0      M   1   y 2.54776424 0.08166812\n\nModel Statistics:\n               |  Parameters  |  Degrees of Freedom  |  Fit (-2\n       Model:              5                    195\n   Saturated:              5                    195\nIndependence:              4                    196\nNumber of observations/statistics: 100/200\n\nInformation Criteria:\n      |  df Penalty  |  Parameters Penalty  |  Sample-Size Adju\nAIC:       146.8226               546.8226                 547.\nBIC:      -361.1856               559.8484                 544.\nCFI: NA\nTLI: 1   (also known as NNFI)\nRMSEA:  0  [95% CI (NA, NA)]\nProb(RMSEA \u003c= 0.05): NA\nTo get additional fit indices, see help(mxRefModels)\ntimestamp: 2022-05-01 10:04:52\nWall clock time: 0.3507566 secs\noptimizer:  SLSQP\nOpenMx version number: 2.19.6.6\nNeed help?  See help(mxSummary)\n```\n\n# Related work\n\n[umx()](https://github.com/tbates/umx) is a sister R package that bridges the gap between [lavaan](https://github.com/yrosseel/lavaan) and OpenMx. If you are coming from lavaan it is perhaps useful to check umx() too. [Onyx](https://onyx-sem.com/) is a software that allows you to design nice diagrams, and syncs (exports and imports) the diagrams with OpenMx code.\n\n# Community and getting help\n\n1. The support communication is centered around the OpenMx [forum](https://openmx.ssri.psu.edu/forums)\n2. Also, but less often, at the StackOverflow OpenMx [tag](https://stackoverflow.com/questions/tagged/openmx).\n\n\n## Training\n\nWe gather annually in beautiful [Boulder, CO](https://www.colorado.edu/ibg/workshop) for the international workshop for traning in behavioral genetics applications of OpenMx.\n\n\n# Contributing\n\n\u003cdetails\u003e\n\u003csummary\u003eHow can I contribute to this project?\u003c/summary\u003e\n\u003cbr\u003e\nOpenMx is maintained by a small team and all help is appreciated.\n\nFirst read the team's conduct policy [here](https://github.com/OpenMx/OpenMx/blob/master/CONTRIBUTING). If you agree with it you can choose one of the below paths:\n\n1. Do you have a well documented script (from one of our several workshops) that would make a great vignette? Great, because you don't even need to know how to use git. Simply go to the vignette folder and click in add file. This will automate the forking and uploading. \n2. There are several issues that can be handled by new users. Go over to our oldest issues [here](https://github.com/OpenMx/OpenMx/issues?q=is%3Aissue+is%3Aopen+sort%3Acreated-asc), browse until something you find an issue you feel you can contribute to, and announce that you are planning to tackle it in the issue thread.\n3. Have a completely new functionality that you want to discuss? Just create a PR and we will discuss whether it aligns with the package direction. In this case please add proper documentation for the new functionality. If you use RStudio there is a stub at File \u003e New File \u003e R Documentation. Also create a test unit in the tests/testthat folder, we currently use [testthat](https://testthat.r-lib.org/) to manage this. \n\u003cbr\u003e\n\n\u003c/details\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenmx%2Fopenmx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenmx%2Fopenmx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenmx%2Fopenmx/lists"}