Home
OpenMx Reference Manual
Contents
1. 181 R topics documented mxRAMObjective llle ee 181 icu T Tc 184 mxRestore 2454 nene Pees PARR GG ACE e e her eee Noe ob E UN en 185 mxRObjectiVe oos oOx RR Rer E m wo ea AD Om e ale 186 mxRowObjective cs i ld s r ca Sr p X 9 4 ROB 8 dom Robes Bod 4 OR Pos 187 MXRUN 4 2846 425544 TT 189 TT 191 192 mxSimplify2Array oco kene a q w Oq W w 193 193 mix Threshold srat ome same a eae Gta be be eo CE dues S ee ek RUE 196 mxlrHarmd 2232 ke ESR SERRE EES EEE ME Se ee a 198 Ga Be Petals wo Ew aa ab ees bee ow Gaels 200 aw SC CERTE MC ee a Oe yoy be en we ee oe ee ee 200 myAutoregressiveData 201 myFADataRaw zoo Po x x eb E wo ee OR OR a WQ e ed 202 myGrowthKnownClassData 203 myGrowthMixtureData 204 myLongitudinalData 205 myReeData io xoxo SOS OE eee EUROS POR SOROR E s ee E w 206 myRegDataRaw s kup sn 207 exequi a WU Erk sedo
2. ssp Euh roo eor oed eS eade ka Suede s deus 58 latentMul pleRegExamplel 59 latentMultipleRegExample2 60 lun prr 61 muliDatal 22 23 c9 x9 ee Xo on ERE e oye ped 61 mxAlsebra fk eae be ko 9 X opos dom fem mo EME US Fue ee de 62 MxAlgebra class o cocco oss n om ok ok e OR RR OR GR Rm RR RR ee USU 65 MxAlgebraFormula cdlass 2r 66 mxAlgebraFromString 66 mxAlgebraObjectiv 67 69 1 69 1 8 70 MxBaseNamed class 9 9 sss esse es 70 1 8 70 MXBOUNS gt e v ORDRE UR o ER BOX GR EU EUR ee 71 MxBounds class 44 28 96 ie we Se edel e xu eq snb eue Ks denn m dosis T2 MxCharOrLast Class oo Eoo RR fo RE BUR ON PUR EROR Fe ee POS 72 MxCharOrNumber class 73 mxCheckiIdentificati ohi lt s 4 Q pa Heo ORS ESSE SEY bers 73 MIOL egg do pue does FS do s suri Bate dice ele ee Bae eo dos 75 MXxCLclass 24e m Ro OX eR ERE A Ra Re RR dE TI mxCompa
3. imxVerifyName imxVerifyName Description This is an internal function exported for those people who know what they are doing Usage imxVerifyName name stackNumber Arguments name name stackNumber stackNumber 56 imx WIsChiSquare imxVerifyReference imxVerifyReference Description This is an internal function exported for those people who know what they are doing Usage imxVerifyReference reference stackNumber Arguments reference reference stackNumber stackNumber imxWlsChiSquare Calculate Chi Square for a WLS Model Description This is an internal function used to calculate the Chi Square distributed fit statistic for weighted least squares models Usage imxWlsChiSquare model J NA Arguments model An MxModel object with acov WLS data J Optional pre computed Jacobian matrix Details The Chi Square fit statistic for models fit with maximum likelihood depends on the difference in model fit in minus two log likelihood units between the saturated model and the more restricted model under investigation For models fit with weighted least squares a different expression is required If J is the first derivative Jacobian of the mapping from the free parameters to the unique elements of the expected covariance means and threholds Je is the orthogonal complement of J W is the inverse of the full weight matrix and e is the differnce between the sample estimated and model implied covariance m
4. omxRMSEA Get the RMSEA with confidence intervals from model Description This function calculates the Root Mean Square Error of the Approximation RMSEA for a model and computes confidence intervals for that fit statistic Usage omxRMSEA model lower 025 upper 975 null 05 Arguments model An MxModel object for which the RMSEA is desried lower The lower confidence bound for the confidence interval upper The upper confidence bound for the confidence interval null Value of RMSEA used to test for close fit Further named arguments passed to summary Details To help users obtain fit statistics related to the RMSEA this function confidence intervals and a test for close fit The user determines how close the fit is required to be by setting the null argument to the value desired for comparison Value A named vector with elements lower est rmsea upper null and Prob x lt null References Browne M W amp Cudeck R 1992 Alternative Ways of Assessing Model Fit Sociological Methods and Research 21 230 258 240 omxSapply Examples require OpenMx data demoOneFactor manifests lt names demoOneFactor latents lt c G factorModel mxModel One Factor type RAM manifestVars manifests latentVars latents mxPath from latents to manifests mxPath from manifests arrows 2 mxPath from latents arrows 2 free FALSE values 1 0 mxData observed cov demoOneFactor type cov numO
5. may remove the prediction of an expectation Usage mxComputeNothing 88 mxComputeNumericDeriv mxComputeNumericDeriv Numerically estimate Hessian using Richardson extrapolation Description For N free parameters Richardson extrapolation requires iterations N 2 N function evalua tions The implementation is closely based on the numDeriv R package Usage mxComputeNumericDeriv freeSet NA_character_ fitfunction fitfunction parallel TRUE stepSize 1 04 iterations 4L verbose L knownHessian NULL checkGradient TRUE Arguments freeSet names of matrices containing free variables Not used Forces remaining arguments to be specified by name fitfunction name of the fitfunction defaults to fitfunction parallel whether to evaluate the fitfunction in parallel defaults to TRUE stepSize starting set size defaults to 0 0001 iterations number of Richardson extrapolation iterations defaults to 4L verbose Level of debugging output knownHessian an optional matrix of known Hessian entries checkGradient whether to check the first order convergence criterion gradient is near zero Details In addition to an estimate of the Hessian forward central and backward estimates of the gradient are made available in this compute plan s output slot When checkGradient TRUE the central difference estimate of the gradient is used to determine whether the first order convergence criterio
6. References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation Examples data example1 plot X2 X1 data example1 example2 21 example2 Bivariate twin data example from Classic Mx Manual Description Data set used in some of OpenMx s examples Usage data example2 Format A data frame with 800 observations on the following variables IDNum ID number TwinNum Twin ID number Zygosity Zygosity of the twin X X variable for twins 1 and 2 Y Y variable for twins 1 and 2 Details Same as examplel but in tall format instead of wide Source Classic Mx Manual References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation Examples data example2 plot Y X data example2 22 factorExample1 expm Matrix exponential Description Matrix exponential Usage expm x Arguments x matrix factorExamplel Example Factor Analysis Data Description Data set used in some of OpenMx s examples Usage data factorExamplel Format A data frame with 500 observations on the following variables x1 x2 x3 x4 x5 x6 x7 x8 x9 Details This appears to be a three factor model but perhaps with an odd loading structure factorScaleExample 1 23 Source Simulated References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation Examples data factorExampl
7. Define the expectation expFunction lt mxExpectationRAM M M dimnames tmpNames Choose a fit function fitFunction mxFitFunctionML Define the model tmpModel lt mxModel model exampleRAMModel matrixA matrixS matrixF matrixM expFunction fitFunction mxData observed tmpFrame type raw Fit the model and print a summary tmpModelOut mxRun tmpModel summary tmpModelOut mxExpectationStateSpace Create an MxExpectationStateSpace Object Description This function creates a new MxExpectationStateSpace object Usage mxExpectationStateSpace A B C D Q R x0 u dimnames NA thresholds NA threshnames dimnames t NA scores FALSE Arguments A A character string indicating the name of the A matrix B A character string indicating the name of the B matrix C A character string indicating the name of the C matrix 118 mxExpectationStateSpace A character string indicating the name of the D matrix Q A character string indicating the name of the Q matrix R A character string indicating the name of the R matrix A character string indicating the name of the 0 matrix PQ A character string indicating the name of the PO matrix u A character string indicating the name of u matrix dimnames An optional character vector to be assigned to the row names of C matrix thresholds Not Yet Implemented An optional character
8. MxExpectationGREML class 107 X A matrix to contain the X matrix of covariates yXcolnames Character vector used to store the column names of y and X casesToDrop Integer vector specifying the rows and columns of the V matrix to be removed at runtime b A matrix to contain the vector of regression coefficients calculated at runtime bcov A matrix to contain the sampling covariance matrix of the regression coefficients calculated at runtime numFixEff Integer number of covariates in X dims Object of class character numStats Numeric number of observed statistics dataColumns Object of class numeric name Object of class character data Object of class MxCharOrNumber submodels Object of class MxOptionalCharOrNumber container Object of class MxOptionalCharOrNumber runDims Object of class character Extends Class MxBaseExpectation directly Class MxBaseNamed by class MxBaseExpectation dis tance 2 Class MxExpectation by class MxBaseExpectation distance 2 Methods No methods defined with class MxExpectationGREML in the signature References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation See Also See mxExpectationGREML for creating MxExpectationGREML objects and for more informa tion generally concerning GREML analyses including a complete example More information about the OpenMx package may be fou
9. References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation See Also omxCheckWarning omxCheckWithinPercentError omxCheckIdentical omxCheckSetEquals omxCheckTrue omxCheckEquals Examples A lt mxMatrix Full 1 1 labels data foo free TRUE name A model lt mxModel model A omxCheckError mxRun mode1 paste The definition variable data foo has been assigned to a free parameter in matrix A omxCheckCloseEnough matrix 3 3 3 matrix 4 3 3 epsilon 2 Throws error check the message tmsg lt paste In omxCheckCloseEnough c 1 2 3 c 1 1 1 9 3 0 01 not equal to within 0 01 1 2 3 and 1 1 1 9 3 omxCheckError omxCheckCloseEnough c 1 2 3 c 1 1 1 9 3 0 01 tmsg 222 omxCheckldentical omxCheckIdentical Exact Equality Testing Function Description This function tests whether two objects are equal Usage omxCheckIdentical a b Arguments a the first value to compare b the second value to compare Details Performs the identical comparison on the two arguments If the two arguments are not equal then an error will be thrown If a and b are equal to each other by default the function will print a statement informing the user the test has passed To turn off these print statements use options mxPrintUnitTests FALSE References The OpenMx User s guide can be found at h
10. data myRegData data myRegDataRaw all myRegDataRaw myRegData 208 myTwinData myTwinData Twin data on weight and height Description Data set used in some of OpenMx s examples Usage data myTwinData Format A data frame with 3808 observations on the following variables fam Family ID variable age Age of the twin pair Range 17 to 88 zyg Integer codes for zygosity and gender combinations part wt1 Weight in kilograms for twin 1 wt2 Weight in kilograms for twin 2 ht1 Height in meters for twin 1 ht2 Height in meters for twin 2 htwt1 Product of ht and wt for twin 1 htwt2 Product of ht and wt for twin 2 bmil Body Mass Index for twin 1 bmi2 Body Mass Index for twin 2 Details Height and weight are highly correlated and each individually highly heritable These data present and opportunity for multivariate behavior genetics modeling Source Timothy Bates References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation Examples data myTwinData plot ht1 wt1 myTwinData mzfData 209 mzfData MZ female example twin data Descrip tion Data for extended twin example ETC88 R Usage dat Format A data frame with 3099 observations on the following 37 variables famid a numeric vector el e2 e3 e4 e5 e6 e7 e8 9 1 11 12 13 14 15 16 17 18 1 2 a3 a4 a5 a6 a mzfData a numeri
11. names demoOneFactor latents c G factorModel mxModel One Factor type RAM manifestVars manifests latentVars latents 166 mxMLObjective mxPath from latents to manifests mxPath from manifests arrows 2 mxPath from latents arrows 2 free FALSE values 1 0 mxPath from one to manifests mxData demoOneFactor 1 200 type raw Not full data No SEs for speed factorModel lt mxOption factorModel Standard Errors No factorRun lt mxRun factorModel See if it should be modified Notes Using full FALSE for faster performance Using matrices A and S to not get MIs for the F matrix which is always fixed fim mxMI factorRun matrices c A S full FALSE round fim MI 3 plot fim MI ylim c 0 10 abline h qchisq p 1 01 1 line of significance mxMLObjective DEPRECATED Create MxMLObjective Object Description WARNING Objective functions have been deprecated as of OpenMx 2 0 Please use mxExpectationNormal and mxFitFunctionML instead As a temporary workaround mxMLObjective returns a list containing MxExpectationNormal object and an MxFitFunctionML object mxMLObjective covariance means NA dimnames NA thresholds NA All occurrences of mxMLObjective covariance means NA dimnames NA thresholds NA Should be changed to mxExpectationNormal covariance means NA dimnames NA thresholds NA threshnames
12. 2 values c 0 1 0 0 free c FALSE TRUE FALSE FALSE labels c NA b NA NA name A I mxMatrix type Iden nrow 2 ncol 2 name I Define the expectation expCov lt mxAlgebra solve I A S t solve I A name expCov expFunction lt mxExpectationNormal covariance expCov dimnames tmpNames Choose a fit function fitFunction lt mxFitFunctionWLS Define the model tmpModel mxModel model exampleModel S A I expCov expFunction fitFunction wdata Fit the model and print a summary tmpModelOut mxRun tmpModel summary tmpModelOut MxFlatModel class MxFlatModel 148 mxGenerateData Description This is an internal class and should not be used mxGenerateData Generate data based on an MxModel object Description This function creates a randomly sampled data set based on the model Usage mxGenerateData model nrows Arguments model An MxModel object upon which the data are generated nrows Numeric The number of rows of data to generate Details This function looks inside the MxModel object to extract the model implied means and covariance It then generates data with the same mean and covariance Data can be generated based on Nor mal mxExpectationNormal RAM mxExpectationRAM and LISREL mxExpectationLISREL models Thresholds and ordinal data are implemented by generating continuous data and then using cut and mxFactor to break the conti
13. 9 RO ea ER ee meg 228 omxGetRAMDepth A Re W RR UE RR ce W 230 OmxGraphViZ lone lt e wh aA eA eee S KUN Q ER 23 cereo Slee eR S Q Ue E RO Oe Se ee Eee ee wee 23 BaseCompute class 9 omxLocateParameters 22 a q s MUS W aw W OW WU Q 232 omxLogical ak sss RS SE ee SY R E SU SR a Se 233 234 omxMnor 2 ssl ss 234 omxNameAnonymousParameters 235 omxNormalQuantiles llle 236 omxParalelCI 25 22 oz o RR E DRY RR PU E XY ES 237 OIIXOUOLES s ge eu Q Bada ok P reed SOEUR Ea done 238 omxRAMtoML 2 2 sc be slug huy HRA Beda be eh EY XY 238 OmxRMSBA uu Se ee egg oe ae eo D 239 omxSapply 22 PRS OEE dh bh OK uU GR a ee 240 1 241 omxSelectRowsAndCols 242 omxSetParameters 243 omxSymbolTable 244 2 kb uy hoap eee RR GE E Q s ae Robo a bee 245 ordinal winData os spn ad 3s SOS HR SRS RE SU E we d 246 IVeCLORlZe z S BE Fo BOARS GS q g MS Bi ox wee Boe be
14. LObjective requires that argument in the associated MxData object be equal to cov or cov The covariance argument of this function evaluates with respect to the matrix argument of the associated MxData object while the means argument of this function evaluates with respect to the vector argument of the associated MxData object The means and vector arguments are optional in both functions If the means argument is not specified NA the optional vector argu ment of the MxData object is ignored If the means argument is specified the associated MxData object should specify means argument of equivalent dimension as the means algebra dimnames must be supplied where the matrices referenced by the covariance and means algebras are not themselves labeled Failure to do so leads to an error noting that the covariance or means matrix associated with the ML objective does not contain dimnames To evaluate place MxMLObjective objects the mxData object for which the expected covariance approximates referenced MxAlgebra and MxMatrix objects and optional MxBounds and MxCon straint objects in an MxModel object This model may then be evaluated using the mxRun function The results of the optimization can be found in the output slot of the resulting model or using the mxEval function Value Returns a list containing an MxExpectationNormal object and an MxFitFunctionML object Referen
15. Remove heirarchical structure from model Usage imxFlattenModel model namespace Arguments model model namespace namespace imxFreezeModel Freeze model Description Remove free parameters and fit function from model Usage imxFreezeModel model Arguments model model imxGenerateLabels imxGenerateLabels Description This is an internal function exported for those people who know what they are doing Usage imxGenerateLabels model Arguments model model 38 imxGenericModelBuilder imxGenerateNamespace Description This is an internal function exported for those people who know what they are doing Usage imxGenerateNamespace model Arguments model model imxGenericModelBuilder imxGenericModelBuilder Description This is an internal function exported for those people who know what they are doing Usage imxGenericModelBuilder model lst name manifestVars latentVars submodels remove independent Arguments model model lst Ist name name manifestVars manifestVars latentVars latent Vars submodels submodels remove remove independent independent imxGenSwift 39 imxGenSwift imxGenSwift Description This is an internal function exported for those people who know what they are doing Usage imxGenSwift tc sites sfile Arguments tc tc sites sites sfile sfile imxGetSlotDisplayNames imx
16. digits option See Also mxModel options use options mxOptions to see all the OpenMx specific options Examples data demoOneFactor manifests lt names demoOneFactor latents c G1 modell lt mxModel model One Factor type RAM manifestVars manifests latentVars latents mxPath from latents to manifests mxPath from manifests arrows 2 mxPath from latents arrows 2 free FALSE values 1 0 mxData cov demoOneFactor type cov numObs 500 fitl lt mxRun model1 latents lt c Gl G2 model2 mxModel model 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 mxData cov demoOneFactor type cov numObs 500 fit2 mxRun model2 mxCompare fitl 112 vary precision of the output oldPrecision as numeric options digits options digits 1 mxCompare fitl 112 options digits oldPrecision MxCompute class 81 MxCompute class MxCompute Description This is an internal class and should not be used directly mxComputeConfidenceInterval Find likelihood based confidence intervals Description There are various ways to pose an equivalent profile likelihood problem For good performance it is essential to tai
17. t A U name R mxExpectationNormal covariance R dimnames names demoOneFactor mxFitFunctionML mxData observed cov demoOneFactor type cov numObs 500 mxComputeSequence steps list mxComputeGradientDescent mxComputeNumericDeriv mxComputeStandardError mxComputeHessianQuality factorModelFit lt mxRun factorModel factorModelFit output conditionNumber 29 5 mxComputeHessianQuality Compute the quality of the Hessian Description Tests whether the Hessian is positive definite model output infoDefinite and if so computes the approximate condition number model output conditionNumber See Luenberger amp Ye 2008 Second Order Test p 190 and Condition Number p 239 Usage mxComputeHessianQuality freeSet NA_character_ verbose 0L 86 mxComputelterate Arguments freeSet names of matrices containing free variables Not used Forces remaining arguments to be specified by name verbose Level of debugging output Details The condition number is approximated by norm H x norm H 1 where H is the Hessian The norm is either the 1 or infinity norm both obtain the same result due to symmetry References Luenberger D G amp Ye Y 2008 Linear and nonlinear programming Springer mxComputeIterate Repeatedly invoke a series of compute objects until change is less than tolerance Description One step typically the last must compute the fit or max AbsChange
18. Details NOTE THIS DESCRIPTION IS DEPRECATED Please change to using mxExpectationNormal and mxFitFunctionML as shown in the example below Objective functions were functions for which free parameter values are chosen such that the value of the objective function is minimized The mxFIMLObjective function used full information max imum likelihood to provide maximum likelihood estimates of free parameters in the algebra defined by the covariance and means arguments The covariance argument takes an MxAlgebra ob ject which defines the expected covariance of an associated MxData object The means argument takes an MxAlgebra object which defines the expected means of an associated MxData object The dimnames arguments takes an optional character vector If this argument is not a single NA then this vector is used to assign the dimnames of the means vector as well as the row and columns dimnames of the covariance matrix The vector argument is either TRUE or FALSE and determines whether the objective function returns a column vector of the likelihoods or a single 2 log likelihood value thresholds The name of the thresholds matrix When needed for modelling ordinal data this matrix should be created using mxMatrix The thresholds matrix must have as many columns as there are ordinal variables in the model and number of rows equal to one fewer than the maximum number of levels found in the ordinal variables The st
19. If a and b are approximately equal to each other by default the function will print a statement informing the user the test has passed To turn off these print statements use options mxPrintUnitTests FALSE References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation See Also omxCheckCloseEnough omxCheckIdentical omxCheckSetEquals omxCheckTrue omxCheckEquals Examples omxCheckWithinPercentError c 1 2 3 c 1 1 1 9 3 0 percent 50 omxCheckWithinPercentError matrix 3 3 3 matrix 4 3 3 percent 150 Throws an error try omxCheckWithinPercentError c 1 2 3 c 1 1 1 9 3 0 percent 0 01 omxConstrainMLThresholds 227 omxConstrainMLThresholds omxConstrainMLThresholds Description Add constraint to ML model to keep thresholds in order Usage omxConstrainMLThresholds model dist 0 1 Arguments model the MxModel to which constraints should be added dist unused Details This function adds a nonlinear constraint to an ML model The constraint keeps the thresholds in order Constraints often slow model estimation however keeping the thresholds in increasing order helps ensure the likelihood function is well defined If you re having problems with ordinal data this is one of the things to try Value a new MxModel object with the constraints added See Also demo omxConstrainMLThresholds omxDetectCores omxDetectCores D
20. The means argument is not required but may be included for estimations involving means The thresholds argument is not required but may be included for estima tions involving thresholds and ordinal variables The numObs argument is required which should reflect the number of observations or rows in the data described by the polychoric correlation matrix Data of this type may use the fit functions such as mxFitFunctionWLS functions depending on the specified model MxData objects may not be included in MxAlgebra objects or use the mxFitFunctionAlgebra func tion If these capabilities are desired data should be appropriately input or transformed using the mxMatrix and mxAlgebra functions While column names are stored in the observed slot of MxData objects these names are not recognized as variable names in MxPath objects Variable names must be specified using the man ifestVars argument of the mxModel function prior to use in MxPath objects The mxData function does not currently place restrictions on the size shape or symmetry of matri ces input into the observed argument While it is possible to specify MxData objects as covariance or correlation matrices that do not have the properties commonly associated with these matrices failure to correctly specify these matrices will likely lead to problems in model estimation OpenMx uses the names of variables to map them onto the expectation functions and o
21. Usage mxComputeIterate steps maxIter 500L tolerance 1e 09 verbose 0L freeSet NA character Arguments steps a list of compute objects Not used Forces remaining arguments to be specified by name maxIter the maximum number of iterations tolerance iterates until maximum relative change is less than tolerance verbose level of debugging output freeSet Names of matrices containing free variables mxComputeNewtonRaphson 87 mxComputeNewtonRaphson Optimize parameters using the Newton Raphson algorithm Description This optimizer requires analytic 1st and 2nd derivatives of the fit function Comprehensive diagnos tics are available by increasing the verbose level Usage mxComputeNewtonRaphson freeSet NA character fitfunction fitfunction maxIter 100L tolerance 1e 12 verbose 0L Arguments freeSet names of matrices containing free variables Not used Forces remaining arguments to be specified by name fitfunction name of the fitfunction defaults to fitfunction maxIter maximum number of iterations tolerance optimization is considered converged when the maximum relative change in fit is less than tolerance verbose level of debugging output References Luenberger D G amp Ye Y 2008 Linear and nonlinear programming Springer mxComputeNothing Compute nothing Description Note that this compute plan actually does nothing whereas mnxComputeOnce expectation nothing
22. Vx NA NA Vy name S matrixA mxMatrix type Full nrow 2 ncol 2 values c 0 1 0 0 free c FALSE TRUE FALSE FALSE labels c NA b NA NA name A matrixF mxMatrix type Iden nrow 2 ncol 2 name F matrixM lt mxMatrix type Full nrow 1 ncol 2 values c 0 0 free c TRUE TRUE labels c Mx My name M Define the expectation expFunction lt mxExpectationRAM M M dimnames tmpNames Choose a fit function fitFunction mxFitFunctionML Define the model tmpModel lt mxModel model exampleRAMModel matrixA matrixS matrixF matrixM expFunction fitFunction mxData observed tmpFrame type raw Fit the model and print a summary 184 mxRename tmpModelOut mxRun tmpModel summary tmpModelOut mxRename Rename MxModel or a Submodel Description This functions renames either the top model or a submodel to a new name All internal references to the old model name are replaced with references to the new name Usage mxRename model newname oldname NA Arguments model a MxModel object newname the new name of the model oldname the name of the target model to rename If NA then rename top model Value Return a mxModel object with the target model renamed References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation Examples library OpenMx create two empty models modelA mxMo
23. dimnames mxFitFunctionML vector FALSE Arguments covariance A character string indicating the name of the expected covariance algebra means An optional character string indicating the name of the expected means algebra dimnames An optional character vector to be assigned to the dimnames of the covariance and means algebras thresholds An optional character string indicating the name of the thresholds matrix mxMLObjective 167 Details NOTE THIS DESCRIPTION IS DEPRECATED Please change to using mxExpectationNormal and mxFitFunctionML as shown in the example below Objective functions are functions for which free parameter values are chosen such that the value of the objective function is minimized The mxMLObjective function uses full information maximum likelihood to provide maximum likelihood estimates of free parameters in the algebra defined by the covariance argument given the covariance of an MxData object The covariance argument takes an MxAlgebra object which defines the expected covariance of an associated MxData object The dimnames arguments takes an optional character vector If this argument is not a single NA then this vector be assigned to be the dimnames of the means vector and the row and columns dimnames of the covariance matrix mxMLObjective evaluates with respect to an MxData object The MxData object need not be referenced in the mxMLObjective function but must be included in the MxModel object mxM
24. free TRUE name foo Create a 3 x 3 symmetric matrix with free off diagonal parameters and starting values symmMatrix mxMatrix type Symm nrow 3 ncol 3 free c FALSE TRUE TRUE FALSE TRUE FALSE values c 1 8 8 1 8 1 labels c NA freel free2 NA free3 NA name bar MxMatrix class MxMatrix Class Description MxMatrix is a virtual S4 class that comprises the nine types of matrix objects used by OpenMx see mxMatrix for details An MxMatrix object is a named entity New instances of this class can be created using the function mxMatrix MxMatrix objects may be used as arguments in other functions from the OpenMx package including mxAlgebra mxConstraint and mxModel MxMatrix class 163 Objects from the Class All nine types of object that the class comprises can be created via mxMatrix Slots name Character string the name of the MxMatrix object Note that this is the object s Mx name so to speak which identifies it in OpenMx s internal namespace rather than the symbol identifying it in R s worskpace Use of MxMatrix objects in an mxAlgebra or mxConstraint function requires reference by name values Numeric matrix of values If an element is specified as a fixed parameter in the free matrix then the element in the values matrix is treated as a constant value and cannot be altered or updated by an objective function when included in
25. jects are listed by name Two objects may not share the same name If a new MxConstraint is added to an MxModel object with the same name as an MxConstraint object in that model the added ver sion replaces the previous version All MxMatrix objects referenced in the included MxConstraint objects must be included in the matrices slot prior to estimation There is no imposed limit on the number of MxAlgebra objects that may be added here The intervals slot contains a list of the confidence intervals requested by included MxCI objects These objects are listed by the free parameters MxMatrices and MxAlgebras referenced in the MxCI objects not the list of MxCI objects themselves If a new MxCI object is added to an Mx Model object referencing one or more free parameters MxMatrices or MxAlgebras previously listed in the intervals slot the new confidence interval s replace the existing ones All listed confidence intervals must refer to free parameters MxMatrices or MxAlgebras in the model MxModel class 173 The bounds slot contains a list of the MxBounds objects included in the model These objects are listed by name Two objects may not share the same name If a new MxBounds is added to an MxModel object with the same name as an MxBounds object in that model the added version replaces the previous version All MxMatrix objects referenced in the included MxBounds objects must be included in the matrices slot prior to e
26. k a alaq s WW p Q w b w a 48 imxReplaceModels dier y s z US les 48 imxReplaceSlot a ewe 49 49 imxReverselden fier 4 4 Re Oa EO ee SS 50 imxSamelype 4 4 64 4 bw ae eA we OE s EER OS KOP 9 s ee 50 imxSseparatorChar o som Res X RA RUE EE ERE eS eS Ras 50 IxstClhent e ie wae Ae Bs ep dius Othe Se Me Seat oo CA DEE e S 5J 51 imxsparsel vertz iuo See OR RAE OEY EE RS See ESOS Sek ND q 51 imxsquareMatrx iere Exe Bede se Bay mu HOSS oho EE aqu 52 imxSymmetricMatrix 32 exem Rmo SAR EU SON ESS ERE Ew OEM RH Q 52 imxUntitledName lees 53 53 imxUntiledNumberReset 22er 53 imxUpdateModelValues 54 imxVariableTypes os ee 54 mx VerifyMAUDTS ka aw See E SCR X DS Ow ee ee a 23 imxVenfyModel esp ng A Re a Gk S W Re TR EUR A USE e 35 imxVenfyName c yh oh oo RR ROS E Roe o KUN y p og Ro 55 imxVentfyReterence uos Soak KE ee S RS ae exe 56 R topics documented imxWlsChiSquare leere 56 imxWisStandardErrors es 57
27. latents mxPath from latents to manifests labels paste b 1 5 sep mxPath from manifests arrows 2 labels paste u 1 5 sep mxPath from latents arrows 2 free FALSE values 1 0 mxData cov demoOneFactor type cov numObs 500 model mxRun model Run the model returning the result into model summary model Show summary of the fitted model mxSave Save End State to Checkpoint File Description The function saves the last state of a model to a checkpoint file Usage mxSave model chkpt directory chkpt prefix Arguments model MxModel object to be loaded chkpt directory character Directory where the checkpoint file is located chkpt prefix character Prefix of the checkpoint file Details In general the arguments chkpt directory and chkpt prefix should be identical to the mxOption Checkpoint Directory and Checkpoint Prefix that were specificed on the model before execution Alternatively the checkpoint file can be manually loaded as a data frame in R Use read table with the options header TRUE sep t stringsAsFactors FALSE check names FALSE 192 mxSetDefaultOptions Value Returns a logical indicating the succes of writing the checkpoint file to the checkpoint directory References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation Examples library OpenMx Simulate some data x rnorm 1000 mean 0 sd
28. 1 y 0 5 x rnorm 1000 mean 0 sd 1 tmpFrame data frame x y tmpNames names tmpFrame Create a model that includes an expected covariance matrix an expectation function a fit function and an observed covariance matrix data mxData cov tmpFrame type cov numObs 1000 expCov lt mxMatrix type Symm nrow 2 ncol 2 values c 2 1 2 free TRUE name expCov expFunction lt mxExpectationNormal covariance expCov dimnames tmpNames fitFunction mxFitFunctionML testModel mxModel model testModel expCov data expFunction fitFunction Use mxRun to optimize the free parameters in the expected covariance matrix modelOut mxRun testModel modelOut expCov Save the ending state of modelOut in a checkpoint file mxSave modelOut Restore the saved model from the checkpoint file modelSaved mxRestore testModel modelSaved expCov Imagine how much time you saved by not having to re run the model that took hours or days to run mxSetDefaultOptions Reset global options to the default Description Reset global options to the default mxSimplify2Array 193 Usage mxSetDefaultOptions mxSimplify2Array Like simplify2array but works with vectors of different lengths Description Vectors are filled column by column into a matrix Shorter vectors are padded with NAs to fill whole columns Usage mxSimplify2Array x higher FALSE Arguments x a list of v
29. 1 FALSE 1 name PQ mxMatrix Zero 1 1 name u mxData observed demoOneFactor 1 100 type raw fewer rows fast mxExpectationStateSpace A B C D 0 xg pg u mxFitFunctionML ssRun mxRun ssModel summary ssRun Note the freely estimated Autoregressive parameter A matrix is near zero as it should be for the independent rows of data from the factor model Create and fit a model with INPUTS using mxMatrix mxExpectationStateSpace and mxFitFunctionML require OpenMx data demoOneFactor nvar lt ncol demoOneFactor varnames lt colnames demoOneFactor demoOneFactorInputs lt cbind demoOneFactor V1 rep 1 nrow demoOneFactor demoOneFactorInputs lt cbind demoOneFactor V1 rnorm nrow demoOneFactor ssModel lt mxModel model State Space Inputs Manual Example mxMatrix Full 1 1 TRUE 3 name A mxMatrix Full 1 1 TRUE values 1 name B mxMatrix Full nvar 1 TRUE 6 name C dimnames list varnames F1 mxMatrix Zero nvar 1 name D mxMatrix Diag 1 1 FALSE 1 name Q mxMatrix Diag nvar nvar TRUE 2 name R 122 mxExpectationS tateS paceContinuous Time mxMatrix Zero 1 1 name x0 mxMatrix Diag 1 1 FALSE 1 name PQ mxMatrix Full 1 1 FALSE labels data V1 name u mxData observed demoOneFactorInputs 1 100 type raw fewer rows fast mxExpectationStateSpac
30. 909 Ramsay J O 1975 Solving implicit equations in psychometric data analysis Psychometrika 40 3 337 360 Varadhan R amp Roland C 2008 Simple and globally convergent methods for accelerating the convergence of any EM algorithm Scandinavian Journal of Statistics 35 335 353 84 mxComputeGradientDescent mxComputeGradientDescent Optimize parameters using a gradient descent optimizer Description This optimizer does not require analytic derivatives of the fit function The open source version of OpenMx only offers 1 choice SLSQP from the NLOPT collection The proprietary version of OpenMx offers the choice of two optimizers SLSQP and NPSOL Usage mxComputeGradientDescent freeSet NA_character_ engine NULL fitfunction fitfunction verbose 0L tolerance NA real useGradient NULL warmStart NULL nudgeZeroStarts TRUE maxMajorIter NULL gradientAlgo mxOption NULL Gradient algorithm gradientIterations mxOption NULL Gradient iterations gradientStepSize 1e 05 Arguments freeSet names of matrices containing free variables Not used Forces remaining arguments to be specified by name engine specific NPSOL or SLSQP fitfunction name of the fitfunction defaults to fitfunction verbose level of debugging output tolerance how close to the optimum is close enough also known as the optimality toler ance useGradient whether to use the analytic gradient
31. A character string indicating the name of the t matrix mxExpectationStateSpaceContinuous Time 123 dimnames An optional character vector to be assigned to the row names of the C matrix thresholds Not Yet Implemented An optional character string indicating the name of the thresholds matrix threshnames Not Yet Implemented An optional character vector to be assigned to the column names of the thresholds matrix Unused Requires further arguments to be named scores Not to be used Details The mxExpectationStateSpaceContinuousTime and mxExpectationSSCT functions are identi cal The latter is simply an abbreviated name When using the former tab completion is strongly en couraged to save tedious typing Both of these functions are wrappers for the mxExpectationStateS pace function which could be used for both discrete and continuous time modeling However there is a strong possibility of misunderstanding the model parameters when switching between discrete time and continuous time The expectation matrices have the same names but mean importantly different things so caution is warranted The best practice is to use mxExpectationStateSpace for discrete time models and mxExpectationStateSpaceContinuousTime for continuous time models Expectation functions define the way that model expectations are calculated That is to say expec tation functions define how a set of model matrices get turned into expectations for the dat
32. An alternative specification of the bounds follows Integrate from Infinity to 0 on first variable vibound c Inf 0 From 0 to Infinity on second v2bound c 0 Inf and from 1 to 2 5 on third v3bound c 1 2 5 bounds lt cbind vlbound v2bound v3bound lbound lt bounds 1 ubound bounds 2 omxMnor covariance means lbound ubound omxNameAnonymousParameters omxNameAnonymousParameters Description Assign new names to the unnamed parameters 236 omxNormalQuantiles Usage omxNameAnonymousParameters model indep FALSE Arguments model the MxModel indep whether models are independent Value a list with components for the new MxModel with named parameters and the new names omxNormalQuantiles omxNormalQuantiles Description Get quantiles from a normal distribution Usage omxNormalQuantiles nBreaks mean 0 sd 1 Arguments nBreaks the number of thresholds or a vector of the number of thresholds mean the mean of the underlying normal distribution sd the standard deviation of the underlying normal distribution Value a vector of quantiles Examples omxNormalQuantiles 3 omxNormalQuantiles 3 mean 7 omxNormalQuantiles 2 mean 1 sd 3 omxParallelCI 237 omxParallelCI omxParallelCI Description Create parallel models for parallel confidence intervals Usage omxParallelCI model run TRUE Arguments model an MxModel with confidence intervals
33. ItemSpec a single item model to replicate or a list of item models in the same order as the column of ItemParam item the name of the mxMatrix holding item parameters with one column for each item model with parameters starting at row 1 and extra rows filled with NA Not used Forces remaining arguments to be specified by name qpoints number of points to use for equal interval quadrature integration default 49L qwidth the width of the quadrature as a positive Z score default 6 0 mean the name of the mxMatrix holding the mean vector cov the name of the mxMatrix holding the covariance matrix verbose the level of runtime diagnostics default OL weightColumn the name of the column in the data containing the row weights default NA EstepItem a simple matrix of item parameters for the E step This option is mainly of use for debugging derivatives debugInternal when enabled some of the internal tables are returned in debug This is mainly of use to developers 104 mxExpectationGREML Details The standard Normal distribution of the quadrature acts like a prior distribution for difficulty It is not necessary to impose any additional Bayesian prior on difficulty estimates Baker amp Kim 2004 p 196 References Bock R D amp Aitkin M 1981 Marginal maximum likelihood estimation of item parameters Application of an EM algorithm Psychometrika 46 443 459 Cai L 2010 A two tier full information item factor analys
34. NA acov NA fullWeight NA thresholds NA sort TRUE Arguments observed A matrix or data frame which provides data to the MxData object type A character string defining the type of data in the observed argument Must be one of raw or cor means An optional vector of means for use when type is cov or cor numObs The number of observations in the data supplied in the observed argument Required unless type equals raw acov Asymptotic covariance matrix of observed means and thresholds Used for weighted least squares at weight matrix fullWeight Full asymptotic covariance matrix of observed means and thresholds Used for weighted least squares in standard error and quasi chi squared calculation thresholds Observed thresholds Used for weighted least squares with ordinal data Not used Forces remaining arguments to be specified by name sort Whether to sort raw data prior to use default TRUE Details The mxData function creates MxData objects which can be used as arguments in MxModel objects The observed argument may take either a data frame or a matrix which is then described with the type argument Data types describe compatibility and usage with expectation functions in MxModel objects Four different data types are supported a fifth sscp is not yet implemented raw The contents of the observed argument are treated as raw data Missing values a
35. New instances of this class can be created using the function mxBounds Details The MxBounds class has the following slots min Thelower bound max The upper bound parameters The vector of parameter names The min and max slots hold scalar numeric values for the lower and upper bounds on the list of parameters respectively Parameters may be any free parameter or parameters from an MxMatrix object Parameters may be referenced either by name or by referring to their position in the spec matrix of an MxMatrix ob ject To affect an estimation or optimization an MxBounds object must be included in an MxModel object with all referenced MxAlgebra and MxMatrix objects Slots may be referenced with the symbol See the documentation for Classes and the examples in the mxBounds document for more information References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation See Also mxBounds for the function that creates MxBounds objects MxMatrix and mxMatrix for free pa rameter specification More information about the OpenMx package may be found here MxCharOrList class A character list or NULL Description A character list or NULL MxCharOrNumber class 73 MxCharOrNumber class A character or integer Description A character or integer mxCheckIdentification Check that a model is locally identified Description Use the dimension of the nul
36. Nt des 208 MAND ates EN 209 mzmbat os 508 ts ua oe SE eh eS RoE oe Se BE By owe S hua u 210 Named entity ae ec oas Ghee a Bae awe SS Baw che es 212 nuclear_twin_design_data 212 MUMHESS 1 gt pug om eR m ee Se SU Be A Se Sow anat 213 nuinHess2 amp 44v d aed ba ee RA EY A we de EEA E s 214 omxAllInt e545 RR Ro baw eee dane SUR RON ROSEO baw ee as 214 OMXAPPLY eo eom a ek b SS NG ee RR E A ee eR dE 216 omxAssignFirstParameters 217 omxBrownle uos h eee ESE SEHR SUR ee 218 omxCheckCloseEnough su s S Q OR sua 0 000 ee 219 omxCheckE qual 4244624 tote S Othe Ue Eee toe CAREERS YS 220 omxCheckBrtor 5 cg s a s s DR bu EE ee ee eae 221 omxChecklId n cal ux k ER ee k SE ER a 2212 omxCheckNamespace os u 22s rh yes 223 omxCheckSetEquals 223 omxCheckTr 2 voe eS s Se ee eR a Ren E Re E NUR s 224 omxCheckWamine s peni 60426 e446 h aou ete GPSS we oe gb bas 225 omxCheckWithinPercentError 226 omxConstrainMLThresholds 223 omxDetectCOTeS 206 xoc hy UR RORIS He BE a a Re DR RR s 227 omxGetNPSOL j e e hiik koe ee ee SEER m ROS EUR S Kos 228 omxGetParameters x eom
37. OpenMx is much more restrictive than base R s make names Usage mxMakeNames names unique FALSE Arguments names a character vector unique whether the pass the result through make unique See Also make names Examples demo lt c 103 data foo bar 3 2 1 1 mxMakeNames demo unique TRUE 160 mx Matrix mxMatrix Create MxMatrix Object Description This function creates a new MxMatrix object Usage mxMatrix type Full nrow NA ncol NA free FALSE values NA labels NA lbound NA ubound NA byrow getOption mxByrow dimnames NA name NA condenseSlots getOption mxCondenseMatrixSlots Arguments type A character string indicating the matrix type where type indicates the range of values and equalities in the matrix Must be one of Diag Full Iden Lower Sdiag Stand Symm Unit or Zero nrow Integer the desired number of rows One or both of nrow and ncol is re quired when values free labels bound and ubound arguments are not matrices depending on the desired MxMatrix type ncol Integer the desired number of columns One or both of nrow and ncol is required when values free labels Ibound and ubound arguments are not matrices depending on the desired MxMatrix type free A vector or matrix of logicals for free parameter
38. Similarly parameters may be fixed to an individual element in a MxModel object or the result of an MxAlgebra object through labeling For example assigning a label of name 1 1 fixes the value of a parameter at the value in first row and first column of the matrix or algebra name The mxConstraint function should be used to enforce inequalities that cannot be conveyed using other methods Value Returns an MxConstraint object References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation See Also MxConstraint for the S4 class created by mxConstraint Examples library OpenMx Create a constraint between MxMatrices A and B constraint mxConstraint A B name AdominatesB Constrain matrix K to be equal to matrix limit model lt mxModel model con test mxMatrix type Full nrow 2 ncol 2 free TRUE name K mxMatrix type Full nrow 2 ncol 2 free FALSE name limit values 1 4 mxConstraint K limit name Klimit_equality mxAlgebra min K mxFitFunctionAlgebra minK fit mxRun model fit matrices K values C1 E324 1 1 3 2 2 4 MxConstraint class 93 Constrain both free parameters of a matrix to equality using labels both are set to eq equal lt mxMatrix Full 2 1 free TRUE values 1 labels eq name D Constrain a matrix element in to be equal to the result of an algebra start
39. YourTimeVariable should be a name in your data set that gives the times at which measurement happened The units of time are up to you Your choice of time units will influence of the values of the parameters you estimate Also recall that the model is given zo and Po These always happen at t 0 So the first row of data happens some amount of time after zero The MxMatrix objects included as arguments may be of any type but should have the properties described above The mxExpectationStateSpace will not return an error for incorrect specification but incorrect specification will likely lead to estimation problems or errors in the mxRun function mxExpectationStateSpaceContinuousTime evaluates with respect to an MxData object The Mx Data object need not be referenced in the mxExpectationStateSpace function but must be included in the MxModel object mxExpectationStateSpace requires that the argument in the asso ciated MxData object be equal to raw Neighboring rows of the MxData object are treated as adjacent equidistant time points increasing from the first to the last row To evaluate place an mxExpectationStateSpaceContinuousTime object the mxData object for which the expected covariance approximates referenced MxAlgebra and MxMatrix objects and optional MxBounds and MxConstraint objects in an MxModel object This model may then be evaluated using the mxRun function The results of the optimization can be found in the
40. and from vectors are of different lengths when the connect argument is set to single the shorter vector is repeated to make the vectors of equal length The free argument specifies whether the paths created by the mxPath function are free or fixed parameters This argument may take either TRUE for free parameters FALSE for fixed parameters or a vector of TRUEs FALSEs to be applied in order to the created paths The arrows argument specifies the type of paths created A value of 1 indicates a one headed arrow representing regression This path represents a regression of the to variable on the from variable such that the arrow points to the to variable in a path diagram A value of 2 indicates a mxPath 179 two headed arrow representing a covariance or variance If multiple paths are created in the same mxPath function then the arrows argument may take a vector of 1s and 2s to be applied to the set of created paths The values is a numeric vectors containing the starting values of the created paths values gives a starting value for estimation The labels argument specifies the names of the resulting MxPath object The Ibound and ubound arguments specify lower and upper bounds for the created paths Value Returns a list of paths Note The previous implementation of all had unsafe features Its use is now deprecated and has been replaced by the
41. and mxExpectationStateSpace Fit functions include mxFitFunctionML mxFitFunctionAlgebra mxFitFunctionRow and mxFit FunctionR OpenMx comes with several useful datasets built in Access them using data package OpenMx To cite package OpenMx in publications use Steven M Boker Michael C Neale Hermine H Maes Michael J Wilde Michael Spiegel Tim othy R Brick Jeffrey Spies Ryne Estabrook Sarah Kenny Timothy C Bates Paras Mehta and John Fox 2011 OpenMx An Open Source Extended Structural Equation Modeling Framework Psychometrika Steven M Boker Michael C Neale Hermine H Maes Michael J Wilde Michael Spiegel Tim othy R Brick Ryne Estabrook Timothy C Bates Paras Mehta Timo von Oertzen Ross J Gore Michael D Hunter Daniel C Hackett Julian Karch and Andreas M Brandmaier 2014 OpenMx 2 User Guide 246 ordinalTwinData References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation Examples library OpenMx data demoOneFactor latents c G the latent factor manifests names demoOneFactor manifest variables to be modeled 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 free FALSE values 1 0 n n mxData cov demoOneFactor type cov numObs 500 m1 mxRun m1
42. and not whether it is a fixed or free parameter So for instance if the function is used on a model not yet run any free parameters in A or S initialized at zero will not appear in the function s output The user is warned to interpret the output of mxStandardizeRAMpaths cautiously if any elements of A or S depend upon definition variables Value If argument model is a single group model that uses RAM expecation then mxStandardizeRAMpaths returns a dataframe with one row for each nonzero path coefficient in A and S and with the follow ing columns name Character strings that uniquely identify each nonzero path coefficient in terms of the model name the matrix A or S the row number and the column number mxStandardizeRAMpaths 195 label Character labels for those path coefficients that are labeled elements of an mxMatrix object and NA for those that are not Note that path coefficients having the same label and therefore the same UNstandardized value can have different stan dardized values and therefore the same label may appear more than once in this dataframe matrix Character strings of A or S depending on which matrix contains the given path coefficient row Character The rownames of the matrix containing each path coefficient row numbers are used instead if the matrix has no rownames col Character The colnames of the matrix containing each path coefficient column numbers are used instead if the
43. columns of x are converted into ordered factors If x is a data frame then levels and labels may be either a list or a vector When levels is a list then different levels are assigned to different columns of the constructed data frame object When levels is a vector then the same levels are assigned to all the columns of the data frame object The function will throw an error if ordered is not TRUE or if levels is missing See factor for more information on creating ordered factors References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation mxFactorScores 129 Examples nan nin nen nin nen neon myMar lt eC sy t aM qu HQ em iH eS ff mxFactor myVar levels letters Note letters is a built in list of all lowercase letters of the alphabet ff amp 1 statistics Levels a lt b lt c lt d lt e lt f lt g lt h lt i lt j lt k lt l lt m lt n lt o lt p lt q lt d r lt s lt t lt u lt v lt w lt x lt y lt z as integer ff the internal codes factor ff NOTE drops the levels that do not occur mxFactor prevents you doing this unintentionally This example works on a dataframe foo lt data frame x c 1 3 y c 4 6 z c 7 9 Applys one set of levels to all three columns mxFactor foo c 1 9 Apply unique sets of levels to each variable mxFactor foo list c 1 3 c 4 6 7 9 mxFactor foo c
44. data covariance lt matrix c 1 0 0 5 0 5 1 0 nrow 2 dimnames list c a b c a MXxCI class 77 data lt mxData covariance cov numObs 100 create an expected covariance matrix expect mxMatrix Symm 2 2 free TRUE values c 1 5 1 labels c var1 cov12 var2 name expectedCov request 95 percent confidence intervals ci lt mxCI c var1 cov12 var2 specify the model model lt mxModel model Confidence Interval Example data expect ci mxMLObjective expectedCov dimnames c a b run the model results mxRun model intervals TRUE view confidence intervals print summary results CI view all results summary results MxCI class MXxCI Class Description MxCI is an 54 class An MxCI object is a named entity New instances of this class can be created using the function mxCI MxCI objects may be used as arguments in the mxModel function Details The MxCI class has the following slots reference The name of the object lowerdelta Either a matrix or a data frame upperdelta A vector for means or NA if missing The reference slot contains a character vector of named free parameters MxMatrices and MxAlge bras on which confidence intervals are desired Individual elements of MxMatrices and MxAlgebras 78 mxCompare may be listed as well using the syntax matrix row col see Extract for more information The lowerde
45. extended LISREL model several submodels can be defined Subtypes of the LISREL model are defined by setting some of the arguments of the LISREL objective to NA Note that be cause the default values of each LISREL matrix is NA setting a matrix to NA can be accomplished by simply not giving it any other value The first submodel is the LISREL model without means n Bn TE y Ayn e z Ax The LISREL model without means requires 9 matrices LX LY BE GA PH PS TD TE and TH Hence this LISREL model has TX TY KA and AL as NA This can be accomplished be leaving these matrices at their default values The TX TY KA and AL matrices must be specified if either the mxData type is cov or cor and a means vector is provided or if the mxData type is raw Otherwise the TX TY KA and AL matrices are ignored and the model without means is estimated A second submodel involves only endogenous variables n Dr y Ayn The endogenous only LISREL model requires 4 matrices LY BE PS and TE The LX GA PH TD and TH must be NA in this case However means can also be specified allowing TY and AL if the data are raw or if observed means are provided Another submodel involves only exogenous variables As 158 mxLISRELObjective The exogenous model model requires 3 matrices LX PH and TD The LY BE GA PS TE and TH matrices must be NA However means can also be specified
46. factorModelNull omxSetParameters factorModel labels One Factor A 1 6 values 0 free FALSE factorFitNull mxRun factorModelNull mxCompare factorFit factorFitNull 2 p lt p value Confidence intervals for all standardized paths 196 mx Threshold factorModel2 lt mxModel model factorModel mxMatrix type Iden nrow nrow factorModel A name I mxAlgebra vec2diag diag2vec 1 5 1 501 5 name InvSD mxAlgebra InvSD A solve InvSD name Az dimnames dimnames factorModel A mxAlgebra InvSD S InvSD name Sz dimnames dimnames factorModel S mxCI c Az Sz factorFit2 mxRun factorModel2 intervals TRUE Contains point values and confidence limits for all paths summary factorFit2 CI mxThreshold Create List of Thresholds Description This function creates a list of thresholds Usage mxThreshold vars nThreshzNA free FALSE values NA labels NA lbound NA ubound NA Arguments vars character vector These are the variables for which thresholds are to be specified nThresh numeric vector These are the number of thresholds for each variables listed in vars free boolean vector Indicates whether threshold parameters are free or fixed values numeric vector The starting values of the parameters labels character vector The names of the parameters lbound numeric vector The lower bounds of free parameters ubou
47. fixed 1 mxPath from latents arrows 2 free c FALSE TRUE TRUE values 1 0 Manifest have residual variance mxPath from manifests arrows 2 the data to be analysed mxData cov HS ability data manifests type cov numObs 301 fitModel mxRun HSModel run the model summary fitModel examine the output Fit statistics and path loadings MxModel class MxModel Class Description MxModel is an S4 class An MxModel object is a named entity New instances of this class can be created using the function mxModel Details The MxModel class has the following slots 172 MxModel class name The name of the object matrices A list of MxMatrix objects algebras A list of MxAlgebra objects submodels A list of MxModel objects constraints A list of MxConstraint objects intervals list of confidence intervals requested in MxCI objects bounds A list of MxBounds objects latentVars list of latent variables manifestVars list of manifest variables data MxData object objective Either NULL or a MxObjective object independent TRUE if and only if the model is independent options A list of optimizer options output list with optimization results The name slot is the name of the MxModel object The matrices slot contains a list of the MxMatrix objects included in the model These objects are listed by name Two objects may not share the same name If a new MxMatrix is added
48. function fitFunction mxFitFunctionWLS Define the model tmpModel mxModel model exampleModel S A I expCov expFunction fitFunction wdata Fit the model and print a summary tmpModelOut mxRun tmpModel summary tmpModelOut MxDirectedGraph class 101 MxDirectedGraph class MxDirectedGraph Description This is an internal class and should not be used directly It is a class for directed graphs mxEval Evaluate Values in MxModel Description This function can be used to evaluate an arbitrary R expression that includes named entities from a MxModel object or labels from a MxMatrix object Usage II mxEval expression model compute FALSE show FALSE defvar row cache new env parent emptyenv cacheBack FALSE M mxEvalByName name model compute FALSE show FALSE defvar row cache new env parent emptyenv cacheBack FALSE Arguments expression An arbitrary R expression model The model in which to evaluate the expression compute If TRUE then compute the value of algebra expressions show If TRUE then print the translated expression defvar row The row number for definition variables when compute TRUE defaults to 1 When compute FALSE values for definition variables are always taken from the first 1 e first before any automated sorting is done row of the raw data cache An R environment of matrix values used to speedup computation cacheBack
49. in it run whether to run the model or just return the parallelized interval models Value an MxModel object Examples require OpenMx data demoOneFactor manifests lt names demoOneFactor latents c G factorModel mxModel One Factor type RAM manifestVars manifests latentVars latents mxPath from latents to manifests mxPath from manifests arrows 2 mxPath from latents arrows 2 free FALSE values 1 0 mxData observed cov demoOneFactor type cov numObs 500 it add confidence intervals for free params in A and S matrices mxCI c A S factorRun mxRun factorModel factorCI lt omxParallelCI factorRun Run CIs in parallel 238 omxRAMtoML omxQuotes omxQuotes Description Quote helper function often for error messages Usage omxQuotes name Arguments name a character vector Details This is a helper function for creating a nicely put together formatted string Value a character string Examples omxQuotes c Oh blah dee Oh blah omxQuotes c A S p 5 omxQuotes Hello World omxRAMtoML omxRAMtoML Description Convert a RAM model to an ML model Usage omxRAMtoML model Arguments model the MxModel Details This is a legacy function that was once used to convert RAM models to ML models in the old 1 0 release of OpenMx objective function style omxRMSEA 239 Value an ML model with an ML objective
50. incorrect specification but incorrect specification will likely lead to estimation problems or errors in the mxRun function Like the mxExpectationRAM the mxExpectationLISREL evaluates with respect to an MxData object The MxData object need not be referenced in the mxExpectationLISREL function but must be included in the MxModel object mxExpectationLISREL requires that the type argument in the associated MxData object be equal to cov cor To evaluate place mxExpectationLISREL objects the mxData object for which the expected co variance approximates referenced MxAlgebra and MxMatrix objects and optional MxBounds and MxConstraint objects in an MxModel object This model may then be evaluated using the mxRun function The results of the optimization can be found in the output slot of the resulting model and may be obtained using the mxEval function Value Returns a new MxExpectationLISREL object One and only one MxExpectationLISREL object can be included with models using one and only one fit function object e g MxFitFunctionML and with referenced MxAlgebra MxData and MxMatrix objects References J reskog K G amp S rbom D 1996 LISREL 8 User s Reference Guide Lincolnwood IL Scientific Software International J reskog G amp S rbom D 1982 Recent developments in structural equation modeling Jour nal of Marketing Research 19 404 416 The OpenMx User s guide
51. indicating the name of the thresholds matrix threshnames An optional character vector to be assigned to the column names of the thresh olds matrix Details Expectation functions define the way that model expectations are calculated The mxExpectation LISREL calculates the expected covariance and means of a given MxData object given a LISREL model This model is defined by LInear Structual RELations LISREL J reskog amp S rbom 1982 1996 Arguments LX through AU must refer to MxMatrix objects with the associated properties of their respective matrices in the LISREL modeling approach The full LISREL specification has 13 matrices and is sometimes called the extended LISREL model It is defined by the following equations mxExpectationLISREL 109 m T Ayn T Te 6 The table below is provided as a quick reference to the numerous matrices in LISREL models Note that NX is the number of manifest exogenous independent variables the number of Xs NY is the number of manifest endogenous dependent variables the number of Ys NK is the number of latent exogenous variables the number of Ksis or Xis NE is the number of latent endogenous variables the number of etas Matrix Word Abbreviation Dimensions Expression Description Ay Lambda x LX NX x NK Exogenous Factor Loading Matrix Ay Lambda y LY NY x NE Endogenous Factor Loading Matrix B Beta BE NE x NE Regressions of Laten
52. information generally concerning GREML analyses including a complete example More information about the OpenMx package may be found here Examples showClass MxFitFunctionGREML 138 mxFitFunctionML mxFitFunctionML Create MxFitFunctionML Object Description This function creates a new MxFitFunctionML object Usage mxFitFunctionML vector FALSE rowDiagnostics FALSE Arguments vector A logical value indicating whether the objective function result is the likelihood vector rowDiagnostics A logical value indicating whether the row wise results of the objective function should be returned as an attribute of the fit function Details Fit functions are functions for which free parameter values are optimized such that the value of a cost function is minimized The mxFitFunctionML function computes 2 log likelihood of the data given the current values of the free parameters and the expectation function e g mxExpecta tionNormal or mxExpectationRAM selected for the model The vector argument is either TRUE or FALSE and determines whether the objective function returns a column vector of the likelihoods or a single 2 log likelihood value The rowDiagnostics arguent is either TRUE or FALSE and determines whether the row likeli hoods are returned as an attribute of the fit function It is sometimes useful to inspect the likelihoods for outliers diagnostics or other anomalies When vector FAL
53. mean mean sigma sigma imxEvalByName 35 imxEvalByName imxEvalByName Description This is an internal function exported for those people who know what they are doing Usage imxEvalByName name model compute FALSE show FALSE Arguments name name model model compute compute show show Details This function should not be used in MxSummary All summary information should be extracted from runstate imxExtractMethod imxExtractMethod Description This is an internal function exported for those people who know what they are doing Usage imxExtractMethod model index Arguments model model index index 36 imxExtractSlot imxExtractNames imxExtractNames Description This is an internal function exported for those people who know what they are doing Usage imxExtractNames lst Arguments lst Ist imxExtractReferences imxExtractReferences Description This is an internal function exported for those people who know what they are doing Usage imxExtractReferences lst Arguments lst Ist imxExtractSlot imxExtractSlot Description Checks for and extracts a slot from the object This is an internal function exported for those people who know what they are doing Usage imxExtractSlot x name Arguments x The object name the name of the slot imxFlattenModel 37 imxF lattenModel Remove heirarchical structure from model Description
54. multigroup model the preferred way is to use mxFitFunctionMultigroup Fit functions are functions for which free parameter values are chosen such that the value of the ob jective function is minimized While the other fit functions in OpenMx require an expectation func tion for the model the mxAlgebraObjective function uses the referenced MxAlgebra or MxMatrix object as the function to be minimized If a model s fit function is an mxFitFunctionAlgebra objective function then the referenced alge bra in the objective function must return a 1 x 1 matrix when using OpenMx s default optimizer There is no restriction on the dimensions of an fit function that is not the primary or topmost objective function To evaluate an algebra fit function place the following objects in a 1 object amxFitFunctionAlgebra MxAlgebra and MxMatrix entities referenced by the MxAlgebraObjective and optional MxBounds and MxConstraint objects This model may then be evaluated using the mxRun function The re sults of the optimization may be obtained using the mxEval function on the name of the MxAlgebra after the model has been run First and second derivatives can be provided with the algebra fit function The dimnames on the gradient and hessian MxAlgebras are matched against names of free variables Names that do not match are ignored The fit is assumed to be in deviance units 2 log likelihood units If you are working in log likel
55. n n chr 1 5 raw cov cor sscp acov imxDefaultGetSlotDisplayNames imxDefaultGetSlotDisplayNames Description Returns a list of display friendly object slot names This is an internal function exported for those people who know what they are doing Usage imxDefaultGetSlotDisplayNames x pattern x Arguments x The object from which to get slot names pattern Initial pattern to match default of matches any imxDeparse 33 imxDeparse Deparse for MxObjects Description Deparse for MxObjects Usage imxDeparse object indent y Arguments object object indent indent imxDependentModels Are submodels dependence Description Are submodels dependence Usage imxDependentModels model Arguments model model imxDetermineDefaultOptimizer imxDetermineDefaultOptimizer Description This is an internal function exported for those people who know what they are doing Usage imxDetermineDefaultOptimizer Details Returns a character the default optimizer 34 imxDmvnorm imxDiff Set difference on regular types or S4 objects Description Set difference on regular types or S4 objects Usage imxDiff a b slots c setequal intersect Arguments a a b b slots slots imxDmvnorm A C implementation of dmvnorm Description This API is visible to permit testing Please do not use Usage imxDmvnorm loc mean sigma Arguments loc loc
56. namespace Usage imxSfClient Details As long as the previous statement is true then the current process is a snowfall client if and only if exists sfOption imxSimpleRAMPredicate imxSimpleRAMPredicate Description This is an internal function exported for those people who know what they are doing Usage imxSimpleRAMPredicate model Arguments model model imxSparseInvert Sparse symmetric matrix invert Description This API is visible to permit testing Please do not use Usage imxSparseInvert mat Arguments mat the matrix to invert 52 imx TypeName imxSquareMatrix imxSquareMatrix Description This is an internal function exported for those people who know what they are doing Usage imxSquareMatrix Object Arguments Object Object imxSymmetricMatrix imxSymmetricMatrix Description This is an internal function exported for those people who know what they are doing Usage imxSymmetricMatrix Object Arguments Object Object imxTypeName imxTypeName Description This is an internal function exported for those people who know what they are doing Usage imxTypeName model Arguments model model imx UntitledName 53 imxUntitledName imxUntitledName Description This is an internal function exported for those people who know what they are doing Usage imxUntitledName Details Returns a character the name of the next untitl
57. new mechanism connect which supports safe and controlled generation of desired combinations of paths References McArdle J J and MacDonald R P 1984 Some algebraic properties of the Reticular Action Model for moment structures British Journal of Mathematical and Statistical Psychology 37 234 251 The OpenMx User s guide can be found at http openmx psyc virginia edu documentation See Also mxMatrix for a matrix based approach to path specification mxModel for the container in which mxPaths are embedded More information about the OpenMx package may be found here Examples A simple Example 1 factor Confirmatory Factor Analysis library OpenMx data demoOneFactor manifests lt names demoOneFactor latents lt c G factorModel lt mxModel model One Factor type RAM manifestVars manifests latentVars latents mxPath from latents to manifests mxPath from manifests arrows 2 mxPath from latents arrows 2 free FALSE values 1 0 mxData cov demoOneFactor type cov numObs 500 factorFit mxRun factorModel summary factorFit A more complex example using features of R to compress what would otherwise be a long and error prone script 180 MxRAMGraph class list of 100 variable names 01 o2 03 myManifest lt sprintf 402d c 1 100 the latent variables for the model myLatent lt c Gl G2 G3 G4 G5 Start building the model Defin
58. no latent variables are included in the model i e the A and S matrices are of both of the same dimension as the data matrix then the F should refer to an identity matrix If latent variables are included 1 A and S matrices are not of the same dimension as the data matrix then the F argument should consist of a horizontal adhesion of an identity matrix and a matrix of zeros The M argument refers to the M or means matrix in the RAM approach It is 1 x n matrix where n is the number of manifest variables the number of latent variables The M matrix must be specified if either the mxData type is cov or and a means vector is provided or if the mxData type is raw Otherwise the M matrix is ignored The MxMatrix objects included as arguments may be of any type but should have the properties described above The mxExpectationRAM will not return an error for incorrect specification but incorrect specification will likely lead to estimation problems or errors in the mxRun function mxExpectationRAM evaluates with respect to an MxData object The MxData object need not be referenced in the mxExpectationRAM function but must be included in the MxModel object To evaluate place mxExpectationRAM objects the mxData object for which the expected covari ance approximates referenced MxAlgebra and MxMatrix objects and optional MxBounds and MxConstraint objects in an MxModel object This model may then
59. note for advanced users Special purpose optimizers like Newton Raphson or EM are not included in this list Value list of valid Optimizer names See Also mxOption model Default optimizer Examples mxAvailableOptimizers MxBaseExpectation class MxBaseExpectation Description The virtual base class for all expectations Expectations contain enough information to generate simulated data This is an internal class and should not be used directly See Also mxExpectationNormal mxExpectationRAM mxExpectationLISREL mxExpectationStateSpace mxExpectationBA8 1 70 MxBaseObjectiveMetaData class MxBaseFitFunction class MxBaseFitFunction Description The virtual base class for all fit functions This is an internal class and should not be used directly See Also mxFitFunctionAlgebra mxFitFunctionML mxFitFunctionMultigroup mxFitFunctionR mxFitFunc tionWLS mxFitFunctionRow mxFitFunctionGREML MxBaseNamed class MxBaseNamed Description This is an internal class and should not be used directly It is the base class for named entities Fit functions expectations and computes contain this class MxBaseObjectiveMetaData class MxBaseObjectiveMetaData Description This is an internal class and should not be used directly It is the virtual base class for all objective functions meta data mx Bounds 71 mxBounds Create MxBounds Object Description This function creates a
60. output slot of the resulting model and may be obtained using the mxEval function 126 mxExpectationS tateS paceContinuous Time Value Returns a new MxExpectationStateSpace object mxExpectationStateSpace objects should be in cluded with models with referenced MxAlgebra MxData and MxMatrix objects References K J str m and R M Murray 2010 Feedback Systems An Introduction for Scientists and Engineers Princeton University Press J Durbin and S J Koopman 2001 Time Series Analysis by State Space Methods Oxford Uni versity Press R E Kalman 1960 A New Approach to Linear Filtering and Prediction Problems Basic Engi neering 82 35 45 R E Kalman and R S Bucy 1961 New Results in Linear Filtering and Prediction Theory Trans actions of the ASME Series D Journal of Basic Engineering 83 95 108 G Petris 2010 An R Package for Dynamic Linear Models Journal of Statistical Software 36 1 16 The OpenMx User s guide can be found at http openmx psyc virginia edu documentation See Also mxExpectationStateSpace Examples Example 1 Undamped linear oscillator i e a noisy sine wave Measurement error but no dynamic error single indicator This example works great Data Generation require OpenMx set seed 405 tlen lt 200 t lt seq 1 2 50 length out tlen fregParam lt 5 initialCond lt matrix c 2 5 0 x lt initialCond 1 1 cos freqParam t plot t
61. people who know what they are doing Usage imxOriginalMx mx filename output directory Arguments mx filename mx filename output directory output directory imxPPML imxPPML Description Potentially enable the PPML optimization for the given model Usage imxPPML model flag TRUE Arguments model the MxModel to evaluate flag whether to potentially enable PPML 46 imxPPML Test Battery imxPPML Test Battery imxPPML Test Battery Description PPML can be applied to a number of special cases This function will test the given model for all of these special cases Usage imxPPML Test Battery model verbose FALSE testMissingness TRUE testPermutations TRUE testEstimates TRUE testFakeLatents TRUE tolerances c 0 001 0 001 0 001 Arguments model the model to test verbose whether to print diagnostics testMissingness try with missingness testPermutations try with permutations testEstimates examine estimates testFakeLatents try with fake latents tolerances a vector of tolerances Details Requirements for model passed to this function Path specified Means vector must be present Covariance data with data means vector Recommended All error variances should be specified on the diagonal of the S matrix and not as a latent with a loading only on to that manifest Function will test across all permutations of Covariance vs Raw data Means vector present vs Means
62. re peated operations on a single covariance matrix omxAllInt returns an nx1 matrix of probabilities cycling from lowest to highest thresholds in each column with the rightmost variable in covariance changing most rapidly Usage omxAllInt covariance means Arguments covariance the covariance matrix describing the multivariate normal distribution means a row vector containing means of the variables of the underlying distribution a matrix or set of matrices containing one column of thresholds for each column of covariance Each column must contain a strictly increasing set of thresholds for the corresponding variable of the underlying distribution NA values in these thresholds indicate that the list of thresholds in that column has ended omxAllInt 215 Details covariance and means contain the covariances and means of the multivariate distribution from which probabilities are to be calculated covariance must be a square covariance or correlation matrix with one row and column for each variable means must be a vector of length nrows covariance that contains the mean for each correspond ing variable All further arguments are considered threshold matrices Threshold matrices contain locations of the hyperplanes delineating the intervals to be calculated The first column of the first matrix corresponds to the thresholds for the first variable represented by the covariance matrix Subsequent columns of the same matrix corres
63. respectively Character vector Each string names a column of the raw dataset to be used as a phenotype A list of data column names specifying the covariates to be used with each phenotype The list should have the same length as argument yvars Logical should lead columns of ones for the regression intercepts be adhered to the covariates when assembling the X matrix Defaults to TRUE Logical relevant to polyphenotype analyses If TRUE default then the result ing y will contain phenotype 1 for individuals 1 thru n phenotype 2 for individuals 1 thru n If FALSE then observations are blocked by individual and the resulting y will contain individual 1 s scores on phenotypes thru p individual 2 s scores on phenotypes 1 thru p Note that in either case X will be structured appropriately for y Logical relevant to polyphenotype analyses If TRUE default then each phe notype s covariates in X are staggered and X is padded out with zeroes If FALSE then X is formed simply by stacking the phenotypes covariates this requires each phenotype to have the same number of covariates 1 e each character vector in Xvars must be of the same length The default TRUE is in tended for instances where the multiple phenotypes truly are different variables whereas staggerZeroes FALSE is intended for instances where the multiple 152 mxGREMLDataHandler phenotypes actually re
64. specification A single TRUE or FALSE will set all allowable variables to free or fixed respectively values A vector or matrix of numeric starting values By default all values are set to zero labels A vector or matrix of characters for variable label specification lbound A vector or matrix of numeric lower bounds Default bounds are specified with an NA ubound A vector or matrix of numeric upper bounds Default bounds are specified with an NA byrow Logical defaults to value of global option mxByRow If FALSE default the values free labels Ibound and ubound matrices are populated by column rather than by row dimnames List The dimnames attribute for the matrix a list of length 2 giving the row and column names respectively An empty list is treated as NULL and a list of length one as row names The list can be named and the list names will be used as names for the dimensions name An optional character string indicating the name of the MxMatrix object mx Matrix 161 condenseSlots Logical defaults to value of global option mxByRow If TRUE then the result ing MxMatrix will condense its labels free Ibound and ubound down to 1 1 matrices if they contain only FALSE free or NA the other three If FALSE those four matrices and the values matrix will all be of equal dimen sions Details The mxMatrix function creates MxMatrix ob
65. to an MxModel object with the same name as an MxMatrix object in that model the added version replaces the previous version There is no imposed limit on the number of MxMatrix objects that may be added here The algebras slot contains a list of the MxAlgebra objects included in the model These objects are listed by name Two objects may not share the same name If a new MxAlgebra is added to an MxModel object with the same name as an MxAlgebra object in that model the added version replaces the previous version All MxMatrix objects referenced in the included MxAlgebra objects must be included in the matrices slot prior to estimation There is no imposed limit on the number of MxAlgebra objects that may be added here The submodels slot contains references to all of the MxModel objects included as submodels of this MxModel object Models held as arguments in other models are considered to be submodels These objects are listed by name Two objects may not share the same name If a new submodel is added to an MxModel object with the same name as an existing submodel the added version replaces the previous version When a model containing other models is executed using mxRun all included submodels are executed as well If the submodels are dependent on one another they are treated as one larger model for purposes of estimation The constraints slot contains a list of the MxConstraint objects included in the model These ob
66. virginia edu documentation Examples data myGrowthKnownClassData plot the observed trajectories blue lines are class 1 green lines are class 2 colSel c blue green myGrowthKnownClassData c matplot t myGrowthKnownClassData 6 type 1 lty 1 col colSel 204 myGrowthMixtureData myGrowthMixtureData Data for a growth mixture model Description Data set used in some of OpenMx s examples Usage data myGrowthMixtureData Format A data frame with 500 observations on the following variables x1 x variable and time 1 x2 x variable and time 2 x3 x variable and time 3 x4 x variable and time 4 x5 x variable and time 5 Details The same as myGrowthKnownClassData but without the class membership variable Source Simulated References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation Examples data myGrowthMixtureData matplot t myGrowthMixtureData type l lty 1 data myGrowthKnownClassData all myGrowthKnownClassData 6 myGrowthMixtureData myLongitudinalData 205 myLongitudinalData Data for a linear latent growth curve model Description Data set used in some of OpenMx s examples Usage data myLongitudinalData Format A data frame with 500 observations on the following variables x1 x variable and time 1 x2 x variable and time 2 x3 x variable and time 3 x4 x variable and time 4 x5 x variable and time 5
67. x an input matrix See Also rvectorize vech vechs Examples cvectorize matrix 1 9 3 3 cvectorize matrix 1 12 3 4 demoOneFactor Demonstration data for a one factor model Description Data set used in some of OpenMx s examples Usage data demoOneFactor 12 demoTwoFactor Format A data frame with 500 observations on the following 5 numeric variables 1 2 x3 4 5 Details Variables x1 x5 are typically used as indicators of the latent trait Source Simulated References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation Examples data demoOneFactor cov demoOneF actor cor demoOneF actor demoTwoF actor Demonstration data for a two factor model Description Data set used in some of OpenMx s examples Usage data demoTwoFactor Format A data frame with 500 observations on the following 10 numeric variables x1 x2 x3 x4 diag2vec 13 x5 yl y2 y3 y4 y5 Details Variables x1 x5 are typically used as indicators of one latent trait Variables y1 y5 are typically used as indicators of another latent trait Source Simulated References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation Examples data demoTwoFactor cov demoTwoFactor cor demoTwoFactor diag2vec Extract Diagonal of a Matrix Description Given an input matrix diag2vec returns a co
68. y tmpNames lt names tmpFrame Create a model that includes an expected covariance matrix an expectation function a fit function and an observed covariance matrix 186 mxRObjective data lt mxData cov tmpFrame type cov numObs 1000 expCov lt mxMatrix type Symm nrow 2 ncol 2 values c 2 1 2 free TRUE name expCov expFunction lt mxExpectationNormal covariance expCov dimnames tmpNames fitFunction mxFitFunctionML testModel lt mxModel model testModel expCov data expFunction fitFunction Use mxRun to optimize the free parameters in the expected covariance matrix modelOut mxRun testModel checkpoint TRUE modelOut expCov Use mxRestore to load the last checkpoint saved state of the model modelRestore mxRestore testModel modelRestore expCov mxRObjective DEPRECATED Create MxRObjective Object Description WARNING Objective functions have been deprecated as of OpenMx 2 0 Please use mxFitFunctionR instead As a temporary workaround mxRObjective returns a list containing a NULL MxExpectation object and an MxFitFunctionR object All occurrences of mxRObjective fitfun Should be changed to mxFitFunctionR fitfun Arguments objfun A function that accepts two arguments The initial state information to the objective function Details NOTE THIS DESCRIPTION IS DEPRECATED Please change to using mxExpectationNormal and mxFitFunctionML as shown in th
69. 1 9 labels c 1 1 1 2 2 2 3 3 3 collapse TRUE mxFactorScores Estimate factor scores and standard errors Description This function creates the factor scores and their standard errors under different methods for an MxModel object that has an MxExpectationLISREL object Usage mxFactorScores model type c ML WeightedML Regression Arguments model An MxModel object with an MxExpectationLISREL type The type of factor scores to compute 130 mxFactorScores Details This is a helper function to compute or estimate factor scores along with their standard errors The two maximum likelihood methods create a new model for each data row They then estimate the factor scores as free parameters a model with a single data row For ML the conditional likelihood of the data given the factor scores is optimized L D F For WeightedML the joint likelihood of the data and the factor scores is optimized L D F L D F L F The WeightedML scores are akin to the empirical Bayes random effects estimates from mixed effects modeling They display the same kind of shrinkage as random effects estimates and for the same reason they account for the latent variable distribution in their estimation In many cases especially for ordinal data or missing data the weighted ML scores are to be preferred over alternatives Estabrook amp Neale 2013 For Regression factor scores are computed based on a simple for
70. 64 66 71 72 76 95 97 113 132 160 162 164 169 170 179 194 195 197 245 MxMatrix class 162 mxMI 164 mxMLOb jective 166 169 MxModel 62 68 71 72 75 76 78 91 92 94 99 101 110 113 116 120 125 132 134 156 161 163 167 170 173 174 182 185 190 191 198 200 212 MxModel MxModel class 171 INDEX mxModel 74 77 80 95 97 102 162 168 171 173 176 178 179 184 194 196 197 242 245 MxModel class 171 MxNonNullData class MxData class 96 mxOption 69 170 173 174 185 191 194 MxOptionalChar class 176 MxOptionalCharOrNumber class 176 MxOptionalLogical class 177 MxOptionalMatrix class 177 MxOptionalNumeric class 177 MxPath 95 97 173 178 179 mxPath 769 170 173 177 194 196 197 245 MxPath class mxPath 177 MxRAMGraph MxRAMGraph class 180 MxRAMGraph class 180 MxRAMMetaData class 181 MxRAMModel class 181 mxRAMObjective 58 769 181 mxRefModels 4 249 mxRefModels omxSaturatedModel 241 mxRename 184 mxRestore 185 mxRObjective 186 mxRowObjective 187 mxRun 62 68 75 78 102 110 113 116 120 125 132 134 158 161 163 167 169 170 172 173 182 189 194 196 199 245 mxSave 191 mxSetDefaultOptions 192 mxSimplify2Array 193 mxStandardizeRAMpaths 193 794 mxSummary 76 241 mxSummary summary MxModel 248 MxThreshold 96 197 mxThreshold 196 MxThreshold class mxThreshold 196
71. 97 218 HS ability data 26 HS fake data HS ability data 26 IdenMatrix class MxMatrix class 162 ieigenval eigenvec 19 ieigenvec eigenvec 19 imxAddDependency 28 imxCheckMatrices 28 imxCheckVariables 29 imxConDecMatrixSlots 29 imxConDecMatrixSlots MxMatrix method imxConDecMatrixSlots 29 imxConstraintRelations 29 imxConvertIdentifier 30 imxConvertLabel 30 imxConvertSubstitution 31 INDEX imxCreateMatrix 31 164 imxCreateMatrix DiagMatrix method imxCreateMatrix 31 imxCreateMatrix FullMatrix method imxCreateMatrix 31 imxCreateMatrix IdenMatrix method imxCreateMatrix 31 imxCreateMatrix LowerMatrix method imxCreateMatrix 31 imxCreateMatrix MxMatrix method imxCreateMatrix 31 imxCreateMatrix SdiagMatrix method imxCreateMatrix 31 imxCreateMatrix StandMatrix method imxCreateMatrix 31 imxCreateMatrix SymmMatrix method imxCreateMatrix 31 imxCreateMatrix UnitMatrix method imxCreateMatrix 31 imxCreateMatrix ZeroMatrix method imxCreateMatrix 31 imxDataTypes 32 imxDefaultGetSlotDisplayNames 32 imxDeparse 33 164 imxDeparse IdenMatrix method imxDeparse 33 imxDeparse matrix method imxDeparse 33 imxDeparse MxAlgebra method imxDeparse 33 imxDeparse MxConstraint method imxDeparse 33 imxDeparse MxData method imxDeparse 33 imxDeparse MxMatrix method imxDeparse 33 imxDeparse UnitMatrix method imxDeparse 33 imxDeparse ZeroMatrix method imxDeparse 33 imxDep
72. AMMetaData class 181 MxRAMMetaData class Meta Data for RAM Description This is an internal class the meta data for RAM MxRAMModel class MxRAM Model Description This is an internal class and should not be used directly mxRAMObjective DEPRECATED Create MxRAMObjective Object Description WARNING Objective functions have been deprecated as of OpenMx 2 0 Please use mxExpectationRAM and mxFitFunctionML instead As a temporary workaround mxRAMObjective returns a list containing an MxExpectationNormal object and an MxFitFunc tionML object All occurrences of mxRAMObjective A S F M NA dimnames NA thresholds NA vector FALSE thresh names dimnames Should be changed to mxExpectationRAM A S F M NA dimnames NA thresholds NA threshnames dim names mxFitFunctionML vector FALSE Arguments A A character string indicating the name of the A matrix S A character string indicating the name of the S matrix F A character string indicating the name of the F matrix M An optional character string indicating the name of the M matrix dimnames An optional character vector to be assigned to the column names of the F and M matrices thresholds An optional character string indicating the name of the thresholds matrix vector A logical value indicating whether the objective function result is the likelihood vector threshnames An optional character vec
73. Back to TRUE will return the pair list value cache where value is the result of the mxEval computation and cache is the updated cache References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation See Also mxAlgebra to create algebraic expressions inside your model and mxModel for the model object mxEval looks inside when evaluating Examples library OpenMx Set up a 1x1 matrix matrixA mxMatrix Full nrow 1 ncol 1 values 1 name A Set up an algebra algebraB mxAlgebra A A name B Put them both in a model testModel lt mxModel model testModel matrixA algebraB Even though the model has not been run we can evaluate the algebra given the starting values in matrixA mxEval B testModel compute TRUE If we just print the algebra we can see it has not been evaluated testModel B MxExpectation class 103 MxExpectation class MxExpectation Description This is an internal class and should not be used directly mxExpectationBA81 Create a Bock amp Aitkin 1981 expectation Description When a two tier covariance matrix is recognized this expectation automatically enables analytic dimension reduction Cai 2010 Usage mxExpectationBA81 ItemSpec item item qpoints 49L qwidth 6 mean mean cov cov verbose L weightColumn NA_integer_ EstepItem NULL debugInternal FALSE Arguments
74. Details Linear growth model with mean intercept around 10 and slope of about 1 5 Source Simulated References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation Examples data myLongitudinalData matplot t myLongitudinalData type l lty 1 206 myRegData myRegData Example regression data with correlated predictors Description Data set used in some of OpenMx s examples Usage data myRegData Format A data frame with 100 observations on the following variables w Predictor variable x Predictor variable y Predictor variable z Outcome varialbe Details W X and y are predictors of z x and y are correlated Source Simulated References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation Examples data myRegData summary lm z data myRegData myRegDataRaw 207 myRegDataRaw Example regression data with correlated predictors Description Data set used in some of OpenMx s examples Usage data myRegDataRaw Format A data frame with 100 observations on the following variables w Predictor variable x Predictor variable y Predictor variable z Outcome varialbe Details w x and y are predictors of z x and y are correlated Equal to myRegData Source Simulated References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation Examples
75. Drop Numeric vector Contains the indices of the rows of the y and X that were dropped due to containing NA s Can be provided as as argument casesToDropF romV to mxExpectationGREML References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation See Also For more information generally concerning GREML analyses including a complete example see mxExpectationGREML More information about the OpenMx package may be found here Examples dat lt cbind rnorm 100 rep 1 100 colnames dat c y x dat 42 1 lt NA dat 57 2 lt NA dat2 lt mxGREMLDataHandler data dat yvars y Xvars list x addOnes FALSE str dat2 MxiInterval class 153 MxInterval class MxInterval Description This is an internal class and should not be used directly See Also mxCI mxKalmanScores Estimate Kalman scores and error covariance matrices Description This function creates the Kalman predicted Kalman updated and Rauch Tung Striebel smoothed latent state and error covariance estimates for an MxModel object that has an MxExpectationStateS pace object Usage mxKalmanScores model data NA Arguments model An MxModel object with an MxExpectationStateS pace data An optional data frame or matrix Details This is a helper function that computes the results of the classical Kalman filter In particular for every row of data there is a predicted latent s
76. E Rauch F Tung C T Striebel 1965 Maximum Likelihood Estimates of Linear Dynamic Systems American Institute of Aeronautics and Astronautics Journal 3 1445 1450 The OpenMx User s guide can be found at http openmx psyc virginia edu documentation See Also mxExpectationStateSpace Examples Create and fit a model using mxMatrix mxExpectationStateSpace and mxFitFunctionML require OpenMx data demoOneFactor Use only first 50 rows for speed of example data lt demoOneFactor 1 5 nvar lt ncol demoOneFactor varnames lt colnames demoOneFactor ssModel lt mxModel model State Space Manual Example mxMatrix Full 1 1 TRUE 3 namez A mxMatrix Zero 1 1 name B mxMatrix Full nvar 1 TRUE 6 name C dimnames list varnames F1 mxMatrix Zero nvar 1 name D mxMatrix Diag 1 1 FALSE 1 name Q mxMatrix Diag nvar nvar TRUE 2 name R mxMatrix Zero 1 1 name x0 mxMatrix Diag 1 1 FALSE 1 name PQ mxMatrix Zero 1 1 name u mxData observed data type raw mxExpectationStateSpace A B C D 0 R xQ PO u mxFitFunctionML ssRun mxRun ssModel MxLISRELModel class 155 summary ssRun Note the freely estimated Autoregressive parameter A matrix 15 near zero as it should be for the independent rows of data from the factor model ssScores lt mxKalmanScores ssRun cor cbind s
77. FALSE values 1 0 mxPath from one to manifests mxData observed demoOneFactor 1 50 type raw summary factorRun mxRun factorModel Estimate factor scores for the model rl lt mxFactorScores factorRun Regression mxFIMLObjective DEPRECATED Create MxFIMLObDjective Object Description WARNING Objective functions have been deprecated as of OpenMx 2 0 Please use mxExpectationNormal and mxFitFunctionML Q instead As a temporary workaround mxFIMLObjective returns a list containing an MxExpectationNormal object and an MxFitFunc tionML object All occurrences of mxFIMLObjective covariance means dimnames NA thresholds NA vector FALSE thresh names dimnames Should be changed to mxExpectationNormal covariance means dimnames NA thresholds NA threshnames dim names mxFitFunctionML vector FALSE Arguments covariance A character string indicating the name of the expected covariance algebra means A character string indicating the name of the expected means algebra dimnames An optional character vector to be assigned to the dimnames of the covariance and means algebras thresholds An optional character string indicating the name of the thresholds matrix vector A logical value indicating whether the objective function result is the likelihood vector threshnames An optional character vector to be assigned to the column names of the thresh olds matrix 132 mxFIMLObjective
78. GetSlotDisplayNames Description Returns a list of display friendly object slot names This is an internal function exported for those people who know what they are doing Usage imxGetSlotDisplayNames object pattern slotList slotNames object showDots FALSE showEmpty FALSE Arguments object The object from which to get slot names pattern Initial pattern to match default of matches any slotList List of slots for which toget display names default slotNames object i e all showDots Include slots whose names start with default FALSE showEmpty Include slots with length zero contents default FALSE 40 imxIdentifier imxHasNPSOL imxHasNPSOL Description imxHasNPSOL Usage imxHasNPSOL Value Returns TRUE if the NPSOL proprietary optimizer is compiled and linked with OpenMx Other wise FALSE imxHasOpenMP imxHasOpenMP Description This is an internal function exported for those people who know what they are doing Usage imxHasOpenMP imxIdentifier imxldentifier Description This is an internal function exported for those people who know what they are doing Usage imxIdentifier namespace name Arguments namespace namespace name name imxIndependentModels 41 imxIndependentModels Are submodels independent Description Are submodels independent Usage imxIndependentModels model Arguments model model imxIn
79. If TRUE then return the list pair value cache name The character name of an object to evaluate 102 mxEval Details The argument expression is an arbitrary R expression Any named entities that are used within the R expression are translated into their current value from the model Any labels from the matrices within the model are translated into their current value from the model Finally the expression is evaluated and the result is returned To enable debugging the show argument has been provided The most common mistake when using this function is to include named entities in the model that are identical to R function names For example if a model contains a named entity named c then the following mxEval call will return an error mxEval c A B C model The mxEvalByName function is a wrapper around mxEval that takes a character instead of an R expression If compute is FALSE then MxAlgebra expressions return their current values as they have been computed by the optimization call using mxRun If the compute argument is TRUE then Mx Algebra expressions will be calculated in R Any references to an objective function that has not yet been calculated will return a 1 x 1 matrix with a value of NA The cache is used to speedup calculation by storing previously computing values The cache is a list of matrices such that names cache must all be of the form modelname entityname Setting cache
80. In effect is the maximum number of attempts mxTryHard will make since the function will stop once an acceptable solution is reached Defaults to 10 in which case a maximum of 11 total attempts will be made Logical is a solution with Mx status GREEN npsolstatus 1 acceptable De faults to FALSE The location and scale parameters of the uniform rectangular distribution from which random values are drawn to disturb start values between attempts The location parameter is the distribution s median and the scale parameter is the half width of the rectangle that is the absolute difference between the median and the extrema Defaults to a uniform distribution on the interval 0 75 1 25 initialGradientStepSize initialGradientIterations initialTolerance checkHess fit2beat paste Optimization parameters passed to mxComputeGradientDescent Logical is a positive definite Hessian a requirement for an acceptable solution Defaults to TRUE An upper limit to the objective function value that an acceptable solution may have Useful if a nested submodel of model has already been fitted since model with its additional free parameters should not yield a fit function value any greater than that of the submodel Logical If TRUE default start values for the returned fitted model are printed to console as a comma separated string This is useful if the user wants to copy paste these values into an R script say in an omxSetPar
81. Model model firstModel mxMatrix type Symm nrow 3 ncol 3 name S mxMatrix type Iden nrow 3 name F name finaldraft Add data to the model from an existing data frame in object data data twinData load some data finalModel lt mxModel model finalModel mxData twinData type raw Two ways to view the matrix named A in MxModel object model MxModel class 171 finalModel A finalModel matrices A A working example using OpenMx Path Syntax data HS ability data load the data The manifest variables loading on each proposed latent variable Spatial lt c visual cubes paper Verbal lt c general paragrap sentence Math lt c numeric series arithmet latents lt c vis math text manifests lt c Spatial Math Verbal HSModel lt mxModel model Holzinger and Swineford 1939 type RAM manifestVars manifests list the measured variables boxes latentVars latents list the latent variables circles factor loadings from latents to manifests mxPath from vis to Spatial factor loadings mxPath from math to Math 3t factor loadings mxPath from text to Verbal factor loadings Allow latent variables to covary mxPath from vis to math arrows 2 free TRUE mxPath from vis toz text arrows 2 free TRUE mxPath from math to text arrows 2 free TRUE Allow latent variables to have variance first
82. OpenMx Reference Manual August 7 2015 Date 2015 07 17 Title Extended Structural Equation Modelling URL http openmx psyc virginia edu BugReports http openmx psyc virginia edu forums Description Facilitates treatment of statistical model specifications as things that can be generated and manipulated programmatically Structural equation models may be specified with reticular action model matrices or paths linear structural relations matrices or paths or directly in matrix algebra Fit functions include full information maximum likelihood maximum likelihood and weighted least squares Example models include confirmatory factor multiple group mixture distribution categorical threshold modern test theory differential equations state space and many others SystemRequirements GNU make License Apache License 2 0 file LICENSE LinkingTo RcppEigen StanHeaders gt 2 7 BH Depends R gt 3 0 2 digest MASS methods parallel Suggests Matrix mvtnorm numDeriv roxygen2 gt 3 1 Rmpi rpf gt 0 36 snowfall LazyLoad yes LazyData yes Collate 0ClassUnion R cache R MxBaseNamed R MxData R MxDataWLS R Definition Vars R MxReservedNames R MxNamespace R MxSearchReplace R MxFlatSearchReplace R MxUntitled R MxAlgebraFunctions R MxExponential R MxMatrix R DiagMatrix R FullMatrix R IdenMatrix R LowerMatrix R SdiagMatrix R StandMatrix R SymmM
83. SE and rowDiagnostics TRUE fitfunction can be referenced in the model and included in algebras as a scalar The row likelihoods are an attribute of the fit function but are not accessible in the model during optimization The row likelihoods are accessible to the user after the model has been run Usage Notes The results of the optimization can be reported using the summary function or accessed directly in the output slot of the resulting model i e modelName output Components of the output may be referenced using the Extract functionality Value Returns a new MxFitFunctionML object One and only one MxFitFunctionML object should be included in each model along with an associated mxExpectationNormal or mxExpectationRAM object mxFitFunctionML 139 References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation See Also mxFitFunctionMultigroup for multiple group models and mxFitFunctionAlgebra for user defined fit functions Examples Create and fit a model using mxMatrix mxAlgebra mxExpectationNormal and mxFitFunctionML library OpenMx Simulate some data x rnorm 1000 mean 0 sd 1 y 5 rnorm 1000 mean sd 1 tmpFrame lt data frame x y tmpNames lt names tmpFrame Define the matrices M lt mxMatrix type Full nrow 1 ncol 2 values c 0 0 free c TRUE TRUE labels c Mx My name S lt mxMatrix type Full nrow 2 n
84. Sls RU gt a e aiii ai SO So AU Soe bee SAL ew Oe w W a 101 MxExpectation class 0 103 mxExpectatonBA81 oe Y E De ee eU ae 103 104 106 mxExpectationLISREL lees 108 mxExpectationNormal 112 mxExpectationRAM SS BRR SERS Se REE E EE sss P d E P 115 117 122 DIXPFACIOE be Seer Ruwana dos ere ek ER k d 128 mxFactorSCcOTeS eA e pop ok me E SUE Be a AS 129 mxFIMLObjec Ve uos ew a ab om 131 MxFitFunction class k ee 133 mxFitFunctionAlgebra 134 mxFitFuncionGREML sels 135 MxFitFuncionGREML class ee 136 mxFitFuncionML llle s 138 mxFitFunctionMultigroup lees 140 mxFitEunctionR zum k a gu Pow ex BO UCM dus 142 mxFitFunctionRow re 144 mxFitPunctionWLES 4 24 Be ROGER RR SSE A EA P EO dE 146 MxFlatModel class o sp 5 sgn eons X S a oe Pee RUE RUE EURO E 5 147 mxGenerateD
85. TD matrix TE An optional character string indicating the name of TE matrix TH An optional character string indicating the name of the TH matrix TX An optional character string indicating name of the X matrix TY An optional character string indicating name of the TY matrix KA An optional character string indicating the name of the KA matrix AL An optional character string indicating the name of the AL matrix dimnames An optional character vector that is currently ignored thresholds An optional character string indicating the name of the thresholds matrix vector A logical value indicating whether the objective function result is the likelihood vector threshnames An optional character vector to be assigned to the column names of the thresh olds matrix Details Objective functions are functions for which free parameter values are chosen such that the value of the objective function is minimized The mxLISRELObjective provides maximum likelihood estimates of free parameters in a model of the covariance of a given MxData object This model is defined by LInear Structual RELations LISREL J reskog amp S rbom 1982 1996 Arguments through AL must refer to MxMatrix objects with the associated properties of their respective matrices in the LISREL modeling approach The full LISREL specification has 13 matrices and is sometimes called the extended LISREL model It is defined by the following equation
86. a When used in conjunction with the mxFitFunctionML the mxExpectationStateSpace uses maximum like lihood prediction error decomposition PED to obtain estimates of free parameters in a model of the raw MxData object Continuous time state space expectations treat the raw data as a multivari ate time series of possibly unevenly spaced times with each row corresponding to a single occasion Continuous time state space expectations implement a hybrid Kalman filter to produce expectations The hybrid Kalman filter uses a Kalman Bucy filter for the prediction step and the classical Kalman filter for the update step It is a hybrid between the classical Kalman filter used for the discrete but possibly unequally spaced measurement occastions and the continous time Kalman Bucy filter for latent variable predictions Missing data handling is implemented in the same fashion as full information maximum likelihood for partially missing rows of data Additionally completely missing rows of data are handled by only using the prediction step from the Kalman Bucy filter and omitting the update step This model uses notation for the model matrices commonly found in engineering and control theory The A B D Q R x0 PO arguments must be the names of MxMatrix or MxAlgebraobjects with the associated properties of the A B C D Q R x0 and PO matrices in the state space modeling approach The t matrix must
87. a 95 percent confidence interval is requested That quantile will be populated into either the lowerdelta slot the upperdelta slot or both in the output MxCI object 76 mxCI Estimation of likelihood based confidence intervals begins after optimization has been completed with each parameter moved in the direction s specified in the type argument until the specified increase in 2 log likelihood is reached All other free parameters are left free for this stage of optimization This process repeats until all confidence intervals have been calculated The calcu lation of likelihood based confidence intervals can be computationally intensive and may add a significant amount of time to model estimation when many confidence intervals are requested Multiple parameters MxMatrices and MxAlgebras may be listed in the reference argument In dividual elements of MxMatrices and MxAlgebras may be listed as well using the syntax ma trix row col see Extract for more information Only scalar numeric values for the interval argument are supported Users requesting different confidence ranges for different parameters must use separate mxCI statements MxModel objects can hold multiple MxCI objects but only one confidence interval may be requested per named entity Confidence interval estimation may result in model non convergence at the confidence limit Sep arate optimizer messages may be passed for each confidence li
88. ala eb more eR RR eS BE Ee RUSSE 148 mxGetExpected 55s wee gre ee Bae PHS Sw Bae che qe 150 mxGREMLDataHandler 151 Mxinterval class a S bee cR ROX RR er SA W p 153 mxKalmanScores 4 4 ADRES ew EEN XU E UE E XY E XE UNUS 153 MxLISRELModekclass 222r 155 mxLISRELObjective acce s h aos a Wo W w w WU w ee 155 MxLastOrNull class 4 Re Oa Se e ate VEU EUR WO Se Ns 159 mxMakeNames 2 2 a s s w s e e apa ee 159 WRM Er 160 MxMatrix class a p aa ua S dU ue SEEPS RES Ge PA Up SLE P kuu 162 MIMI o cc e Q hae ce baw E b on k upa ee es Q 164 mxMEOBDJec Ve gt w 4k Supe g OR QUAD ee SER See ee Sek ee 8 166 mxModel 2 24 eA we ae aba AB AE BS Se eS E oh we HE SES 168 MxModel class 5 aa k ee 171 MAOPUON a Ke ee PO EO S ERM ESS ES EM eS W 174 MxOptionalChar class lees 176 MxOptionadCharOrNumber dass 22er 176 1 177 MxOptionalMatrix class 177 MxOptionalNumeric class 177 MXPA aoe Se ee Re es Be QW qu a 177 MxRAMGraph class rh 180 MxRAMMetaData class 181 MxRAMModel class
89. allowing TX and KA if the data are raw or if observed means are provided The model that is run depends on the matrices that are not NA If all 9 matrices are not NA then the full model is run If only the 4 endogenous matrices are not NA then the endogenous only model is run If only the 3 exogenous matrices are not NA then the exogenous only model is run If some endogenous and exogenous matrices are not NA but not all of them then appropriate errors are thrown Means are included in the model whenever their matrices are provided The MxMatrix objects included as arguments may be of any type but should have the properties described above The mxLISRELObjective will not return an error for incorrect specification but incorrect specification will likely lead to estimation problems or errors in the mxRun function Like the mxRAMObjective the mxLISRELObjective evaluates with respect to an MxData object The MxData object need not be referenced in the mxLISRELObjective function but must be in cluded in the MxModel object mxLISRELObjective requires that argument in the asso ciated MxData object be equal to cov cor or raw To evaluate place MxLISRELObjective objects the mxData object for which the expected co variance approximates referenced MxAlgebra and MxMatrix objects and optional MxBounds and MxConstraint objects in an MxModel object This model may then be evaluated using the mxRun function The results of t
90. alues return squared values 1 1 4 squared values 1 2 3 squared values 2 1 2 squared values 2 2 1 Define the expectation function fitFunction lt mxFitFunctionR objFunction Define the model tmpModel lt mxModel model exampleModel A fitFunction Fit the model and print a summary tmpModelOut mxRun tmpModel summary tmpModelOut mxRowObjective DEPRECATED Create MxRowObjective Object 188 mxRowObjective Description WARNING Objective functions have been deprecated as of OpenMx 2 0 Please use mxFitFunctionRow instead As a temporary workaround mxRowObjective returns a list containing a NULL MxExpectation object and an MxFitFunctionRow object All occurrences of mxRowObjective rowAlgebra reduceAlgebra dimnames rowResults rowResults filteredDataRow filteredDataRow existenceVector existence Vector Should be changed to mxFitFunctionRow rowAlgebra reduceAlgebra dimnames rowResults rowResults filtered DataRow filteredDataRow existenceVector existence Vector Arguments rowAlgebra A character string indicating the name of the algebra to be evaluated row wise reduceAlgebra A character string indicating the name of the algebra that collapses the row re sults into a single number which is then optimized dimnames A character vector of names corresponding to columns be extracted from the data set rowResults The name of the auto genera
91. ameters statement mxTryHard 199 If FALSE the vector of start values is printed as is Note that this vector from omxGetParameters has names corresponding to the free parameters these names are not displayed when paste TRUE iterationSummary Logical If TRUE displays parameter estimates and fit values for every fit at tempt Defaults to FALSE bestInitsOutput Logical If TRUE outputs starting values that resulted in best fit according to format specified by paste argument Defaults to TRUE showInits Logical If TRUE displays starting values for every fit attempt Defaults to FALSE verbose Passed to mxComputeGradientDescent to specify level of output to console Value during optimization Additional arguments to be passed to mxRun for example intervals TRUE Note that mxTryHard always internally invokes mxRun with argument suppressWarnings TRUE Usually mxTryHard returns a post mxRun MxModel object Specifically this will be the fitted model having the smallest fit function value found by mxTryHard during its attempts The start values used to obtain this fitted model are printed to console If every attempt at running model fails mxTryHard returns an object of class try error and the start values from the last attempt are printed to console mxTryHard throws a warning if the returned MxMode1 object has a nonzero npsolstatus See Also mxRun Examples library OpenMx data
92. amples data factorScaleExample2 round cor factorScaleExample2 2 data factorScaleExample2 plot sapply factorScaleExamplel var type l ylim c 6 lwd 3 lines 1 12 sapply factorScaleExample2 var col blue lwd 3 genericFitDependencies MxBaseFitFunction method Add dependencies Description If there is an expectation then the fitfunction should always depend on it Hence subclasses that implement this method must ignore the passed in dependencies and use dependencies lt call NextMethod instead Usage S4 method for signature MxBaseFitFunction genericFitDependencies Object flatModel dependencies Arguments Object fit function object flatModel flat model that lives with Object dependencies accumulated dependency relationships 26 HS ability data HS ability data Holzinger and Swineford 1939 Ability data in 301 children from two schools Description This classic data set contains of intelligence test scores from 301 children on 26 distinct tests The data are also available in the MBESS package The tests cover mental speed memory mathematical ability spatial and verbal ability as listed below Usage data HS ability data Format A data frame with 301 observations on the following 2 variables id student ID number int Gender Sex Factor w 2 levels Female Male grade Grade in school integer 7 or 8 agey Age in years integer agem Age in months
93. an mxRun function If an element is specified as a free parameter in the matrix the element in the value matrix is considered a starting value and can be changed by an objective function when included in an mxRun function labels Matrix of character strings which provides the labels of free and fixed parameters Fixed parameters with identical labels must have identical values Free parameters with identical labels impose an equality constraint The same label cannot be applied to a free parameter and a fixed parameter A free parameter with the label NA implies a unique free parameter that cannot be constrained to equal any other free parameter free Logical matrix specifying whether each element is free versus fixed An element is a free pa rameter if and only if the corresponding value in the free matrix is TRUE Free parameters are elements of an MxMatrix object whose values may be changed by a fitfunction when that MxMatrix object is included in an MxModel object and evaluated using the mxRun function lbound Numeric matrix of lower bounds on free parameters ubound Numeric matrix of upper bounds on free parameters squareBrackets Logical matrix used internally by OpenMx Identifies which elements have labels with square brackets in them persist Logical used internally by OpenMx Governs how mxRun handles the MxMatrix object when it is inside the MxModel being run condenseSlots Logical u
94. aphviz model dotFilename Arguments model An RAM type model dotFilename The name of the output file Use to write to console Value Invisibly returns a string containing the model description in graphviz format References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation omxLapply On Demand Parallel Lapply Description If the snowfall library is loaded then this function calls sfLapply Otherwise it invokes lapply Usage omxLapply x fun Arguments x a vector atomic or list or an expressions vector Other objects including classed objects will be coerced by as list fun the function to be applied to each element of x optional arguments to fun 232 omxLocateParameters See Also omxApply omxSapply Examples x lt list a 1 10 beta exp 3 3 logic c TRUE FALSE FALSE TRUE compute the list mean for each list element omxLapply x mean omxLocateParameters Summarize Model Parameters Description Return a data frame object summarizing the free parameters in the model Usage omxLocateParameters model labels NULL indep FALSE Arguments model a MxModel object labels optionally specify which free parameters to retrieve indep fetch parameters from independent submodels Details Invoking the function with the default value for the labels argument retrieves all the free parame ters The labels argument can be use
95. arOrNumber class A character integer or NULL Description A character integer or NULL MxOptionalLogical class 177 MxOptionalLogical class An optional logical Description This is an internal class the union of NULL and logical MxOptionalMatrix class An optional matrix Description An optional matrix MxOptionalNumeric class An optional numeric Description An optional numeric mxPath Create List of Paths Description This function creates a list of paths Usage mxPath from to NA connect c single all pairs unique pairs all bivariate unique bivariate arrows 1 free TRUE values NA labels NA lbound NA ubound NA 178 mxPath Arguments from character vector These are the sources of the new paths to character vector These are the sinks of the new paths connect String Specifies the type of source to sink connection single all pairs all bivariate unique pairs unique bivariate Default value is single arrows numeric value Must be either 1 for single headed or 2 for double headed arrows free boolean vector Indicates whether paths are free or fixed values numeric vector The starting values of the parameters labels character vector The names of the paths lbound numeric vector The lower bounds of free parameters ubound numeric vector The upper bounds of free parameters Not used Allows OpenMx to catch th
96. aram mxEval A 2 2 oscr dampingParam 128 mxFactor mxFactor Fail safe Factors Description This is a wrapper for the R function factor OpenMx requires ordinal data to be ordered R s factor function doesn t enforce this hence this wrapper exists to throw an error should you accidentally try and run with ordered FALSE Also the levels parameter is optional in R s factor function However relying on the data to specify the data is foolhardy for the following reasons The factor function will skip levels missing from the data Specifying these in levels leaves the list of levels complete Data will often not explore the min and max level that the user knows are possible For these reasons this function forces you to write out all possible levels explicitly Usage mxFactor x character levels labels levels exclude NA ordered TRUE collapse FALSE Arguments x either a vector of data or a data frame object levels a mandatory vector of the values that x might have taken labels _either_ an optional vector of labels for the levels _or_ a character string of length 1 exclude a vector of values to be excluded from the set of levels ordered logical flag to determine if the levels should be regarded as ordered in the order given Required to be TRUE collapse logical flag to determine if duplicate labels should collapsed into a single level Details If x is a data frame then all of the
97. areMatrix 52 imxSquareMatrix LowerMatrix method imxSquareMatrix 52 imxSquareMatrix MxMatrix method imxSquareMatrix 52 imxSquareMatrix SdiagMatrix method imxSquareMatrix 52 imxSquareMatrix StandMatrix method imxSquareMatrix 52 imxSquareMatrix SymmMatrix method imxSquareMatrix 52 imxSymmetricMatrix 52 164 imxSymmetricMatrix LowerMatrix method imxSymmetricMatrix 52 imxSymmetricMatrix MxMatrix method imxSymmetricMatrix 52 imxSymmetricMatrix SdiagMatrix method imxSymmetricMatrix 52 imxSymmetricMatrix StandMatrix method imxSymmetricMatrix 52 imxSymmetricMatrix SymmMatrix method imxSymmetricMatrix 52 imxTypeName 52 imxTypeName MxLISRELModel method imxTypeName 52 imxTypeName MxModel method imxTypeName 52 imxTypeName MxRAMModel method imxTypeName 52 imxUntitledName 53 imxUntitledNumber 53 53 imxUntitledNumberReset 53 imxUpdateModelValues 54 imxVariableTypes 54 imxVerifyMatrix 55 164 imxVerifyMatrix DiagMatrix method imxVerifyMatrix 55 imxVerifyMatrix FullMatrix method imxVerifyMatrix 55 imxVerifyMatrix IdenMatrix method INDEX imxVerifyMatrix 55 imxVerifyMatrix LowerMatrix method imxVerifyMatrix 55 imxVerifyMatrix MxMatrix method imxVerifyMatrix 55 imxVerifyMatrix SdiagMatrix method imxVerifyMatrix 55 imxVerifyMatrix StandMatrix method imxVerifyMatrix 55 imxVerifyMatrix SymmMatrix method imxVerifyMatrix 55 imxVerifyMatrix UnitMatrix method i
98. ariance matrix to correlation matrix chol Cholesky Decomposition cbind Horizontal adhesion rbind Vertical adhesion det Determinant tr Trace sum Sum prod Product max Maximum min Min abs Absolute value sin Sine sinh Hyperbolic sine cos Cosine cosh Hyperbolic cosine tan Tangent tanh Hyperbolic tangent exp Exponent log Natural Logarithm sqrt Square root p2z Standard normal quantile lgamma Log gamma function eigenval Eigenvalues of a square matrix Usage eigenval x eigenvec x ieigenval x ieigen vec x rvectorize Vectorize by row 64 mxAlgebra cvectorize Vectorize by column vech Half vectorization vechs Strict half vectorization vech2full Inverse half vectorization vechs2full Inverse strict half vectorization vec2diag Create matrix from a diagonal vector similar to diag diag2vec Extract diagonal from matrix similar to diag expm Matrix Exponential logm Matrix Logarithm omxExponential Matrix Exponential omxMnor Multivariate Normal Integration omxAllInt All cells Multivariate Normal Integration omxNot Perform unary negation on a matrix omxAnd Perform binary and on two matrices omxOr Perform binary or on two matrices omxGreaterThan Perform binary greater on two matrices omxLessThan Perform binary less than on two matrices omxApproxEquals Perform binary equals to within a specified epsilon on two matrices Value Returns a new MxAlgebra object References The OpenMx User s guide ca
99. arting values of this matrix must also be set to reasonable values Fill each column with a set of ordered start thresholds one for each level of this column s factor levels minus 1 These thresholds may be free if you wish them to be estimated or fixed The unused rows in each column if any can be set to any value including NA threshnames A character vector consisting of the variables in the thresholds matrix i e the names of ordinal variables in a model This is necessary for OpenMx to map the thresholds matrix columns onto the variables in your data If you set the dimnames of the columns in the thresholds matrix then threshnames is not needed Usage Notes dimnames must be supplied where the matrices referenced by the covariance and means algebras are not themselves labeled Failure to do so leads to an error noting that the covari ance or means matrix associated with the FIML objective does not contain dimnames mxFIMLObjective evaluates with respect to an MxData object The MxData object need not be referenced in the mxFIMLObjective function but must be included in the MxModel object mx FIML Objective requires that the type argument in the associated MxData object be equal to raw Missing values are permitted in the associated MxData object To evaluate place MxFIMLObjective objects the mxData object for which the expected covariance approximates referenced MxAlgebra and MxMatrix objects and optional MxBounds and MxCon
100. ase number of integration points mvnMaxPointsB i number of integration points per row mvnMaxPointsC i number of integration points per rows 2 mvnAbsEps i absolute tolerance mvnRelEps i relative tolerance 176 MxOptionalCharOrNumber class Value If a model is provided it is returned with the optimizer option either set or cleared If value is empty the current value is returned References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation See Also mxModel all uses of mxOption are via an mxModel whose options are set or cleared Examples set the Numbder of Threads cores to use mxOption NULL Number of Threads detectCores 1 testModel mxModel model testModel make a model to use for example testModel options show the model options none yet options mxOptions list all mxOptions global settings testModel mxOption testModel Function precision 1e 5 set precision testModel mxOption testModel Function precision NULL clear precision N B This is model specific precision defaults to global setting may optimize for speed it at cost of not getting standard errors testModel mxOption testModel Calculate Hessian No testModel lt mxOption testModel Standard Errors No testModel options see the list of options you set MxOptionalChar class An optional character Description An optional character MxOptionalCh
101. asure of accuracy with which f and c can be computed Infinite bound size r if r gt 0 defines the infinite bound bigbnd Major iterations i function the maximum number of major iterations before termination Verify level 1 3 1 Yes No see NPSOL manual B Line search tolerance r controls the accuracy with which a step is taken Derivative level 0 3 see NPSOL manual Hessian Yes No return the Hessian Yes or the transformed Hessian No Checkpointing options Always Checkpoint YesI No whether to checkpoint all models during optimization Checkpoint Directory path the directory into which checkpoint files are written Checkpoint Prefix string the string prefix to add to all checkpoint filenames Checkpoint Fullpath path overrides the directory and prefix useful to output to dev fd 2 Checkpoint Units see list the type of units for checkpointing minutes iterations or evaluations Checkpoint Count 1 the number of units between checkpoint intervals Model transformation options Error Checking No whether model consistency checks are performed in the OpenMx front end No Sort Data character vector of model names for which FIML data sorting is not performed RAM Inverse Optimization Yes No whether to enable solve I A optimization RAM Max Depth 1 the maximum depth to be used when solve I A optimization is enabled Multivariate normal integration parameters mvnMaxPointsA i b
102. atedLikelihood or IndependenceLikelihood arguments are used the appropriate de grees of freedom are attempted to be calculated by OpenMx However depending on the model it may sometimes behoove the user to also explicity provide the corresponding SaturatedDoF and or IndependenceDoF Again for the vast majority of cases the mxRefModels function handles these situations effectively and convenietly The summary function can report Error codes as follows 1 The final iterate satisfies the optimality conditions to the accuracy requested but the se quence of iterates has not yet converged NPSOL was terminated because no further improve ment could be made in the merit function Mx status GREEN 2 The linear constraints and bounds could not be satisfied The problem has no feasible solution 3 The nonlinear constraints and bounds could not be satisfied The problem may have no feasible solution 4 The major iteration limit was reached Mx status BLUE 6 The model does not satisfy the first order optimality conditions to the required accuracy and no improved point for the merit function could be found during the final linesearch Mx status RED 7 The function derivates returned by funcon or funobj appear to be incorrect 9 An input parameter was invalid For many raw data models OpenMx does not automatically report the absolute fit indices Chi Squared CFI TLI and RMSEA They are available once you fit refe
103. atentMultipleRegExample 1 latentMultipleRegExample1 Example data for multiple regression among latent variables Description Data set used in some of OpenMx s examples Usage data latentMultipleRegExamplel Format A data frame with 200 observations on the following variables X1 Factor 1 indicator X2 Factor 1 indicator X3 Factor 1 indicator X4 Factor 1 indicator X5 Factor 2 indicator X6 Factor 2 indicator X7 Factor 2 indicator X8 Factor 2 indicator X9 Factor 3 indicator X10 Factor 3 indicator X11 Factor 3 indicator X12 Factor 3 indicator Details Factor 1 strongly predicts factor 3 Factor 2 weakly predicts factor 3 Source Simulated References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation Examples data latentMultipleRegExamplel round cor latentMultipleRegExample1 2 60 latentMultipleRegExample2 latentMultipleRegExample2 Example data for multiple regression among latent variables Description Data set used in some of OpenMx s examples Usage data latentMultipleRegExample2 Format A data frame with 200 observations on the following variables X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 Factor 3 indicator X11 Factor 3 indicator X12 Factor 3 indicator Details Factor 1 indicator Factor 1 indicator Factor 1 indicator Factor 1 indicator Factor 2 indicator Factor 2 indicator Factor 2 indicator Factor 2 indicator Facto
104. atrix R UnitMatrix R ZeroMatrix R MxMatrixFunctions R MxAlgebra R MxCycleDetection R MxDependencies R MxAlgebraConvert R MxAlgebraTransform R MxSquareBracket R MxEval R MxRename R MxPath R MxObjectiveMetaData R MxRAMMetaData R MxExpectation R MxExpectationNormal R MxExpectationRAM R MxExpectationLISREL R MxFitFunction R MxFitFunctionAlgebra R MxFitFunctionML R MxFitFunctionMultigroup R MxFitFunctionRow R MxFitFunctionWLs R MxRAMObjective R MxLISRELObjective R MxFIMLObjective R MxMLObjective R MxRowObjective R MxAlgebraObjective R MxBounds R MxConstraint R MxInterval R MxTypes R MxCompute R MxModel R MxRAMModel R MxLISRELModel R MxModelDisplay R MxFlatModel R MxMultiModel R MxModelFunctions R MxModelParameters R MxUnitTesting R MxApply R MxRun R MxRunHelperFunctions R MxSummary R MxCompare R MxSwift R MxOptions R MxThreshold R OriginalMx R MxGraph R MxGraphviz R MxDeparse R MxCommunication R MxRestore R Mx Version R MxPPML R MxRAMtOoML R MxDiff R MxErrorHandling R MxDetectCores R MxSaturatedModel R omxBrownie R omxConstrainThresholds R omxGetNPSOL R MxFitFunctionR R MxRObjective R MxExpectationStateSpace R MxExpectationBA81 R MxFitFunctionGREML R MxExpectationGREML R MxMI R 4 R topics documented MxFactorSco
105. atrix must be a column vector with the same number of rows as the B and D matrices have columns If no inputs are desired u can be a zero matrix If time varying inputs are desired then they should be included as columns in the MxData object and referred to in the labels of the u matrix as definition variables There is an example of this below The MxMatrix objects included as arguments may be of any type but should have the properties described above The mxExpectationStateSpace will not return an error for incorrect specification but incorrect specification will likely lead to estimation problems or errors in the mxRun function mxExpectationStateSpace evaluates with respect to an MxData object The MxData object need not be referenced in the mxExpectationStateSpace function but must be included in the MxModel object mxExpectationStateSpace requires that the type argument in the associated MxData object be equal to raw Neighboring rows of the MxData object are treated as adjacent equidistant time points increasing from the first to the last row To evaluate place mxExpectationStateSpace objects the mxData object for which the expected covariance approximates referenced MxAlgebra and MxMatrix objects and optional MxBounds and MxConstraint objects in an MxModel object This model may then be evaluated using the mxRun function The results of the optimization can be found in the output slot of the resulting model and may be ob
106. be a 1x1 matrix using definition variables that gives the times at which measurements occurred The state space expectation is defined by the following model equations 0 Az t Bu q t y Ca Du re 124 mxExpectationS tateS paceContinuous Time with q t and both independently and identically distributed random Gaussian normal variables with mean zero and covariance matrices Q and R respectively Subscripts or square brackets indi cate discrete indices parentheses indicate continuous indices The derivative of x t with respect totis e t The first equation is called the state equation It describes how the latent states change over time with a first order linear differential equation The second equation is called the output equation It describes how the latent states relate to the Observed states at a single point in time The output equation shows how the observed output is produced by the latent states Also the output equation in state space modeling is directly analogous to the measurement model in LISREL structural equation modeling Note that the covariates u have instantaneous effects on both the state and output equations If lagged effects are desired then the user must create a lagged covariate by shifting their observed variable to the desired lag The state and output equations together with some minimal assumptions and the Kalman filter imply a new expected covariance matrix and means vector
107. be evaluated using the mxRun function The results of the optimization can be found in the output slot of the resulting model and may be obtained using the mxEval function Value Returns a new MxExpectationRAM object mxExpectationRAM objects should be included with models with referenced MxAlgebra MxData and MxMatrix objects References McArdle J J and MacDonald R P 1984 Some algebraic properties of the Reticular Action Model for moment structures British Journal of Mathematical and Statistical Psychology 37 234 251 The OpenMx User s guide can be found at http openmx psyc virginia edu documentation Examples Create and fit a model using mxMatrix mxAlgebra mxExpectationNormal and mxFitFunctionML library OpenMx Simulate some data x rnorm 1000 mean 0 sd 1 y 5 rnorm 1000 mean 0 sd 1 tmpFrame data frame x y tmpNames names tmpFrame Define the matrices mxExpectationStateSpace 117 matrixS lt mxMatrix type Full nrow 2 ncol 2 1 1 0 0 1 free c TRUE FALSE FALSE TRUE labels c Vx NA NA Vy name S matrixA mxMatrix type Full nrow 2 ncol 2 values c 0 1 0 0 free c FALSE TRUE FALSE FALSE labels c NA b NA NA name A matrixF mxMatrix type Iden nrow 2 ncol 2 name F matrixM lt mxMatrix type Full nrow 1 ncol 2 values c 0 0 freezc TRUE TRUE labels c Mx My name M
108. bs 500 factorRun mxRun factorModel factorSat mxRefModels factorRun run TRUE summary factorRun refModels factorSat Gives RMSEA with 95 confidence interval omxRMSEA factorRun 05 95 refModels factorSat Gives RMSEA with 90 confidence interval and probability of close enough fit omxSapply On Demand Parallel Sapply Description If the snowfall library is loaded then this function calls sfSapply Otherwise it invokes sapply Usage omxSapply x fun simplify TRUE USE NAMES TRUE Arguments x a vector atomic or list or an expressions vector Other objects including classed objects will be coerced by as list fun the function to be applied to each element of x optional arguments to fun simplify logical should the result be simplified to a vector or matrix if possible USE NAMES logical if TRUE and if x is a character use x as names for the result unless it had names already See Also omxApply omxLapply omxSaturatedModel 241 Examples x lt list a 1 10 beta exp 3 3 logic c TRUE FALSE FALSE TRUE compute the list mean for each list element omxSapply x quantile omxSaturatedModel Create Reference Saturated and Independence Models Description This function creates and optionally runs saturated and independence null models of a base model or data set for use with mxSummary to obtain more fit indices Usage mxRefModels x run FALSE Arguments K A MxM
109. c vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector 210 a7 a8 a9 a10 all 12 13 14 15 16 17 18 a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector Examples data mzfData str mzfData mzmData mzmData MZ Male example data Description Data for extended twin example ETC88 R Usage dat Format A data frame with 3019 observations on the following 37 variables famid a numeric vector el e2 e3 e4 5 e7 e8 a mzmData a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector mzmData e9 e10 ell e12 e13 e14 e15 e16 e17 e18 al a2 a3 a4 a5 a6 a7 a8 a9 a10 all 12 13 14 15 16 17 18 a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a n
110. calculated The mxExpectation RAM calculates the expected covariance and means of a given MxData object given a RAM model This model is defined by reticular action modeling McArdle and McDonald 1984 The A S and F arguments must refer to MxMatrix objects with the associated properties of the A S and F matrices in the RAM modeling approach The dimnames arguments takes an optional character vector If this argument is not a single NA then this vector be assigned to be the column names of the F matrix and optionally to the M matrix if the M matrix exists The A argument refers to the A or asymmetric matrix in the RAM approach This matrix consists of all of the asymmetric paths one headed arrows in the model A free parameter in any row and column describes a regression of the variable represented by that row regressed on the variable represented in that column The S argument refers to the S or symmetric matrix in the RAM approach and as such must be square This matrix consists of all of the symmetric paths two headed arrows in the model A free parameter in any row and column describes a covariance between the variable represented by that row and the variable represented by that column Variances are covariances between any variable at itself which occur on the diagonal of the specified matrix 116 mxExpectationRAM The F argument refers to the F or filter matrix in the RAM approach If
111. can be found at http openmx psyc virginia edu documentation mxExpectationLISREL 111 See Also demo LISRELJointFactorModel Examples Create and fit a model using mxExpectationLISREL and mxFitFunctionML library OpenMx vNames lt paste v as character 1 6 sepz dimList list vNames vNames covData matrix c 0 9223099 0 1862938 0 4374359 0 8959973 0 9928430 0 5320662 0 1862938 0 2889364 0 3927790 0 3321639 0 3371594 0 4476898 0 4374359 0 3927790 1 0069552 0 6918755 0 7482155 0 9013952 0 8959973 0 3321639 0 6918755 1 8059956 1 6142005 0 8040448 0 9928430 0 3371594 0 7482155 1 6142005 1 9223567 0 8777786 0 5320662 0 4476898 0 9013952 0 8040448 0 8777786 1 3997558 nrow 6 ncol 6 byrow TRUE dimnames dimList Create LISREL matrices mLX mxMatrix Full values c 5 6 8 rep 0 6 4 7 5 name LX nrow 6 ncol 2 free c TRUE TRUE TRUE rep FALSE 6 TRUE TRUE TRUE dimnames list vNames c x1 x2 mTD mxMatrix Diag values c rep 2 6 name TD nrow 6 ncol 6 free TRUE dimnames dimList mPH mxMatrix Symm values c 1 3 1 name PH nrow 2 ncol 2 free c FALSE TRUE FALSE dimnames list c x1 x2 c x1 x2 Create a LISREL expectation with LX TD and PH matrix names expFunction lt mxExpectationLISREL LX LX TD TD Create fit function and data tmpData lt mxData observed covData type c
112. ces The OpenMx User s guide can be found at http openmx psyc virginia edu documentation Examples Create and fit a model using mxMatrix mxAlgebra mxExpectationNormal and mxFitFunctionML library OpenMx Simulate some data x rnorm 1000 mean 0 sd 1 y 0 5 x rnorm 1000 mean 0 sd 1 168 mxModel tmpFrame lt data frame x y tmpNames lt names tmpFrame Define the matrices S lt mxMatrix type Full nrow 2 ncol 2 values c 1 0 0 1 free c TRUE FALSE FALSE TRUE labels c Vx NA NA Vy name S A mxMatrix type Full nrow 2 ncol 2 values c 0 1 0 0 free c FALSE TRUE FALSE FALSE labels c NA b NA NA name A I lt mxMatrix type Iden nrow 2 ncol 2 name I Define the expectation expCov lt mxAlgebra solve I A S t solve I A name expCov expFunction lt mxExpectationNormal covariance expCov dimnames tmpNames Choose a fit function fitFunction mxFitFunctionML Define the model tmpModel mxModel model exampleModel S A I expCov expFunction fitFunction mxData observed cov tmpFrame type cov numObs dim tmpFrame 1 Fit the model and print a summary tmpModelOut mxRun tmpModel summary tmpModelOut mxModel Create MxModel Object Description This function creates a new MxModel object Usage mxModel model NA manifestVars NA latentVars NA remove FALSE independent NA t
113. col 2 values c 1 0 0 1 free c TRUE FALSE FALSE TRUE labels c Vx NA NA Vy name S A mxMatrix type Full nrow 2 ncol 2 values c 0 1 0 0 free c FALSE TRUE FALSE FALSE labels c NA b NA NA name A I lt mxMatrix type Iden nrow 2 ncol 2 name I it Define the expectation expCov lt mxAlgebra solve I A S t solve I A name expCov expFunction lt mxExpectationNormal covariance expCov means M dimnames tmpNames Choose a fit function fitFunction mxFitFunctionML rowDiagnostics TRUE also return row likelihoods even though the fit function value is still 1x1 Define the model tmpModel mxModel model exampleModel M S A I expCov expFunction fitFunction mxData observed tmpFrame type raw Fit the model and print a summary tmpModelOut mxRun tmpModel summary tmpModelOut 140 mxFitFunctionMultigroup fitResOnly mxEval fitfunction tmpModelOut attributes fitResOnly NULL fitResOnly Look at the row likelihoods alone fitLikeOnly attr mxEval fitfunction tmpModelOut likelihoods head fitLikeOnly mxFitFunctionMultigroup Create MxFitFunctionMultigroup object Description The fit function used to fit a multiple group model Usage mxFitFunctionMultigroup groups verbose 0L Arguments groups vector of fit function names strings Not used Forces subsequent arguments to be specified by name v
114. core an error covariance matrix for the predicted latent scores that provides an estimate of the predictions precision an updated latent score and an updated error covariance matrix for the updated lated scores Additionally the Rauch Tung Striebel RTS smoothed latent scores and error covariance matrices are returned Value A list with components xPredicted PPredicted xUpdated PUpdated xSmoothed PSmoothed m2ll and L The rows of xPredicted xUpdated and xSmoothed correspond to different time points The columns are the different latent variables The third index of PPredicted PUpdated and PSmoothed corresponds to different times This works nicely with the R default print method for arrays At each time there is a covariance matrix of the latent variable scores For all items listed below the first element goes with the zeroth time point See example 154 mxKalmanScores xPredicted matrix of Kalman predicted scores PPredicted array of Kalman predicted error covariances xUpdated matrix of Kalman updated scores PUpdated array of Kalman updated error covariances xSmoothed matrix of RTS smoothed scores PSmoothed array of RTS smoothed error covariances m2ll minus 2 log likelihood L likelihood References J Durbin and S J Koopman 2001 Time Series Analysis by State Space Methods Oxford Uni versity Press R E Kalman 1960 A New Approach to Linear Filtering and Prediction Problems Basic Engi neering 82 35 45 H
115. cts comparison A MxModel object or list of MxModel objects Not used Forces remaining arguments to be specified by name all A boolean value on whether to compare all bases with all comparisons Defaults to FALSE mxCompare 79 Details The mxCompare function is used to compare the fit of one or more MxMatrix objects with output to one or more comparison models Fit statistics for the comparison model or models are subtracted from the fit statistics for the base model or models All models included in the base argument are also listed without comparison compared to a lt NA gt model to present their raw fit statistics Model comparisons are made by subtracting the fit of the comparison model from the fit of a base model To make sure that the differences between models are positive and yield p values for like lihood ratio tests the model or models listed in the base argument should be more saturated 1 more estimated parameters and fewer degrees of freedom than models listed in the comparison argument If a comparison is made where the comparison model has a higher minus 2 log likelihood 2LL than the base model then the difference in their 2LLs will be negative P values for likeli hood ratio tests will not be reported when either the 2LL or degrees of freedom for the comparison are negative When multiple models are included in both the base and comparison arguments then compar isons are made b
116. d pass through the data has been made Missing data handling is implemented in the same fashion as full information maximum likelihood for partially missing rows of data Additionally completely missing rows of data are handled by only using the prediction step from the Kalman filter and omitting the update step This model uses notation for the model matrices commonly found in engineering and control theory The A B D Q R x0 and PO arguments must be the names of MxMatrix or MxAlgebraobjects with the associated properties of the A B C D Q R x0 and PO matrices in the state space modeling approach The state space expectation is defined by the following model equations Az 1 But qt yr Ca Du re mxExpectationStateSpace 119 with q and r both independently and identically distributed random Gaussian normal variables with mean zero and covariance matrices Q and R respectively The first equation is called the state equation It describes how the latent states change over time Also the state equation in state space modeling is directly analogous to the structural model in LISREL structural equation modeling The second equation is called the output equation It describes how the latent states relate to the Observed states at a single point in time The output equation shows how the observed output is produced by the latent states Also the output equation in state s
117. d to select a subset of the free parameters Note that NA is a valid possible input to the labels argument See Also omxGetParameters omxSetParameters omxAssignFirstParameters Examples A lt mxMatrix Full 2 2 labels c A11 A12 NA NA values 1 4 free TRUE byrow TRUE name A model lt mxModel A name model Request all free parameters in model omxLocateParameters model omxLogical 233 Request free parameters A11 and all NAs omxLocateParameters model c A11 NA omxLogical Logical mxAlgebra operators Description omxNot computes the unary negation of the values of a matrix omxAnd computes the binary and of two matrices omxOr computes the binary or of two matrices omxGreaterThan computes a binary greater than of two matrices omxLessThan computes the binary less than of two matrices omxApproxEquals computes a binary equals within a specified epsilon of two matrices Usage omxNot x omxAnd x y omxOr x y omxGreaterThan x y omxLessThan x y omxApproxEquals x y epsilon Arguments x the first argument the matrix which the logical operation will be applied to y the second argument applicable to binary functions epsilon the third argument specifies the error threshold for omxApproxEquals Abs x i j must be less than epsilon i j Examples A lt mxMatrix values runif 25 nrow 5 ncol 5 name A B mxMatrix values run
118. del containing an MxMatrix named yourMatrix the contents of yourMatrix can be accessed as yourModel yourMatrix Slots i e matrices algebras etc in an mxMatrix may also be referenced with the symbol e g yourModel matrices or yourModel algebras See the documentation for Classes and the examples in Classes for more information Value Returns a new MxModel object MxModel objects must include an objective function to be used as arguments in mxRun functions References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation See Also See mxCI for information about adding Confidence Interval calculations to a model See mxPath for information about adding paths to RAM type models See mxMatrix for information about adding matrices to models See mxData for specifying the data a model is to be evaluated against See MxModel for the S4 class created by mxMatrix Many advanced options can be set via mxOption such as calculating the Hessian More information about the OpenMx package may be found here Examples library OpenMx At the simplest you can create an empty model placing it in an object and add to it later emptyModel lt mxModel model IAmEmpty Create a model named firstdraft with one matrix A firstModel mxModel model firstdraft mxMatrix type Full nrow 3 ncol 3 name A Update firstdraft and rename the model finaldraft finalModel mx
119. del model modelA modelB mxModel model modelB create a parent model with two submodels modelC mxModel model modelC modelA modelB Rename modelC to modell modell lt mxRename modelC modell Rename submodel modelB to model2 modell mxRename modell oldname modelB newname model2 modelli mxRestore 185 mxRestore Restore From Checkpoint File Description The function loads the last saved state from a checkpoint file Usage mxRestore model chkpt directory chkpt prefix Arguments model MxModel object to be loaded chkpt directory character Directory where the checkpoint file is located chkpt prefix character Prefix of the checkpoint file Details In general the arguments chkpt directory and chkpt prefix should be identical to the mxOption Checkpoint Directory and Checkpoint Prefix that were specificed on the model before execution Alternatively the checkpoint file can be manually loaded as data frame in R Use read table with the options header TRUE sep Nt stringsAsFactors FALSE check names FALSE Value Returns an MxModel object with free parameters updated to the last saved values References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation Examples library OpenMx Simulate some data x rnorm 1000 mean 0 sd 1 y 5 rnorm 1000 mean 0 sd 1 tmpFrame lt data frame x
120. demoOneFactor load the demoOneFactor dataframe manifests lt names demoOneFactor set the manifest to the 5 demo variables latents lt c G define 1 latent variable model lt mxModel model One Factor type RAM manifestVars manifests latentVars latents mxPath from latents to manifests labels paste b 1 5 sep mxPath from manifests arrows 2 labels paste u 1 5 sep mxPath from latents arrows 2 free FALSE values 1 0 mxData cov demoOneFactor type cov numObs 500 model lt mxTryHard model Run the model returning the result into model summary model Show summary of the fitted model 200 mx Version mxTypes List Currently Available Model Types Description This function returns a vector of the currently available type names Usage mxTypes Value Returns a character vector of type names Examples mxTypes mxVersion Returns Current Version String Description This function returns a string with the current version number of OpenMx Optionally with ver bose TRUE the default it prints a message containing the version of R the platform and the optimiser Usage mxVersion model NULL verbose TRUE Arguments model optional MxModel to request optimizer from default NULL verbose Whether to print version information to the console default TRUE References The OpenMx User s guide can be found at http openmx psyc vi
121. dot 253 twinData 251 MxMatrix method MxMatrix class 162 MxMatrix method MxMatrix class 162 LE MxFlatModel method MxFlatModel class 147 MxMatrix method MxMatrix class 162 MxModel method MxModel class 171 L lt MxFlatModel method MxFlatModel class 147 LE MXLISRELModel method MxLISRELModel class 155 LE MxMatrix method MxMatrix class 162 lt MxModel method MxModel class 171 lt MxRAMModel method MxRAMModel class 181 BaseCompute method BaseCompute class 9 MxAlgebra method MxAlgebra class 65 MxBaseExpectation method MxBaseExpectation class 69 MxBaseFitFunction method MxBaseFitFunction class 70 MxConstraint method MxConstraint class 93 MxData method MxData class 96 MxFlatModel method MxFlatModel class 147 MxInterval method MxInterval class 153 MxMatrix method MxMatrix class 162 MxModel method MxModel class 171 art L L MxPath method mxPath 177 MxThreshold method mxThreshold 196 260 lt BaseCompute method BaseCompute class 9 lt MxAlgebra method MxAlgebra class 65 lt MxBaseExpectation method MxBaseExpectation class 69 lt MxBaseFitFunction method MxBaseFitFunction class 70 lt MxConstraint method MxConstraint class 93 lt MxData method MxData class 96 lt MxFlatModel method MxFlatModel class 147 lt MxInterval met
122. e library OpenMx xdat data frame a rnorm 10 b 1 10 Make data set amod lt mxModel model example1 mxData observed xdat type raw mxAlgebra sum filteredDataRow name rowAlgebra mxAlgebra sum rowResults name reduceAlgebra mxFitFunctionRow rowAlgebra rowAlgebra reduceAlgebra reduceAlgebra dimnames c a b amodOut mxRun amod mxEval rowResults model amodOut mxEval reduceAlgebra model amodOut Model that find the parameter that minimizes the sum of the squared difference between the parameter and a data row bmod lt mxModel model example2 mxData observed xdat type raw mxMatrix values 75 ncol 1 nrow 1 free TRUE name B 146 mxFitFunctionWLS mxAlgebra filteredDataRow B 2 name rowAlgebra mxAlgebra sum rowResults name reduceAlgebra mxFitFunctionRow rowAlgebra rowAlgebra reduceAlgebra reduceAlgebra dimnames c a bmodOut mxRun bmod mxEval B model bmodOut mxEval reduceAlgebra model bmodOut mxEval rowResults model bmodOut mxFitFunctionWLS Create MxFitFunctionWLS Object Description This function creates a new MxFitFunctionWLS object Usage mxFitFunctionWLS weights ULS Arguments weights Ignored Uses weights from mxData Details Fit functions are functions for which free parameter values are optimized such that the value of a cost function is minimized The mxFitFunctionWLS function computes t
123. e A I lt mxMatrix type Iden nrow 2 ncol 2 name I Define the expectation expCov lt mxAlgebra solve I A S t solve I A name expCov expFunction lt mxExpectationNormal covariance expCov means M dimnames tmpNames Choose a fit function fitFunction mxFitFunctionML Define the model tmpModel lt mxModel model exampleModel M S A I expCov expFunction fitFunction mxData observed tmpFrame type raw Fit the model and print a summary tmpModelOut mxRun tmpModel summary tmpModelOut mxExpectationRAM 115 mxExpectationRAM Create an MxExpectationRAM Object Description This function creates an MxExpectationRAM object Usage mxExpectationRAM A A Sz S Fz F M NA dimnames NA thresholds NA threshnames dimnames Arguments A A character string indicating the name of the A matrix A character string indicating the name of the S matrix F A character string indicating the name of the F matrix M An optional character string indicating the name of M matrix dimnames An optional character vector to be assigned to the column names of the F and M matrices thresholds An optional character string indicating the name of the thresholds matrix threshnames An optional character vector to be assigned to the column names of the thresh olds matrix Details Expectation functions define the way that model expectations are
124. e A B C D Q xQ u u mxFitFunctionML ssRun mxRun ssModel summary ssRun Note the freely estimated Autoregressive parameter A matrix and the freely estimated Control Input parameter B matrix are both near zero as they should be for the independent rows of data from the factor model that does not have inputs covariates or exogenous variables mxExpectationStateSpaceContinuousT ime Create an MxExpectationStateSpace Object Description This function creates new MxExpectationStateS pace object Usage mxExpectationStateSpaceContinuousTime A B C D Q R t NA dimnames NA thresholds NA threshnames dimnames Scores FALSE mxExpectationSSCT A B C D Q R x0 P0 u t dimnames NA thresholds NA threshnames dimnames Scores FALSE Arguments A A character string indicating the name of the A matrix B A character string indicating the name of the B matrix C A character string indicating the name of the C matrix D A character string indicating the name of the D matrix Q A character string indicating the name of the Q matrix R A character string indicating the name of the R matrix A character string indicating the name of x0 matrix PQ A character string indicating the name of the PO matrix u A character string indicating the name of the u matrix t
125. e require OpenMx mxFitFunctionMultigroup c model1 model2 names of sub models to be jointly optimised Longer fully featured running example and mxFitFunctionMultigroup The model is multiple group regression Create and fit a model using mxMatrix mxExpectationRAM mxFitFunctionML Only the residual variances are allowed to differ across groups library OpenMx Simulate some data Group 1 N1 100 x rnorm N1 mean sd 1 y 0 5 x rnorm N1 mean 0 sd 1 451 lt data frame x y dsNames lt names ds1 Group 2 N2 150 x rnorm N2 mean 0 sd 1 y 0 5 x rnorm N2 mean sd sqrt 1 5 ds2 lt data frame x y Define the matrices M lt mxMatrix type Full nrow 1 ncol 2 values 0 free TRUE labels c Mx My name S1 lt mxMatrix type Diag nrow 2 ncol 2 values 1 free TRUE labels c Vx ResidVyl name 5 S2 lt mxMatrix type Diag nrow 2 ncol 2 values 1 free TRUE labels c Vx ResidVy2 name 5 A lt mxMatrix type Full nrow 2 ncol 2 values c 0 1 0 0 142 mxFitFunctionR free c FALSE TRUE FALSE FALSE labels c NA b NA NA name lt mxMatrix type Iden nrow 2 ncol 2 name I Define the expectation expect mxExpectationRAM A S I M dimnames dsNames Choose a fit function fitFunction mxFitFunctionML rowDiagnostics TRUE also retur
126. e a warning if NPSOL returns a non zero status code If the unsafe flag is TRUE then any error conditions will throw a warning instead of an error It is strongly recommended to use this feature only for debugging purposes Free parameters are estimated or updated based on the expectation and fit functions These esti mated values along with estimation information and model fit can be found in the output slot of MxModel objects after mxRun has been used If a model is dependent on or shares parameters with another model both models must be included as arguments in another MxModel object This top level MxModel object must include expectation and fit functions in both submodels as well as an additional fit function describing how the results of the first two should be combined Value Returns an MxModel object with free parameters updated to their final values The return value contains an output slot with the results of optimization mxSave 191 References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation Examples Create and run the 1 factor CFA on the openmx psyc virginia edu front page library OpenMx data demoOneFactor load the demoOneFactor dataframe manifests lt names demoOneFactor set the manifest to the 5 demo variables latents lt c G define 1 latent variable model lt mxModel model One Factor type RAM manifestVars manifests latentVars
127. e example below The fitfun argument must be a function that accepts two arguments The first argument is the mxModel that should be evaluated and the second argument is some persistent state information that can be stored between one iteration of optimization to the next iteration It is valid for the function to simply ignore the second argument The function must return either a single numeric value or a list of exactly two elements If the function returns a list the first argument must be a single numeric value and the second element will be the new persistent state information to be passed into this function at the next iteration The single numeric value will be used by the optimizer to perform optimization mxRowObjective 187 The initial default value for the persistant state information is NA Throwing an exception via stop from inside fitfun may result in unpredictable behavior You may want to wrap your code in tryCatch while experimenting Value Returns a list containing a NULL mxExpectation object and an MxFitFunctionR object References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation Examples Create and fit a model using mxFitFunctionR library OpenMx A lt mxMatrix nrow 2 ncol 2 values c 1 4 free TRUE name A squared lt function x x 2 Define the objective function in R objFunction lt function model state values lt model A v
128. e its type and add the manifest and latent variable name lists testModel mxModel model testModel type RAM manifestVars myManifest latentVars myLatent Create covariances between the latent variables and add to the model Here we use combn to create the covariances nb To create the variances and covariances in one operation you could use expand grid myLatent myLatent to specify from and to uniquePairs lt combn myLatent 2 covariances lt mxPath from uniquePairs 1 to uniquePairs 2 arrows 2 free TRUE values 1 testModel lt mxModel model testModel covariances Create variances for the latent variables variances lt mxPath from myLatent to myLatent arrows 2 free TRUE values 1 testModel lt mxModel model testModel variances add variances to the model Make a list of paths from each packet of 20 manifests to one of the 5 latent variables nb The first loading to each latent is fixed to 1 to scale its variance singles list for i in 1 5 j lt 1 20 singles lt append singles mxPath from myLatent i to myManifest j 19 jl arrows 1 free c FALSE rep TRUE 19 values c 1 rep 0 75 19 add single headed paths to the model testModel lt mxModel model testModel singles MxRAMGraph class MxRAMGraph Description This is an internal class and should not be used directly It is a class for RAM directed graphs MxR
129. e modification index for that fixed parameter When the fit function is in minus two log likelihood units e g mxFitFunctionML then the MI will be approximately chi squared distributed with 1 degree of freedom Using a p value of 0 01 has been suggested Hence a MI greater than qchisq p 1 0 01 df 1 or 6 63 is suggestive of a modification Users should be cautious in their use of modification indices If a model was created with the aid of MIs then it should always be reported Do not pretend that you have a theoretical reason for part of a model that was put there because it was suggested by a modification index This is fraud When using modification indices there are two options for best practices First you can report the analyses as exploratory Document all the explorations that you did and know that your results may or may not generalize Second you can use cross validation Reserve part of your data for exploration and use the remaining data to test if the exploratory model generalizes to new data Value A named list with components MI The restricted modification index MI Full The full modification index plusOneParamModels A list of models with one additional free parameter References S rbom D 1989 Model Modification Psychometrika 54 371 384 The OpenMx User s guide can be found at http openmx psyc virginia edu documentation Examples Create a model require OpenMx data demoOneFactor manifests
130. e use of the deprecated all argument Details The mxPath function creates MxPath objects These consist of a list of paths describing the relation ships between variables in a model using the RAM modeling approach McArdle and MacDonald 1984 Variables are referenced by name and these names must appear in the manifestVar and latent Var arguments of the mxModel function Paths are specified as going from one variable or set of variables to another variable or set of variables using the from and to arguments respectively If to is left empty it will be set to the value of from won mon mon connect has five possible connection types single all pairs all bivariate unique pairs unique bivariate The default value is single Assuming the values c a b c for the to and from fields the paths produced by each connection type are as follows all pairs a a a b a c b a b b b c c a c b c c unique pairs a a a b a c b b b c c c all bivariate a b a c b a b c c a c b unique bivariate a b a c b c single a a b b c c Multiple variables may be input as a vector of variable names If the connect argument is set to single then paths are created going from each entry in the from vector to the corresponding entry in the to vector If the to
131. e used to make a symmetric matrix See Also vechs2full vech vechs rvectorize cvectorize Examples vech2full 1 10 matrix 1 16 4 4 vech matrix 1 16 4 4 vech2full vech matrix 1 16 4 4 vechs Strict Half vectorization Description This function returns the strict half vectorization of an input matrix as a column vector Usage vechs x Arguments x an input matrix Details The half vectorization of an input matrix consists of the elements in the lower triangle of the matrix excluding the elements along the diagonal of the matrix as a column vector The column vector is created by traversing the matrix in column major order vechs2full 257 See Also vech rvectorize cvectorize Examples vechs matrix 1 9 3 3 vechs matrix 1 12 3 4 vechs2full Inverse Strict Half vectorization Description This function returns the symmetric matrix constructed from a strict half vectorization Usage vechs2full x Arguments x an input single column or single row matrix Details The strict half vectorization of an input matrix consists of the elements in the lower triangle of the matrix excluding the elements along the diagonal of the matrix as a column vector The column vector is created by traversing the matrix in column major order The inverse strict half vectorization takes a vector and reconstructs a symmetric matrix such that vechs2full vechs x is equal to x with zer
132. e1 round cor factorExample1 2 factanal covmat cov factorExample1 factors 3 rotation promax factorScaleExample1 Example Factor Analysis Data for Scaling the Model Description Data set used in some of OpenMx s examples Usage data factorScaleExamplel Format A data frame with 200 observations on the following variables X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 24 factorScaleExample2 Details This appears to be a three factor model with factor 1 loading on X1 X4 factor 2 on X5 X8 and factor 3 on X9 X12 Source Simulated References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation Examples data factorScaleExamplel 1 1 1 2 factorScaleExample2 Example Factor Analysis Data for Scaling the Model Description Data set used in some of OpenMx s examples Usage data factorScaleExample2 Format A data frame with 200 observations on the following variables X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 genericFitDependencies Mx BaseFitFunction method 25 Details This appears to be a three factor model with factor 1 loading on X1 X4 factor 2 on X5 X8 and factor 3 on X9 X12 It differs from factorScaleExamplel in the scaling of the varialbes Source Simulated References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation Ex
133. eans and thresholds then the Chi Square fit statistic is X e Wade with e indicating the transpode of e This Equation 2 20a from Browne 1984 where he showed that this statistic is chi square distributed with the conventional degrees of freedom imxWisStandardErrors 57 Value A named list with components Chi numeric value of the Chi Square fit statistic ChiDoF degrees of freedom for the Chi Square fit statistic References M W Browne 1984 Asymptotically Distribution Free Methods for the Analysis of Covariance Structures British Journal of Mathematical and Statistical Psychology 37 62 83 imxWlsStandardErrors Calculate Standard Errors for a WLS Model Description This is an internal function used to calculate standard errors for weighted least squares models Usage imxWlsStandardErrors model Arguments model An MxModel object with acov WLS data Details The standard errors for models fit with maximum likelihood are related to the second deriva tive Hessian of the likelihood function with respect to the free parameters For models fit with weighted least squares a different expression is required If J is the first derivative Jacobian of the mapping from the free parameters to the unique elements of the expected covariance means and threholds V is the weight matrix used W is the inverse of the full weight matrix and U VJ J V J 1 then the asymptotic covariance matrix of the free para
134. ebra or fit function is com puted omxMarkClean is called to to indicate that the algebra or fit function is updated Similarly when definition variables are populated in FIML all of the dependencies of the definition vari ables are marked as dirty Particularly for FIML the fact that non definition variable dependencies remain clean is a big performance gain imxCheckMatrices imxCheckMatrices Description This is an internal function exported for those people who know what they are doing Usage imxCheckMatrices model Arguments model model imxCheck Variables 29 imxCheckVariables imxCheckVariables Description This is an internal function exported for those people who know what they are doing Usage imxCheckVariables flatModel namespace Arguments flatModel flatModel namespace namespace imxConDecMatrixSlots Condense decondense slots of an MxMatrix Description This is an internal function exported for those people who know what they are doing Usage imxConDecMatrixSlots object Arguments object of class MxMatrix imxConstraintRelations imxConstraintRelations Description A string vector of valid constraint binary relations Usage imxConstraintRelations Format chr 1 3 men youn nn 30 imxConvertLabel imxConvertIdentifier imxConvertldentifier Description This is an internal function exported for those people who know what they are doing U
135. ecified in the model argument Model independence may be specified with the independent argument If a model is independent independent TRUE then the parameters of this model are not shared with any other model An independent model may be estimated with no dependency on any other model If a model is not independent independent FALSE then this model shares parameters with one or more other models such that these models must be jointly estimated These dependent models must be entered as arguments in another model so that they are simultaneously optimized The model type is determined by a character vector supplied to the type argument The type of a model is a dynamic property ie it is allowed to change during the lifetime of the model To see a list of available types use the mxTypes command When a new model is created and no type is specified the type specified by options mxDefaultType is used To be estimated MxModel objects must include objective functions as arguments mxAlgebraOb jective mxFIMLObjective mxMLObjective or mxRAMObjective and executed using the mxRun 170 mxModel function When MxData objects are included in models the type argument of these objects may require or exclude certain objective functions or set an objective function as default Named entities in MxModel objects may be viewed and referenced by name using the symbol For instance for an MxModel named yourMo
136. ecify a saturated and independence likelihoods in single argument for testing SaturatedLikelihood Numeric or MxModel object Specify a saturated likelihood for testing SaturatedDoF Numeric Specify the degrees of freedom of the saturated likelihood for testing IndependenceLikelihood Numeric or MxModel object Specify an independence likelihood for testing IndependenceDoF Numeric Specify the degrees of freedom of the independence likelihood for testing indep Logical Set to FALSE to ignore independent submodels in summary verbose logical Changes the printing style for summary see Details The verbose argument changes the printing style for the summary of a model When verbose FALSE a relatively minimal amount of information is printed the free parameters the likelihood and a few fit indices When more information is available more is printed For example when the model has a saturated likelihood several additional fit indices are printed On the other hand when verbose TRUE the compute plan the data summary and additional timing information are always printed Moreover available fit indices are printed regarless of whether or not they are defined The undefined fit indices are printed as NA Running a saturated model and including it with the call to summary will define these fit indices and they will dislay meaningful values It should be noted that the verbose argument only changes the printing style all of the same informa
137. ecks for and replaces a slot from the object This is an internal function exported for those people who know what they are doing Usage imxReplaceSlot x name value check TRUE Arguments x object name the name of the slot value replacement value check Check replacement value for validity default TRUE imxReservedNames imxReservedNames Description Vector of reserved names Usage imxReservedNames Format chr 1 6 data objective likelihood fitfunction 50 imxSeparatorChar imxReverseIdentifier imxReverseldentifier Description This is an internal function exported for those people who know what they are doing Usage imxReverseldentifier model name Arguments model model name name imxSameType imxSameType Description This is an internal function exported for those people who know what they are doing Usage imxSameType a b Arguments a a imxSeparatorChar imxSeparatorChar Description The character between the model name and the named entity inside the model Usage imxSeparatorChar Format chr imxSfClient 51 imxSfClient imxSfClient Description As of snowfall 1 84 the snowfall supervisor process stores an internal state information in a variable named sfOption that is located in the snowfall namespace The snowfall client processes store internal state information in a variable named sfOption that is located in the global
138. ect need not be referenced in the mxRAMObjective function but must be included in the MxModel object mxRAMObjective requires that the type argument in the associated MxData object be equal to cov or cor To evaluate place MxRAMObjective objects the mxData object for which the expected covariance approximates referenced MxAlgebra and MxMatrix objects and optional MxBounds and MxCon straint objects in an MxModel object This model may then be evaluated using the mxRun function The results of the optimization can be found in the output slot of the resulting model and may be obtained using the mxEval function Value Returns a list containing an MxExpectationRAM object and an MxFitFunctionML object mxRAMObjective 183 References McArdle J J and MacDonald R P 1984 Some algebraic properties of the Reticular Action Model for moment structures British Journal of Mathematical and Statistical Psychology 37 234 251 The OpenMx User s guide can be found at http openmx psyc virginia edu documentation Examples Create and fit a model using mxMatrix mxAlgebra mxExpectationNormal and mxFitFunctionML library OpenMx Simulate some data x rnorm 1000 mean 0 sd 1 y 0 5 x rnorm 1000 mean 0 sd 1 tmpFrame data frame x y tmpNames names tmpFrame Define the matrices matrixS lt mxMatrix type Full nrow 2 ncol 2 1 1 0 0 1 free c TRUE FALSE FALSE TRUE labels c
139. ectors higher whether to produce a higher rank array defaults to FALSE Examples v lt 1 3 v2 lt 4 5 v3 6 10 mxSimplify2Array list v1 v2 v3 11 Dz2J 3 1 1 4 2 2 5 03 3 NA 4 NA NA 5 NA NA 1 GOON mxStandardizeRAMpaths Standardize RAM models path coefficients Description Provides a dataframe containing the standardized values of all nonzero path coefficients appearing in the A and S matrices of models that use RAM expectation either of type RAM or containing an explicit mxExpectationRAM statement These standardized values are what the path coefficients would be if all variables in the analysis both manifest and latent were standardized to unit variance Can optionally include asymptotic standard errors for those standardized coefficients computed via the delta method 194 mxStandardizeRAMpaths Usage mxStandardizeRAMpaths model SE FALSE Arguments model An mxModel object that either uses RAM expectation or contains at least one submodel that does SE Logical Should standard errors be included with the standardized point esti mates Defaults to FALSE Certain conditions are required for use of SE TRUE see Details below Details Matrix A contains the Asymmetric paths i e the single headed arrows Matrix S contains the Symmetric paths i e the double headed arrows The function will work even if mxMatrix objects named A and S are absent from the m
140. ed entity imxUntitledNumber imxUntitledNumber Description This is an internal function exported for those people who know what they are doing Usage imxUntitledNumber Details Increments the untitled number counter and returns its value imxUntitledNumberReset imxUntitledNumberReset Description This is an internal function exported for those people who know what they are doing Usage imxUntitledNumberReset Details Resets the imxUntitledNumber counter 54 Imx VariableTypes imxUpdateModelValues imxUpdateModelValues Description Deprecated This function does not handle parameters with equality constraints Do not use Usage imxUpdateModelValues model flatModel values Arguments model model flatModel flat model values values to update imxVariableTypes imxVariableTypes Description This is an internal function exported for those people who know what they are doing Usage imxVariableTypes Format chr 0 Details The acceptable variable types imx VerifyMatrix 55 imxVerifyMatrix imxVerifyMatrix Description This is an internal function exported for those people who know what they are doing Usage imxVerifyMatrix Object Arguments Object Object imxVerifyModel imxVerifyModel Description This is an internal function exported for those people who know what they are doing Usage imxVerifyModel model Arguments model model
141. ed using mxMatrix The thresholds matrix must have as many columns as there are ordinal variables in the model and number of rows equal to one fewer than the maximum number of levels found in the ordinal variables The starting values of this matrix must also be set to reasonable values Fill each column with a set of ordered start thresholds one for each level of this column s factor levels minus 1 These thresholds may be free if you wish them to be estimated or fixed The unused rows in each column if any can be set to any value including NA threshnames A character vector consisting of the variables in the thresholds matrix i e the names of ordinal variables in a model This is necessary for OpenMx to map the thresholds matrix columns onto the variables in your data If you set the dimnames of the columns in the thresholds matrix then threshnames is not needed Usage Notes dimnames must be supplied where the matrices referenced by the covariance and means algebras are not themselves labeled Failure to do so leads to an error noting that the covari ance or means matrix associated with the FIML objective does not contain dimnames mxExpectationNormal evaluates with respect to an MxData object The MxData object need not be referenced in the mxExpectationNormal function but must be included in the MxModel object When the type argument in the associated MxData object is equal to raw missing values are permitted in the associated MxDa
142. enMx s examples Usage data nuclear twin design data numHess 1 213 Format A data frame with 1743 observations on the following variables Twinl Twin2 Father Mother Zyg Zygosity of the twin pair Details This is a wide format data set A single variable has values for different member of the same nuclear family Source Likely simulated References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation Examples data nuclear twin design data cor nuclear twin design data 5 use pairwise complete obs numHess1 numeric Hessian data 1 Description data file used by the HessianTest R script Usage data numHess1 Format A 12 by 12 data frame containing Hessian numeric variables a l Examples data numHess1 str numHess1 214 omxAllInt numHess2 numeric Hessian data 2 Description data file used by the HessianTest R script Usage data numHess2 Format A 12 by 12 data frame containing Hessian matrix numeric variables 1 Examples data numHess2 str numHess2 omxAllInt All Interval Multivariate Normal Integration Description omxAllInt computes the probabilities of a large number of cells of a multivariate normal distri bution that has been sliced by a varying number of thresholds in each dimension While the same functionality can be achieved by repeated calls to omxMnor omxAllInt is more efficient for
143. endentModels 33 imxDetermineDefaultOptimizer 33 imxDiff 34 imxDmvnorm 34 imxEvalByName 35 imxExtractMethod 35 imxExtractNames 36 imxExtractReferences 36 261 imxExtractSlot 36 imxFlattenModel 37 imxFreezeModel 37 imxGenerateLabels 37 imxGenerateNamespace 38 imxGenericModelBuilder 38 imxGenSwift 39 imxGetExpectationComponent mxGetExpected 150 imxGetSlotDisplayNames 39 imxHasNPSOL 40 imxHasOpenMP 40 imxIdentifier 40 imxIndependentModels 41 imxInitModel 41 imxInitModel MxLISRELModel method imxInitModel 41 imxInitModel MxModel method imxInitModel 41 imxInitModel MxRAMModel method imxInitModel 41 imxIsDefinitionVariable 41 imxIsPath 42 imxLocateFunction 42 imxLocateIndex 42 imxLocateLabel 43 imxLog 43 imxLookupSymbolTable 43 imxModelBuilder 44 imxModelBuilder MxLISRELModel method imxModelBuilder 44 imxModelBuilder MxModel method imxModelBuilder 44 imxModelBuilder MxRAMModel method imxModelBuilder 44 imxModelTypes 44 imxMpiWrap 45 imxOriginalMx 45 imxPPML 45 imxPPML Test Battery 46 imxPPML Test Test 47 imxPreprocessModel 47 imxReplaceMethod 48 imxReplaceModels 48 imxReplaceSlot 49 imxReservedNames 49 imxReverseIdentifier 50 imxSameType 50 262 imxSeparatorChar 50 imxSfClient 51 imxSimpleRAMPredicate 51 imxSparseInvert 51 imxSquareMatrix 52 164 imxSquareMatrix DiagMatrix method imxSquareMatrix 52 imxSquareMatrix IdenMatrix method imxSqu
144. entation Examples data myAutoregressiveData round cor myAutoregressiveData 2 note the sub diagonal correlations lag 1 1 2 x2 x3 x3 x4 x4 x5 and the second sub diagonal correlations lag 2 x1 x3 x2 x4 x3 x5 myFADataRaw Example 500 row dataset with 12 generated variables Description Twelve columns of generated numeric data x1 x2 x3 x4 x5 x6 yl y2 y3 z1 z2 z3 Usage data myFADataRaw Details The x variables intercorrelate around 6 with each other The y variables intercorrelate around 5 with each other and correlate around 3 with the X vars There are three ordinal variables z1 z2 and z3 The data are used in some OpenMx examples especially confirmatory factor analysis There are no missing data Examples data myFADataRaw str myFADataRaw myGrowthKnownClassData 203 myGrowthKnownClassData Data for a growth mixture model with the true class membership Description Data set used in some of OpenMx s examples Usage data myGrowthKnownClassData Format A data frame with 500 observations on the following variables x1 x variable and time 1 x2 x variable and time 2 x3 x variable and time 3 x4 x variable and time 4 x5 x variable and time 5 c Known class membership variable Details The same as myGrowthMixtureData but with the class membership variable Source Simulated References The OpenMx User s guide can be found at http openmx psyc
145. ents model an MxModel object labels a character vector of target parameter names free a boolean vector of parameter free fixed designations values a numeric vector of parameter values newlabels a character vector of new parameter names lbound a numeric vector of lower bound values ubound a numeric vector of upper bound values indep boolean set parameters in independent submodels strict boolean If TRUE then throw an error when a label does not appear in the model name character string optional a new name for the model See Also omxGetParameters omxAssignFirstParameters Examples A lt mxMatrix Full 3 3 labels c a b NA free TRUE name A model lt mxModel model testModel A name model set value of cells labelled a and b to 1 and 2 respectively model lt omxSetParameters model c a b values c 1 2 set label of cell labelled a to b and vice versa model lt omxSetParameters model c a b newlabels c b a set label of cells labelled a to b model lt omxSetParameters model c a newlabels b ensure initial values are the same for each instance of a labeled parameter model lt omxAssignFirstParameters model omxSymbolTable Internal OpenMx algebra operations Description This is an internal table used in the OpenMx backend OpenMx 245 OpenMx OpenMx An package for Structural Equation Modeling and Matrix Algebra Optimizati
146. erbose the level of debugging output Details The mxFitFunctionMultigroup creates a fit function consisting of the sum of the fit statistics from a list of submodels provided Thus it aggregates fit statistics from multiple submodels This is conceptually similar to creating an mxAlgebra consisting of the sum of the subModel ob jectives and also creating an algebra fit function to optimize the model based on this aggregate value This call to mxFitFunctionMultigroup mxFitFunctionMultigroup c modell model2 then is almost equivalent to the following pair of statements mxAlgebra modell objective model2 objective name myAlgebra mxFitFunctionAlgebra myAlgebra The preferred method of specifying such a fit function is with this multigroup fit function not the algebra fit function In addition to being more compact and readable using mxFitFunctionMultigroup has additional side effects which are valuable for multi group modeling mxFitFunctionMultigroup 141 Firstly it aggregates analytic derivative calculations Secondly it allows mxRefModels to com pute saturated models for raw data as this function can learn which are the constituent submodels Thirdly it allows mxCheckIdentification to evaluate the local identification of the multigroup model Note You can refer to the algebra generated by mxFitFunctionMultigroup when used in a group modelName as modelName fitfunction Examples Brief non running exampl
147. es 39 imxHasNPSOL 5 us ER opo RAE DER Ae opes eG 40 woxHasOpenMP sooo o ee bes mo RESP OX EAR RK uq SO 40 imxldentimer 5 Lu e eS p eum dede ERR S Aa db Rr cina 40 41 imxImtModel z pes e bb ae Se ee de 41 41 imxIsPaths RR woe eR AO ee hal e ene mo ig 42 imxLocateFunction 2 ee 42 IMXILOCAtSINGER uu aot A HOA puk Ae 42 immxLoc teLabel eG Se EOM ENG Oe Gs 43 ak BaP PR Kee SUS eee u p ee dom eee XU Ro RR Ua 43 imxLookupSymbolTable 43 imxModelBuild et ua wee Re ee da Se A E we A 44 i xMOod ellTypes saa eb ee USC 44 WOXMpiWrap ass we k oR ee ee ER Ra 45 i xOngmalMx oe oH Aa xe qeu SS sqxx edes sedo Nis 45 WOXPPM FS ob x sugri RUE a ee bdo bre gp dos 45 imxPPML Test Battery oo cc 2 2 w wow w p p aq Sw w W 46 imxPPML Test lest uu anus e Sl qukusqa Bae ae OSS Baw che EOS 47 imxPreprocessModel 47 imxReplaceMethod s lt o ccecce
148. es 247 summary MxModel RA S Ok es 9 XU EIC RUE EL ROR ee ee es 248 Upea s S SAG S SY S DE be 03 xd bee eae eb R Sw heen omo b S Ro x S 251 CWI Atal se eden Up Soe Baw Edo k Bus Gore Ed hoe 251 twin NA dot uso Sata we doce SL g q we Bae Beeb ar Nee uum qus 253 vec2diag es aw ek Q E Ox Por wa k Qua hoy o OX MO MR YR UE de 254 VECH u S akay ade Ge 3 bee iS ee Ss ee S ee Eo sb te m ee eH A W ee OS s 255 vech2full ov iu cba ERR Oe eho ae eee hac Sod wed 255 mussa aea aei GP Gute Yb aay Bagh Be GP eo te S te aa ee a Sees z 256 VECMSZ U m ee uu sate a Beh de ee Seat aye S SS 257 Index 259 BaseCompute class BaseCompute Description This is an internal class and should not be used directly See Also mxComputeEM mxComputeGradientDescent mxComputeHessianQuality mxComputelterate mx ComputeNewtonRaphson mxComputeNumericDeriv 10 Bollen Bollen Bollen Data on Industrialization and Political Democracy Description Data set used in some of OpenMx s examples for instance WLS The data were reported in Bollen 1989 p 428 Table 9 4 This set includes data from 75 developing countries each assessed on four measures of democracy measured twice 1960 and 1965 and three measures of industrialization measured once 1960 U
149. escription Copy the internal gradient and Hessian back to R Usage mxComputeReportDeriv freeSet NA_character_ Arguments freeSet names of matrices containing free variables mxComputeSequence Invoke a series of compute objects in sequence Description Invoke a series of compute objects in sequence Usage mxComputeSequence steps list freeSet NA_character_ independent FALSE Arguments steps a list of compute objects Not used forces argument freeSet to be specified by name freeSet Names of matrices containing free parameters independent Whether the steps could be executed out of order mxComputeStandardError 91 mxComputeStandardError Compute standard errors given the Hessian or inverse Hessian Description The fit is assumed to be in deviance units 2 log likelihood Usage mxComputeStandardError freeSet NA_character_ Arguments freeSet names of matrices containing free variables mxConstraint Create MxConstraint Object Description This function creates a new MxConstraint object Usage mxConstraint expression name NA Arguments expression An R expression of matrix operators and matrix functions name An optional character string indicating the name of the object Not used Helps OpenMx catch bad input to argument expression Details The mxConstraint function defines relationships between two MxAlgebra or MxMatrix objects They are used to affect the
150. escription Detects the number of cores on the local machine Usage omxDetectCores Arguments unused 228 omxGetParameters omxGetNPSOL omxGetNPSOL Description Get the non CRAN version of OpenMx from the OpenMx website Usage omxGetNPSOL Details This function Value Invisible NULL Examples Not run omxGetNPSOL omxGetParameters Fetch Model Parameters Description Return a vector of the chosen parameters from the model Usage omxGetParameters model indep FALSE free c TRUE FALSE NA fetch c values free lbound ubound all Arguments model a MxModel object indep fetch parameters from independent submodels free fetch either free parameters TRUE or fixed parameters or both types Default value is TRUE fetch which attribute of the parameters to fetch Default choice is values omxGetParameters 229 Details The argument free dictates whether to return only free parameters or only fixed parameters or both free and fixed parameters The function can return unlabelled free parameters parameters with a la bel of NA These anonymous free parameters will be identified as modelname matrixname row col It will not return fixed parameters that have a label of NA No distinction is made between ordinary labels definition variables and square bracket constraints The function will return either a vector of parameter values or free fi
151. estimation of free parameters in the referenced objects The constraint relation is written identically to how a MxAlgebra expression would be written The outermost operator in this relation must be either lt or gt To affect an estimation or optimization an MxConstraint object must be included in an MxModel object with all referenced MxAlgebra and MxMatrix objects Usage Note Use of mxConstraint should be avoided where it is possible to achieve the constraint by equating free parameters by label or position in an MxMatrix or MxAlgebra object Including mxConstraints in an mxModel will disable standard errors and the calculation of the final Hessian 92 mxConstraint and thus should be avoided when standard errors are of importance Constraints also add computa tional overhead If one labels two parameters the same the optimizer has one fewer parameter to optimize However if one uses mxConstraint to do the same thing both parameters remain esti mated and a Lagrangian multiplier is added to maintain the constraint This constraint also has to have its gradients computed and the order of the Hessian grows as well So while both approaches should work the mxConstraint will take longer to do so Alernatives to mxConstraints include using labels bound or ubound arguments or algebras Free parameters in the same MxModel may be constrained to equality by giving them the same name in their respective labels matrices
152. etween the two lists of models based on the value of the all argument If all is set to FALSE default then the first model in the base list is compared to the first model in the comparison list second with second and so on If there are an unequal number of base and comparison models then the shorter list of models is repeated to match the length of the longer list For example comparing base models and B with comparison models C1 C2 and C3 will yield three comparisons with C1 B with C2 and with C3 Each of those comparisons are prefaced by a comparison between the base model and a missing comparison model to present the fit of the base model If all is set to TRUE all possible comparisons between base and comparison models are made and one entry is made for each base model All comparisons involving the first model in base are made first followed by all comparisons with the second base model and so on When there are multiple models in either the base or comparison arguments but not both then the all argument does not affect the set of comparisons made The following columns appear in the output base Name of the base model comparison Name of the comparison model Is lt NA gt for the first ep Estimated parameters of the comparison model minus2LL Minus 2 log likelihood of the compar
153. f the optimization may be obtained using the mxEval function on the name of the MxAlgebra after the model has been run Value Returns a list containing a NULL MxExpectation object and an MxFitFunctionAlgebra object MxFitFunctionAlgebra objects should be included with models with referenced MxAlgebra and MxMatrix objects References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation See Also mxAlgebra to create an algebra suitable as a reference function to be minimized More information about the OpenMx package may be found here Examples Create and fit a very simple model that adds two numbers using mxFitFunctionAlgebra library OpenMx Create a matrix A with no free parameters A lt mxMatrix Full nrow 1 ncol 1 values 1 name A Create an algebra B which defines the expression A B lt mxAlgebra A A name B Define the objective function for algebra B objective lt mxFitFunctionAlgebra B Place the algebra its associated matrix and its objective function in a model tmpModel mxModel model Addition A B objective Evalulate the algebra tmpModelOut mxRun tmpModel View the results tmpModelOut output minimum mxAvailableOptimizers 69 mxAvailableOptimizers mxAvailableOptimizers Description List the Optimizers available in this version e g SLSQP CSOLNP Usage mxAvailableOptimizers Details
154. faults to a character vector of length zero If a value of non zero length is provided it must be a named character vector This vector s names must be the labels of free parameters in the model The vector s elements 1 the character strings themselves must be the names of MxAlgebra or MxMatrix object s each of which equals the first partial derivative of the V matrix with respect to the corresponding free parameter Details Making effective use of argument dV will usually require a custom mxComputeSequence The derivatives of the REML loglikelihood function with respect to parameters can be internally com puted from the derivatives of the V matrix supplied via dV These loglikelihood derivatives will be valid as long as 1 the derivatives of V evaluate to symmetric matrices the same size as V and 2 the model contains no MxConstraints Internally the derivatives of the V matrix are assumed to be symmetric and the elements above their main diagonals are ignored Value Returns a new object of class MxFitFunctionGREML References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation See Also See MxFitFunctionGREML for the S4 class created by mxFitFunctionGREML For more informa tion generally concerning GREML analyses including a complete example see mxExpectationGREML More information about the OpenMx package may be found here Examples gff lt mxFitFunct
155. following 37 variables famid a numeric vector el a numeric vector e2 a numeric vector e3 a numeric vector e4 a numeric vector e5 a numeric vector e6 a numeric vector 7 a numeric vector e8 a numeric vector 18 dzoData 9 a numeric vector e10 anumeric vector e11 anumeric vector e12 anumeric vector e13 anumeric vector e14 anumeric vector e15 anumeric vector e16 anumeric vector e17 anumeric vector e18 anumeric vector al a numeric vector a2 a numeric vector a3 a numeric vector a4 a numeric vector a5 a numeric vector a6 a numeric vector a7 anumeric vector a8 a numeric vector a9 a numeric vector a10 a numeric vector all a numeric vector a12 anumeric vector a13 anumeric vector 14 anumeric vector a15 anumeric vector a16 a numeric vector a17 anumeric vector a18 anumeric vector Examples data dzoData str dzoData eigenvec 19 eigenvec Eigenvector Eigenvalue Decomposition Description eigenval computes the real parts of the eigenvalues of a square matrix eigenvec computes the real parts of the eigenvectors of a square matrix ieigenval computes the imaginary parts of the eigenvalues of a square matrix ieigenvec computes the imaginary parts of the eigenvectors of a square matrix eigenval and ieigenval return nx1 matrices containing the real or imaginary parts of the eigenvalues sorted in decreasing order of the modulus of the complex eigenvalue For eigenvalues without an imaginary part this is equivalen
156. for every row of data The expected covariance matrix of row t is S C AP _1A Q CT R The expected means vector of row t is 0 Dui The dimnames arguments takes an optional character vector The A argument refers to the A matrix in the State Space approach This matrix gives the dynam ics Entries in the diagonal give the strength of the influence of a variable s position on its slope Entries in the off diagonal give the coupling strength from one variable to another The A matrix is sometimes called the state transition model The B argument refers to the B matrix in the State Space approach This matrix consists of exogenous forces that influence the dynamics Note that the covariate effect is contemporaneous the covariate at time t has influence on the slope of the latent state also at time t A lagged effect can be created by lagged the observed variable The B matrix is sometimes called the control input model The C argument refers to the C matrix in the State Space approach This matrix consists of con temporaneous regression coefficients from the latent variable in column 7 to the observed variable in row 2 This matrix is directly analogous to the factor loadings matrix in LISREL and Mplus models The C matrix is sometimes called the observation model The D argument refers to the D matrix in the State Space approach This matrix consists of con temporaneous regressive coefficients from the input ma
157. h the number of rows in the data Data of this type may use the mxFit FunctionML function as its fit function in MxModel objects which can deal with covariance estimation under full information maximum likelihood cov The contents of the observed slot are treated as a covariance matrix The vector argument is not required but may be included for estimations involving means The numObs slot is required Data of this type may use fit functions such as the mxFitFunctionML depending on the specified model cor The contents of the observed slot are treated as a correlation matrix The vector argument is not required but may be included for estimations involving means The numObs slot is required Data of this type may use fit functions such as the mxFitFunctionML depending on the specified model The numObs slot describes the number of observations in the data If type equals raw then numObs is automatically populated as the number of rows in the matrix or data frame in the observed slot If type equals cov or cor then this slot must be input using the numObs argument in the mxData function when the MxData argument is created MxData objects may not be included in MxAlgebra objects or use the mxFitFunctionAlgebra func tion If these capabilities are desired data should be appropriately input or transformed using the mxMatrix and mxAlgebra functions While column names are stored in the obser
158. he OpenMx User s guide can be found at http openmx psyc virginia edu documentation See Also demo mxThreshold mxPath for comparable specification of paths mxMatrix for a matrix based approach to thresholds specification mxModel for the container in which mxThresholds are embedded More information about the OpenMx package may be found here 198 mx TryHard mxTryHard Make multiple attempts to run a model Description Makes multiple attempts to fit an MxModel object with mxRun until the optimizer yields an ac ceptable solution or the maximum number of attempts is reached Each attempt uses the parameter estimates of the previous attempt as start values but they are each multiplied by random draws from a uniform distribution and optimization parameters may be altered From among its attempts the function returns the fitted post mxRun model with the smallest fit function value and can print to the console the start values it used for that model Usage mxTryHard model extraTries 10 greenOK FALSE loc 1 scale 0 25 initialGradientStepSize 00001 initialGradientIterations 1 initialTolerance 1e 12 checkHess TRUE fit2beat Inf paste TRUE iterationSummary FALSE bestInitsOutput TRUE showInits FALSE verbose 0 oa Arguments model extraTries greenOK loc scale The model to be run object of class MxModel The number of attempts to run the model in addition to the first
159. he covariate at time t has influence on the latent state also at time t A lagged effect can be created by lagged the observed variable The B matrix is sometimes called the control input model The C argument refers to the C matrix in the State Space approach This matrix consists of con temporaneous regression coefficients from the latent variable in column 7 to the observed variable in row 2 This matrix is directly analogous to the factor loadings matrix in LISREL and Mplus models The C matrix is sometimes called the observation model The D argument refers to the D matrix in the State Space approach This matrix consists of con temporaneous regressive coefficients from the input manifest covariate variable j to the observed variable in row The D matrix is sometimes called the feedthrough or feedforward matrix The Q argument refers to the Q matrix in the State Space approach This matrix consists of residual covariances among the latent variables This matrix must be symmetric As a special case it is often diagonal The Q matrix is the covariance of the process noise Just as in factor analysis and general structural equation modeling the scale of the latent variables is usually set by fixing some factor loadings in the C matrix or fixing some factor variances in the Q matrix 120 mxExpectationStateSpace The R argument refers to the R matrix in the State Space approach This matrix consists of residual covariance
160. he optimization can be found in the output slot of the resulting model and may be obtained using the mxEval function Value Returns a new MxLISRELObjective object MxLISRELObjective objects should be included with models with referenced MxAlgebra MxData and MxMatrix objects References J reskog K G amp S rbom D 1996 LISREL 8 User s Reference Guide Lincolnwood IL Scientific Software International J reskog K G amp S rbom D 1982 Recent developments in structural equation modeling Jour nal of Marketing Research 19 404 416 The OpenMx User s guide can be found at http openmx psyc virginia edu documentation Examples iHHHHE Factor Model mLX mxMatrix Full values c 5 6 8 rep 0 6 4 7 5 name LX nrow 6 ncol 2 free c TRUE TRUE TRUE rep FALSE 6 TRUE TRUE TRUE mTD lt mxMatrix Diag values c rep 2 6 name z TD nrow 6 ncol 6 free TRUE mPH mxMatrix Symm values c 1 3 1 name PH nrow 2 ncol 2 free c FALSE TRUE FALSE Create a LISREL objective with LX TD and PH matrix names MxListOrNull class 159 objective lt mxLISRELObjective LX LX TD TD PH PH testModel mxModel model testModel mLX mTD mPH objective MxListOrNull class An optional list Description An optional list mxMakeNames mxMakeNames Description Adjust a character vector so that it can be used as MxMatrix column or row names
161. he snowfall library is loaded then this function calls sfApply Otherwise it invokes apply Usage omxApply x margin fun Arguments x a vector atomic or list or an expressions vector Other objects including classed objects will be coerced by as list margin a vector giving the subscripts which the function will be applied over fun the function to be applied to each element of x optional arguments to fun See Also omxLapply omxSapply omxAssignFirstParameters 217 Examples x lt cbind x1 3 x2 c 4 1 2 5 dimnames x 1 lt letters 1 8 omxApply x 2 mean trim 2 omxAssignFirstParameters Assign First Available Values to Model Parameters Description Sometimes you may have a free parameter with two different starting values in your model OpenMx will not run a model until all instances of a free parameter have the same starting value It is often sufficient to arbitrarily select one of those starting values for optimization This function accomplishes that task of assigning valid starting values to the free parameters of a model It selects an arbitrary current value the first value it finds where first is not defined for each free parameter and uses that value for all instances of that parameter in the model Usage omxAssignFirstParameters model indep FALSE Arguments model a MxModel object indep assign parameters to independent submodels See Also omxGetParameters omxSetPa
162. he weighted least squares dif ference between the data and the model implied expectations for the data based on the free parame ters and the expectation function e g mxExpectationNormal or mxExpectationRAM selected for the model The weights argument is ignored Rather the weights are provided in the mxData object often generated by the mxDataWLS function Usage Notes The results of the optimization can be reported using the summary function or accessed directly in the output slot of the resulting model i e modelName output Components of the output may be referenced using the Extract functionality Value Returns a new MxFitFunctionWLS object One and only one MxFitFunctionWLS object should be included in each model along with an associated mxExpectationNormal or mxExpectationRAM object MxFlatModel class 147 References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation Examples it Create and fit a model using mxMatrix mxAlgebra mxExpectationNormal and mxFitFunctionWLS library OpenMx Simulate some data x rnorm 100 mean 0 sd 1 y 0 5 x rnorm 1000 mean 0 sd 1 tmpFrame lt data frame x y tmpNames lt names tmpFrame wdata lt mxDataWLS tmpFrame Define the matrices S lt mxMatrix type Full nrow 2 ncol 2 values c 1 0 0 1 free c TRUE FALSE FALSE TRUE labels c Vx NA NA Vy name S A lt mxMatrix type Full nrow 2 ncol
163. hen using WLS or DLS the answers appear incorrect The ULS estimates for joint ordinal and continuous data appear accurate Consequently do not use this function for joint problems unless type ULS Value Returns a new MxData object References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation 100 mxDataWLS See Also mxFitFunctionWLS MxData for the S4 class created by mxData matrix and data frame for objects which may be entered as arguments in the observed slot More information about the OpenMx package may be found here Examples Create and fit a model using mxMatrix mxAlgebra mxExpectationNormal and mxFitFunctionWLS library OpenMx Simulate some data x rnorm 1000 mean 0 sd 1 y 0 5 x rnorm 1000 mean 0 sd 1 tmpFrame data frame x y tmpNames lt names tmpFrame wdata mxDataWLS tmpFrame Define the matrices S lt mxMatrix type Full nrow 2 ncol 2 values c 1 0 0 1 free c TRUE FALSE FALSE TRUE labels c Vx NA NA Vy name S A lt mxMatrix type Full nrow 2 ncol 2 values c 0 1 0 0 free c FALSE TRUE FALSE FALSE labels c NA b NA NA name A I mxMatrix type Iden nrow 2 ncol 2 name I Define the expectation expCov lt mxAlgebra solve I A S t solve I A name expCov expFunction lt mxExpectationNormal covariance expCov dimnames tmpNames Choose a fit
164. hod MxInterval class 153 lt MxLISRELModel method MxLISRELModel class 155 lt MxMatrix method MxMatrix class 162 lt MxModel method MxModel class 171 lt MxPath method mxPath 177 lt MXRAMModel method MxRAMModel class 181 lt MxThreshold method mxThreshold 196 8 mxAlgebra 62 mxAlgebra 62 apply 2 6 as character 174 as list 216 231 240 BaseCompute class 9 Bollen 10 Classes 66 72 93 170 173 cut 148 cvectorize 11 64 247 251 255 257 data frame 95 97 100 demoOneFactor 11 demoTwoFactor 12 detectCores 74 diag 13 64 254 diag2vec 13 64 254 DiagMatrix class MxMatrix class 162 dim MxMatrix method MxMatrix class 162 dimnames 3 132 INDEX dimnames MxAlgebra method MxAlgebra class 65 dimnames MxMatrix method MxMatrix class 162 dimnames lt MxAlgebra method MxAlgebra class 65 dimnames lt MxMatrix method MxMatrix class 162 dzfData 14 dzmData 16 dzoData 17 eigen 19 eigenval 63 eigenval eigenvec 19 eigenvec 19 examplel 20 27 example2 20 21 expm 22 64 Extract 76 78 113 132 138 146 factor 128 factorExamplel 22 factorScaleExamplel 23 25 factorScaleExample2 24 FullMatrix class MxMatrix class 162 genericFitDependencies MxBaseFitFunction method 25 here 64 68 71 72 76 78 95 97 100 105 107 135 137 152 162 164 170 173 179 1
165. holds 227 omxDetectCores 227 omxExponential 64 omxExponential expm 22 omxGetNPSOL 228 omxGetParameters 199 217 228 232 244 omxGetRAMDepth 230 omxGraphviz 231 omxGreaterThan 64 omxGreaterThan omxLogical 233 omxLapply 216 231 240 omxLessThan 64 omxLessThan omxLogical 233 omxLocateParameters 229 232 omxLogical 233 omxMatrixOperations 234 omxMnor 64 214 215 234 omxNameAnonymousParameters 235 omxNormalQuantiles 236 omxNot 64 omxNot omxLogical 233 omxOr 64 omxOr omxLogical 233 omxParallelCI 237 omxQuotes 238 omxRAMtoML 238 omxRbind omxMatrixOperations 234 omxRMSEA 239 omxSapply 2 6 232 240 omxSaturatedModel 241 omxSelectCols 145 188 omxSelectCols omxSelectRowsAndCols 242 omxSelectRows 45 188 omxSelectRows omxSelectRowsAndCols 242 omxSelectRowsAndCols 45 188 242 omxSetParameters 198 217 229 232 243 omxSymbolTable 244 omxTranspose omxMatrixOperations 234 OpenMx 93 245 OpenMx package OpenMx 245 option 60 161 options 80 ordinalTwinData 246 p2z mxAlgebra 62 print BaseCompute method BaseCompute class 9 INDEX print MxAlgebra method MxAlgebra class 65 print MxAlgebraFormula method MxAlgebraFormula class 66 print MxConstraint method mxConstraint 91 print MxDataDynamic method mxDataDynamic 98 print MxDataStatic method MxDataStatic class 98 print MxExpectationBA81 method
166. if 25 nrow 5 ncol 5 name B EPSILON lt mxMatrix values 0 04 1 25 nrow 5 ncol 5 name EPSILON model lt mxModel A B EPSILON name model mxEval omxNot A model mxEval omxGreaterThan A B model mxEval omxLessThan B A model mxEval omxOr omxNot A B model mxEval omxAnd omxNot B A model mxEval omxApproxEquals A B EPSILON model 234 omxMnor omxMatrixOperations MxMatrix operations Description omxCbind columnwise binding of two or more MxMatrices omxRbind rowwise binding of two or more MxMatrices omxTranspose transpose of MxMatrix Usage omxCbind allowUnlabeled getOption mxOptions Allow Unlabeled dimnames NA name NA omxRbind allowUnlabeled getOption mxOptions Allow Unlabeled dimnames NA name NA omxTranspose matrix allowUnlabeled getOption mxOptions Allow Unlabeled dimnames NA name NA Arguments two or more MxMatrix objects matrix MxMatrix input allowUnlabeled whether or not to accept free parameters with NA labels dimnames list The dimnames attribute for the matrix a list of length 2 giving the row and column names respectively An empty list is treated as NULL and a list of length one as row names The list can be named and the list names will be used as names for the dimensions name an optional character string indicating the name of the MxMatrix object omxMnor Multivariate Normal Integrat
167. if available warmStart a Cholesky factored Hessian to use as the NPSOL Hessian starting value pre conditioner nudgeZeroStarts whether to nudge any zero starting values prior to optimization default TRUE maxMajorIter maximum number of major iterations gradientAlgo one of c forward central gradientIterations number of Richardson iterations to use for the gradient default 2 gradientStepSize the step size for the gradient default 1e 5 mxComputeHessianQuality 85 Details One of the most important options for SLSQP is gradientAlgo By default the forward method is used This method requires gradientIterations function evaluations per parameter per gradient This method often works well enough but can result in imprecise gradient estimations that may not allow SLSQP to fully optimize a given model If code red is reported then you are encouraged to try the central method The central method requires 2 times gradientIterations function evaluations per parameter per gradient but it can be much more accurate References Luenberger D G amp Ye Y 2008 Linear and nonlinear programming Springer Examples data demoOneFactor factorModel lt mxModel name One Factor mxMatrix type Full nrow 5 ncol 1 free FALSE values 0 2 namez A mxMatrix type Symm nrow 1 ncol 1 free FALSE values 1 name z L mxMatrix type Diag nrow 5 ncol 5 free TRUE values 1 name U mxAlgebra expression A L
168. ihood units the 2 scaling factor is not applied automatically You have to multiply by 2 yourself mxFitFunctionGREML 135 Value Returns an MxFitFunctionAlgebra object MxFitFunctionAlgebra objects should be included with models with referenced MxAlgebra and MxMatrix objects References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation See Also mxAlgebra to create an algebra suitable as a reference function to be minimized More information about the OpenMx package may be found here Examples Create and fit a very simple model that adds two numbers using mxFitFunctionAlgebra library OpenMx Create a matrix A with no free parameters A lt mxMatrix Full nrow 1 ncol 1 values 1 name A Create an algebra B which defines the expression A A B mxAlgebra A A name B Define the objective function for algebra B objective lt mxFitFunctionAlgebra B Place the algebra its associated matrix and its objective function in a model tmpModel mxModel model Addition A B objective Evalulate the algebra tmpModelOut mxRun tmpModel View the results tmpModelOut output minimum mxFitFunctionGREML Create MxFitFunctionGREML Object Description This function creates a new MxFitFunctionGREML object Usage mxFitFunctionGREML dV character 0 136 MxFitFunctionGREML class Arguments dV Vector of character strings de
169. ilon 0 01 220 omxCheckEquals omxCheckEquals Equality Testing Function Description This function tests whether two objects are equal using the operator Usage omxCheckEquals a b Arguments a the first value to compare b the second value to compare Details Performs the comparison on the two arguments If the two arguments are not equal then an er ror will be thrown If a and b are equal to each other by default the function will print a statement informing the user the test has passed To turn off these print statements use options mxPrintUnitTests FALSE References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation See Also omxCheckCloseEnough omxCheckWi thinPercentError omxCheckSetEquals omxCheckTrue omxCheckIdentical Examples omxCheckEquals c 1 2 3 c 1 2 3 omxCheckEquals FALSE FALSE Throws an error try omxCheckEquals c 1 2 3 c 2 1 3 omxCheckError 221 omxCheckError Correct Error Message Function Description This function tests whether the correct error message is thrown Usage omxCheckError expression message Arguments expression an R expression that produces an error message a character string with the desired error message Details Arguments expression and message give the expression that generates the error and the message that is supposed to be generated respectively
170. imate Modification Indices for MxModel Objects Description This function estimates the change in fit function value resulting from freeing currently fixed pa rameters Usage mxMI model matrices NA full TRUE Arguments model An MxModel for which modification indices are desired matrices Character vector The names of the matrices in which to search for modification full Logical Whether or not to return the full modification index in addition to the restricted mxMI 165 Details Modification indices provide an estimate of how much the fit function value would change if a pa rameter that is currently fixed was instead freely estimated There are two versions of this estimate a restricted version and an full version The restricted version is reported as the MI and is much faster to compute The full version is reported as MI Full The full version accounts for the total change in fit function value resulting from the newly freed parameter The restricted version only accounts for the change in the fit function due to the movement of the new free parameter In par ticular the restricted version does not account for the change in fit function value due to the other free parameters moving in response to the new parameter The algorithm respects fixed parameter labels That is when a fixed parameter has a label and occurs in more than one spot then that fixed parameter is freed in all locations in which it occurs to evaluate th
171. in the model A free parameter in any row and column describes a covariance between the variable represented by that row and the variable represented by that column Variances are covariances between any variable at itself which occur on the diagonal of the specified matrix The F argument refers to the F or filter matrix in the RAM approach If no latent variables are included in the model i e the A and S matrices are of both of the same dimension as the data matrix then the F should refer to an identity matrix If latent variables are included 1 the A and S matrices are not of the same dimension as the data matrix then the F argument should consist of a horizontal adhesion of an identity matrix and a matrix of zeros The M argument refers to the M or means matrix in the RAM approach It is 1 x n matrix where n is the number of manifest variables the number of latent variables The M matrix must be specified if either the mxData type is cov or cor and a means vector is provided or if the mxData type is raw Otherwise the M matrix is ignored The MxMatrix objects included as arguments may be of any type but should have the properties described above The mxRAMObjective will not return an error for incorrect specification but incorrect specification will likely lead to estimation problems or errors in the mxRun function mxRAMObjective evaluates with respect to an MxData object The MxData obj
172. integer school School attended Factor w 2 levels Grant White and Pasteur addition A speed test numeric code A speed test numeric counting A speed test numeric straight A speed test numeric wordr A memory subtest numberr A memory subtest figurer A memory subtest object A memory subtest numberf A memory subtest figurew A memory subtest deduct A mathematical subtest numeric A mathematical subtest problemr A mathematical subtest series A mathematical subtest arithmet A mathematical subtest visual A spatial subtest HS ability data 27 cubes A spatial subtest paper A spatial subtest flags A spatial subtest paperrev A spatial subtest flagssub A spatial subtest general A verbal subtest paragrap A verbal subtest sentence A verbal subtest wordc A verbal subtest wordm A verbal subtest Details The data are from children who differ in grade seventh and eighth grade and are nested in one of two schools Pasteur and Grant White You will see it in use elsewhere both in R lavaan MBESS and in Joreskog 1969 reporting a cfa on the Grant White school subject subset The last two tests are substitute versions for other tests paperrev a paper form board test can substitute for paper and flagssub for the lozenges test flags Source Holzinger K and Swineford F 1939 References Holzinger K and Swineford F 1939 A study in factor analysis The stability of a bifactor solution Supple
173. ion Description Given a covariance matrix a means vector and vectors of lower and upper bounds returns the multivariate normal integral across the space between bounds Usage omxMnor covariance means lbound ubound omxNameAnonymousParameters 235 Arguments covariance the covariance matrix describing the multivariate normal distribution means a row vector containing means of the variables of the underlying distribution lbound row vector containing the lower bounds of the integration in each variable ubound row vector containing the upper bounds of the integration in each variable Details The order of columns in the means Ibound and ubound vectors are assumed to be the same as that of the covariance matrix That is means 1 is considered to be the mean of the variable whose variance is in covariance i i That variable will be integrated from Ibound i to ubound i as part of the integration The value of ubound i or Ibound i may be set to Inf or Inf if a boundary at positive or negative infinity is desired For all i ubound i must be strictly greater than Ibound i Examples data myFADataRaw covariance lt cov myFADataRaw 1 3 means lt colMeans myFADataRawL 1 3 lbound c Inf 0 1 Integrate from Infinity to 0 on first variable ubound lt c Inf 2 5 From to Infinity on second and from 1 to 2 5 on third omxMnor covariance means lbound ubound 0 0005995
174. ion fit2 id2 status The model is locally identified Build a model from the solution of the previous one but now the factor variance is also free model2n mxModel fit2 name Non Identified Two Factor mxPath from latents 1 arrows 2 free TRUE values 1 mid2 mxCheckIdentification model2n mid2 non identified parameters The factor loadings and factor variance are not identified mxCI 75 mxCI Create mxCI Object Description This function creates a new MxCI object which are used to estimate likelihood based confidence intervals Usage mxCI reference interval 0 95 type c both lower upper Arguments reference A character vector of free parameters mxMatrices mxMatrix elements and mx Algebras on which confidence intervals are to be estimated listed by name interval A scalar numeric value indicating the confidence interval to be estimated Must be between 0 and 1 Defaults to 0 95 type A character string indicating whether the upper lower or both confidence limits are returned Defaults to both Details The mxCI function creates MxCI objects which can be used as arguments in MxModel objects When models containing MxCI objects are optimized using mxRun with the intervals argument set to TRUE likelihood based confidence intervals are returned The likelihood based confidence intervals calculated by MxCI objects are symmetric with respect to the change in likelihood in ei
175. ion returns the half vectorization of an input matrix as a column vector Usage vech x Arguments x an input matrix Details The half vectorization of an input matrix consists of the elements in the lower triangle of the matrix including the elements along the diagonal of the matrix as a column vector The column vector is created by traversing the matrix in column major order See Also vech2fu11 vechs rvectorize cvectorize Examples vech matrix 1 9 3 3 vech matrix 1 12 3 4 vech2full Inverse Half vectorization Description This function returns the symmetric matrix constructed from a half vectorization Usage vech2full x Arguments x an input single column or single row matrix 256 vechs Details The half vectorization of an input matrix consists of the elements in the lower triangle of the matrix including the elements along the diagonal of the matrix as a column vector The column vector is created by traversing the matrix in column major order The inverse half vectorization takes a vector and reconstructs a symmetric matrix such that vech2full vech x is identical to x if x is symmetric Note that very few vectors have the correct number of elements to construct a symmetric matrix For example vectors with 1 3 6 10 and 15 elements can be used to make a symmetric matrix but none of the other numbers between 1 and 15 can An error is thrown if the number of elements in x cannot b
176. ionAlgebra algebra numObs NA numStats NA Arguments algebra A character string indicating the name of an MxAlgebra or MxMatrix object to use for optimization numObs optional An adjustment to the total number of observations in the model numStats optional An adjustment to the total number of observed statistics in the model Details NOTE THIS DESCRIPTION IS DEPRECATED Please change to using mxFitFunctionAlgebra as shown in the example below Fit functions are functions for which free parameter values are chosen such that the value of the ob jective function is minimized While the other fit functions in OpenMx require an expectation func tion for the model the mxAlgebraObjective function uses the referenced MxAlgebra or MxMatrix object as the function to be minimized If a model s primary objective function is a mxAlgebraObjective objective function then the ref erenced algebra in the objective function must return a x matrix when using OpenMx s default optimizer There is no restriction on the dimensions of an objective function that is not the primary or topmost objective function 68 mxAlgebraObjective To evaluate an algebra objective function place the following objects in a MxModel object a MxAlgebraObjective MxAlgebra and MxMatrix entities referenced by the MxAlgebraObjective and optional MxBounds and MxConstraint entities This model may then be evaluated using the mxRun function The results o
177. ionGREML str gff MxFitFunctionGREML class Class MxFitFunctionGREML Description MxFitFunctionGREML is the fitfunction class for GREML analyses Objects from the Class Objects can be created by calls of the form mxFitFunctionGREML dV MxFitFunctionGREML class 137 Slots dV Object of class MxCharOrNumber Identifies the MxAlgebra or MxMatrix object s to serve as the derivatives of V with respect to free parameters dVnames Vector of character strings names of the free parameters corresponding to slot dV MLfit Object of class numeric equal to the maximum likelihood fitfunction value as opposed to the restricted maximum likelihood value info Object of class list dependencies Object of class integer expectation Object of class integer vector Object of class logical result Object of class matrix name Object of class character numObs Object of class integer Extends Class MxBaseFitFunction directly Class MxBaseNamed by class MxBaseFitFunction dis tance 2 Class MxFitFunction by class MxBaseFitFunction distance 2 Methods No methods defined with class MxFitFunctionGREML in the signature References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation See Also See mxFitFunctionGREML for creating MxFitFunctionGREML objects See mxExpectationGREML for creating MxExpectationGREML objects and for more
178. is an S4 class An MxAlgebra object is a named entity New instances of this class can be created using the function mxAlgebra Details The MxAlgebra class has the following slots name The name of the object formula The R expression to be evaluated result a matrix with the computation result The name slot is the name of the MxAlgebra object Use of MxAlgebra objects in the mxConstraint function or an objective function requires reference by name The formula slot is an expression containing the expression to be evaluated These objects are operated on or related to one another using one or more operations detailed in the mxAlgebra help file 66 mxAlgebraFromString The result slot is used to hold the results of computing the expression in the formula slot If the containing model has not been executed then the result slot will hold a 0 x 0 matrix Otherwise the slot will store the computed value of the algebra using the final estimates of the free parameters Slots may be referenced with the symbol See the documentation for Classes and the examples in the mxAlgebra document for more information References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation See Also mxAlgebra mxMatrix MxMatrix MxAlgebraFormula class MxAlgebraFormula Description This is an internal class for the formulas used in mxAlgebra calls mxAlgebraFromString C
179. is model with applications Psychome trika 75 581 612 Seong T J 1990 Sensitivity of marginal maximum likelihood estimation of item and ability parameters to the characteristics of the prior ability distributions Applied Psychological Measure ment 14 3 299 311 See Also RPF mxExpectationGREML Create MxExpectationGREML Object Description This function creates a new MxExpectationGREML object Usage mxExpectationGREML V yvars character 0 Xvars list addOnes TRUE blockByPheno TRUE staggerZeroes TRUE dataset is yX FALSE casesToDropFromV integer 0 Arguments V Character string the name of the MxAlgebra or MxMatrix to serve as the V matrix the model expected covariance matrix Internally the V matrix is assumed to be symmetric and its elements above the main diagonal are ignored yvars Xvars addOnes blockByPheno staggerZeroes Passed to mxGREMLDataHandler dataset is yX Logical defaults to FALSE If TRUE then the first column of the raw dataset is taken as is to be the y phenotype vector and the remaining columns are taken as is to be the X matrix of covariates In this case mxGREMLDataHandler is never internally called at runtime and all other arguments besides V and casesToDropFronmvV are ignored casesToDropFromV Integer vector Its elements are the numbers of the rows and columns of covari ance matrix V to be dropped at runtime usually because they correspond to ro
180. ison model If the comparison model is lt NA gt then the minus 2 log likelihood of the base model is given df Degrees in freedom of the comparison model If the comparison model is lt NA gt then the degrees of freedom of the base model is given AIC Akaike s Information Criterion for the comparison model If the comparison model is lt NA gt then the AIC of the base model is given diffLL Difference in minus 2 log likelihoods of the base and comparison models Will be positive when base model 2LL is higher than comparison model 2LL diffdf Difference in degrees of freedoms of the base and comparison models Will be positive when base model DF is lower than comparison model DF base model estimated parameters is higher than comparison model estimated parameters p P value for likelihood ratio test based on diffLL and diffdf values 80 mxCompare The mxCompare function will give a p value for any comparison in which both diffLL and are non negative However this p value is based on the assumptions of the likelihood ratio test specifically that the two models being compared are nested The likelihood ratio test and associated p values are not valid when the comparison model is not nested in the referenced base model Use options digits N to set the minimum number of significant digits to be printed in values The mxCompare function does not directly accept a digits argument and depends on the value of the
181. itModel imxInitModel Description This is an internal function exported for those people who know what they are doing Usage imxInitModel model Arguments model model imxIsDefinitionVariable imxIs Definition Variable Description This is an internal function exported for those people who know what they are doing Usage imxIsDefinitionVariable name Arguments name name 42 imxLocateIndex imxIsPath imxIsPath Description This is an internal function exported for those people who know what they are doing Usage imxIsPath value Arguments value value imxLocateFunction imxLocateFunction Description This is an internal function exported for those people who know what they are doing Usage imxLocateFunction function name Arguments function name function name imxLocateIndex imxLocateIndex Description This is an internal function exported for those people who know what they are doing Usage imxLocateIndex model name referant Arguments model model name name referant referant imxLocateLabel 43 imxLocateLabel imxLocateLabel Description This is an internal function exported for those people who know what they are doing Usage imxLocateLabel label model parameter Arguments label label model model parameter parameter imxLog Test thread safe output code Description This is the code that the backend uses to write diagn
182. jects By default a new MxModel object will be created To create a modified version of an existing MxModel object include this model in the model argument Other named entities may be added as arguments to the mxModel function which are then added to or removed from the model specified in the model argument Other functions you can use to add objects to the model to this way are mxCI mxAlgebra mxBounds mxConstraint mxData and mxMatrix objects as well as objective functions You can also include MxModel objects as sub models of the output model and may be estimated separately or jointly depending on shared parameters and the independent flag discussed below Only one MxData object and one objective function may be included per model but there are no restrictions on the number of other named entities included in an mxModel statement All other arguments must be named i e latentVars names or they will be interpreted as elements of the ellipsis list The manifestVars and latentVars arguments specify the names of the manifest and latent variables respectively for use with the mxPath function The remove argument may be used when mxModel is used to create a modified version of an existing MxMatrix object When remove is set to TRUE the listed objects are removed from the model specified in the model argument When remove is set to FALSE the listed objects are added to the model sp
183. jects which consist of five matrices and a type argu ment The values matrix is made up of numeric elements whose usage and capabilities in other functions are defined by the free matrix If an element is specified as a fixed parameter in the free matrix then the element in the values matrix is treated as a constant value and cannot be altered or updated by an objective function when included in an mxRun function If an element is specified as a free parameter in the free matrix the element in the value matrix is considered a starting value and can be changed by an objective function when included in an mxRun function Element labels beginning with data can be used if the MxMatrix is to be used in an MxModel object that has a raw dataset i e an MxData object of type raw Such a label instructs OpenMx to use a particular column of the raw dataset to fill in the value of that element For historical reasons the variable contained in that column is called a definition variable For example if an MxMatrix element has the label data x then OpenMx will use the first value of the data column named x when evaluating the fitfunction for the first row and will use the second value of column x when evaluating the fitfunction for the second row and so on After the call to mxRun the values for elements labeled with data x are returned as the value from the first 1 e first before any automated so
184. l omxCheckTrue omxCheckEquals Examples omxCheckSetEquals c 1 1 2 2 3 c 3 2 1 omxCheckSetEquals matrix 1 1 1 matrix 1 3 3 Throws an error try omxCheckSetEquals c 1 2 3 4 c 2 1 3 omxCheckTrue Boolean Equality Testing Function Description This function tests whether an object is equal to TRUE Usage omxCheckTrue a Arguments a the value to test Details Checks element wise whether an object is equal to TRUE If any of the elements are false then an error will be thrown If a is TRUE by default the function will print a statement informing the user the test has passed To turn off these print statements use options mxPrintUnitTests FALSE References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation See Also omxCheckCloseEnough omxCheckWi thinPercentError omxCheckIdentical omxCheckSetEquals omxCheckEquals omxCheck Warning 225 Examples omxCheckTrue 1 1 2 omxCheckTrue matrix TRUE 3 3 Throws an error try omxCheckTrue FALSE omxCheckWarning Correct Warning Message Function Description This function tests whether the correct warning message is thrown Usage omxCheckWarning expression message Arguments expression an R expression that produces a warning message a character string with the desired warning message Details Arguments expression and message give the expressio
185. l space of the Jacobian to determine whether or not a model is identified local to its current parameter values The output is a list of the the identification status the Jacobian and which parameters are not identified Usage mxCheckIdentification model details TRUE Arguments model A MxModel object or list of MxModel objects details logical Details The mxCheckldentification function is used to check that a model is identified That is the function will tell you if the model has a unique solution in parameter space The function is most useful when applied to either a a model that has been run and had some NA standard errors or b a model that has not been run but has reasonable starting values In the former situation mxCheckIdentification is used as a diagnostic after a problem was indicated In the latter situation mxChecklIdentification is used as a sanity check The method uses the Jacobian of the model expected means and the unique elements of the expected covariance matrix with respect to the free parameters It is the first derivative of the mapping between the free parameters and the sufficient statistics for the Normal distribution The method does not depend on data but does depend on the current values of the free parameters Thus it only provides local identification not global identification Because the method does not depend on data the model still could be empirically unidentified due to missing data The Jac
186. lass 93 MxData 94 95 99 100 108 110 113 115 116 128 120 123 125 126 132 156 156 161 167 169 170 172 173 182 212 MxData MxData class 96 mxData 94 96 97 110 113 116 120 125 132 146 158 167 169 170 182 245 MxData class 96 mxDataDynamic 98 MxDataDynamic class mxDataDynamic 98 MxDataFrameOrMatrix MxDataFrameOrMatrix class 98 MxDataFrameOrMatrix class 98 MxDataStatic MxDataStatic class 98 MxDataStatic class 98 mxDataWLS 99 746 MxDirectedGraph MxDirectedGraph class 101 MxDirectedGraph class 101 264 mxEval 68 101 110 116 120 125 134 158 167 182 mxEvalByName mxEval 101 MxExpectation MxExpectation class 103 MxExpectation class 103 mxExpectationBA81 69 103 242 MxExpectationBA81 class mxExpectationBA81 103 MxExpectationGREML 704 105 MxExpectationGREML MxExpectationGREML class 106 mxExpectationGREML 104 106 107 136 137 152 MxExpectationGREML class 106 mxExpectationLISREL 69 108 148 150 230 245 MxExpectationLISREL class mxExpectationLISREL 108 mxExpectationNormal 69 112 132 138 146 148 150 167 186 245 MxExpectationNormal class mxExpectationNormal 112 mxExpectationRAM 69 110 115 138 146 146 150 182 193 194 230 245 MxExpectationRAM class mxExpectationRAM 115 mxExpectationSSCT INDEX MxFitFunctionGREML class 136 mxFitFunctionML 70 94 95 97 113 116 123 132 138 165 167 182 166 245 MxFi
187. lly in SLSQP to best accommodate their sharp geometry For the default compute plan the choice of constraintType is determined by which optimizer is selected References Pek J amp Wu H in press Profile likelihood based confidence intervals and regions for structural equation models Psychometrica mxComputeDefault Default compute plan Description The default compute plan is approximately as follows mxComputeSequence list mxComputeGradientDescent mxComp Usage mxComputeDefault freeSet NA_character_ Arguments freeSet names of matrices containing free variables mxComputeEM Fit a model using DLR s 1977 Expectation Maximization EM al gorithm Description The EM algorithm constitutes the following steps Start with an initial parameter vector Predict the missing data to form a completed data model Optimize the completed data model to obtain a new parameter vector Repeat these steps until convergence criteria are met Usage mxComputeEM expectation predict mstep observedFit fitfunction maxIter 500L tolerance 1e 09 verbose 0L freeSet NA_character_ accel varadhan2008 information NA_character_ infoArgs list mxComputeEM 83 Arguments expectation a vector of expectation names predict what to predict from the observed data available options depend on the expec tation mstep a compute plan to optimize the completed data model observedFit the name of the ob
188. lor the problem to the abilities of the optimizer The problem can be posed without the use of constraints This is how the code worked in version 2 1 and prior Although this way of posing the problem creates an ill conditioned Hessian NPSOL is somehow able to isolate the poor conditioning from the rest of the problem and optimize it quickly However SLSQP is not so clever and exhibits very poor performance For SLSQP good performance is contingent on posing the problem using an inequality constraint on the fit Usage mxComputeConfidenceInterval plan freeSet NA character verbose 0L engine NULL fitfunction fitfunction tolerance NA_real_ constraintType ineq Arguments plan compute plan to optimize the model Not used Forces remaining arguments to be specified by name freeSet names of matrices containing free variables verbose level of debugging output engine deprecated fitfunction The deviance function to constrain with an inequality constraint tolerance deprecated constraintType one of c ineq eq both 82 mxComputeEM Details Geometrically SLSQP performs best on smooth likelihood surfaces with smooth derivatives In the profile CI problem the distance limit on the deviance is like a wall Walls do not have smooth derivatives but are more like a step function The point of mxConstraint is to isolate the parts of a problem that are geometrically non smooth Constraints are dealt with specia
189. lt mxMatrix Full 1 1 free TRUE values 1 labels param name F alg lt mxAlgebra log start name logP Force the fixed parameter in matrix G to be the result of the algebra end lt mxMatrix Full 1 1 free FALSE values 1 labels logP 1 1 name G MxConstraint class MxConstraint Class Description MxConstraint is an S4 class An MxConstraint object is a named entity New instances of this class can be created using the function mxConstraint Details The MxConstraint class has the following slots name Thename ofthe object formula The R expression to be evaluated The name slot is the name of the MxConstraint object Use of MxConstraint objects in other functions in the OpenMx library may require reference by name The formula slot is an expression containing the expression to be evaluated These objects are operated on or related to one another using one or more operations detailed in the mxConstraint help file Slots may be referenced with the symbol See the documentation for Classes and the examples in the mxConstraint document for more information References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation See Also mxConstraint for the function that creates MxConstraint objects 94 mxData mxData Create MxData Object Description This function creates a new MxData object Usage mxData observed type means NA numObs
190. lta and upperdelta slots give the changes in likelihoods used to define the confidence interval The upper bound of the likelihood based confidence interval is estimated by increasing the parameter estimate leaving all other parameters free until the model 2 log likelihood increased by upperdelta The lower bound of the confidence interval is estimated by decreasing the pa rameter estimate leaving all other parameters free until the model 2 log likelihood increased by lowerdata Likelihood based confidence intervals may be specified by including one or more MxCI objects in an MxModel object Estimation of confidence intervals requires model optimization using the mxRun function with the intervals argument set to TRUE The calculation of likelihood based confidence intervals can be computationally intensive and may add a significant amount of time to model estimation when many confidence intervals are requested References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation See Also mxCI for creating MxCI objects More information about the OpenMx package may be found here mxCompare Assign Model Parameters Description Compare the fit of a model or set of models to a reference model or set of reference models The output is a table with one row per model comparison Usage mxCompare base comparison all FALSE Arguments base A MxModel object or list of MxModel obje
191. lte 4 9 due cbe p erre e Sade tip ue Bae aids 78 MxCompute class rh 81 mxComputeConfidencelnterval 2 2 eA 81 mxComputeDefault lees 82 mxComputeEM llle rs 82 mxComputeGradientDescent 84 mxComputeHessianQuality es 85 mxComputelterate leere 86 mxComputeNewtonRaphson 87 mxComputeNothing lees 87 mxComputeNumericDeriv 88 mxComputeOnce 4 asc BAe Ee SE RO SURGE m Q Ua EROR NDS W 89 mxComputeReportDeriv 90 90 mxComputeStandardError 91 mxConstralnt 2 6 ew ws ed k s uie OA sided e U ete ged 91 MxConstrant class 93 mxbata pkg ED ee Me Spee ok Y Rum Sd ee Oe ee wo 94 MxData class uo Bak Bao SAG Bk IR AURA ROAD ACA UR IR q 96 mxDataDynamic WR O rss 98 8 98 MxDataStatic class p ERA 98 mxDataWLS i o led eae aA eA m E bo dom Rum op e ER 99 MxDirectedGraph class ees 101 R topics documented 7 MXE Val du
192. lumn vector of the elements along the diagonal Usage diag2vec x Arguments x an input matrix Details Similar to the function diag except that the input argument is always treated as a matrix i e it doesn t have diag s functions of returning an Identity matrix from an nrow specification nor to return a matrix wrapped around a diagonal if provided with a vector To get vector2matrix functionality call vec2diag 14 dzfData See Also vec2diag Examples diag2vec matrix 1 9 nrow 3 1 diag2vec matrix 1 12 nrow 3 ncol 4 1 1 1 2 5 3 9 dzfData DZ female data Description Data for extended twin example ETC88 R Usage data dzfData Format A data frame with 2007 observations on the following 37 variables famid a numeric vector 1 a numeric vector 2 a numeric vector e3 a numeric vector e4 a numeric vector e5 a numeric vector e6 a numeric vector 7 a numeric vector e8 a numeric vector e9 a numeric vector e10 anumeric vector dzfData ell e12 e13 e14 e15 e16 e17 e18 al a2 a3 a4 a5 a6 a7 a8 a9 a10 all 12 13 14 15 16 17 18 Exampl a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a nume
193. m vector that in general cannot be partitioned into independent subvectors For this reason definition variables are not compatible and should be unnecessary with GREML expectation GREML expectation can still be used if the covariance ma trix is sparse but as of this writing OpenMx does not take advantage of the sparseness to improved performance Because of the limitations of restricted maximum likelihood GREML expectation is presently incompatible with ordinal variables Value Returns a new object of class MxExpectationGREML References One of the first uses of the acronym GREML Benjamin DJ Cesarini D van der Loos MJHM Dawes CT Koellinger PD et al 2012 The genetic architecture of economic and political preferences Proceedings of the National Academy of Sciences 109 8026 8031 doi 10 1073 pnas 1120666109 The OpenMx User s guide can be found at http openmx psyc virginia edu documentation See Also See MxExpectationGREML for the S4 class created by mxExpectationGREML More information about the OpenMx package may be found here Examples dat lt cbind rnorm 100 rep 1 100 colnames dat lt c y x ge lt mxExpectationGREML V V 1151 addOnes FALSE gff lt mxFitFunctionGREML dV c ve I 106 MxExpectationGREML class plan lt mxComputeSequence steps list mxComputeNewtonRaphson freeSet c Ve fitfunction fitfunction mxComputeOnce fitfuncti
194. matrix has no colnames Raw Value Numeric values of the raw i e UNstandardized path coefficients Raw SE Numeric values of the asymptotic standard errors of the raw path coefficients if if SE TRUE or NA otherwise Std Value Numeric values of the standardized path coefficients Std SE Numeric values of the asymptotic standard errors of the standardized path coef ficients if SE TRUE or NA otherwise If model is a multi group model containing at least one submodel with RAM expectation then mxStandardizeRAMpaths returns a list The list has a number of elements equal to the number of submodels that either have RAM expectation or contain a submodel that does List elements cor responding to RAM expectation submodels contain a dataframe as described above List elements corresponding to container submodels are themselves lists of the kind described here Examples library OpenMx data demoOneFactor manifests lt names demoOneFactor latents lt c G factorModel lt mxModel model One Factor type RAM manifestVars manifests latentVars latents mxPath from latents to manifests mxPath from manifests arrows 2 values 0 1 mxPath from latents arrows 2 free FALSE values 1 0 mxData cov demoOneFactor type cov numObs 500 factorFit mxRun factorModel summary factorFit parameters mxStandardizeRAMpaths model factorFit SE FALSE Likelihood ratio test of variable x1 s factor loading
195. mentary Educational Monograph no 48 Chicago University of Chicago Press Joreskog K G 1969 A general approach to confirmatory maximum likelihood factor analysis Psychometrika 34 183 202 Examples data HS ability data str HS ability data levels HS ability data school plot flags flagssub data HS ability data 28 imxCheckMatrices imxAddDependency Add a dependency Description The dependency tracking system ensures that algebra and fitfunctions are not recomputed if their inputs have not changed Dependency information is computed prior to handing the model off to the optimizer to reduce overhead during optimization Usage imxAddDependency source sink dependencies Arguments source a character vector of the names of the computation sources inputs sink the name of the computation sink output dependencies the dependency graph Details Each free parameter keeps track of all the objects that store that free parameter and the transitive closure of all algebras and fit functions that depend on that free parameter Similarly each definition variable keeps track of all the objects that store that free parameter and the transitive closure of all the algebras and fit functions that depend on that free parameter At each iteration of the optimiza tion when the free parameter values are updated all of the dependencies of that free parameter are marked as dirty see omxFitFunction repopulateFun After an alg
196. meters is Acov 0 U WU with U indicating the transpode of U Value A named list with components SE The standard errors of the free parameters Cov The full covariance matrix of the free parameters The square root of the diagonal elements of Cov equals SE Jac The Jacobian computed to obtain the standard errors 58 Jointdata References M W Browne 1984 Asymptotically Distribution Free Methods for the Analysis of Covariance Structures British Journal of Mathematical and Statistical Psychology 37 62 83 F Yang Wallentin K G J reskog amp H Luo 2010 Confirmatory Factor Analysis of Ordinal Variables with Misspecified Models Structural Equation Modeling 17 392 423 jointdata Joint Ordinal and continuous variables to be modeled together Description Data set used in some of OpenMx s examples Usage data jointdata Format A data frame with 250 observations on the following variables z1 Continuous variable Z2 Ordinal variable with 2 levels 0 1 z3 Continuous variable z4 Ordinal variable with 4 levels 0 1 2 3 z5 Ordinal variable with 3 levels 0 1 3 Details Data generated to test the joint ML algorithm thoroughly Source Simulated References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation Examples data jointdata par mfrow c 2 3 h lapply jointdata hist par mfrow c 1 1 plot z2 z1 jointdata l
197. mit This has no impact on the parameter estimates themselves but may indicate a problem with the referenced confidence limit Model non convergence for a particular confidence limit may indicate parameter interdependence or the influence of a parameter boundary These error messages and their meanings are listed in the help for mxSummary The validity of a confidence limit can be checked by running a model with the appropriate parameter fixed at the confidence limit in question If the confidence limit is valid the 2 log likelihoods of these two models should differ by the specified chi squared criterion as set using the lowerdelta or upperdelta slots in the MxCI object you can choose which of these to set via the type parameter of mxCI Value Returns a new MxCI object If used as an argument in an MxModel object the parameters MxMa trices and MxAlgebras listed in the reference argument must also be included prior to optimization References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation Addi tional support for mxCI can be found on the OpenMx wiki at http openmx psyc virginia edu wiki See Also MXxCI for the S4 class created by mxCI mxComputeConfidenceInterval is the internal compute plan that implements the algorithm MxMatrix and mxMatrix for free parameter specification More information about the OpenMx package may be found here Examples library OpenMx generate
198. mization on the top level model 190 mxRun Usage mxRun model intervals NULL silent FALSE suppressWarnings FALSE unsafe FALSE checkpoint FALSE useSocket FALSE onlyFrontend FALSE useOptimizer TRUE Arguments model MxModel object to be optimized Not used Forces remaining arguments to be specified by name intervals A boolean indicating whether to compute the specified confidence intervals silent A boolean indicating whether to print status to terminal suppressWarnings A boolean indicating whether to suppress warnings unsafe A boolean indicating whether to ignore errors checkpoint A boolean indicating whether to periodically write parameter values to a file useSocket A boolean indicating whether to periodically write parameter values to a socket onlyFrontend A boolean indicating whether to run only front end model transformations useOptimizer A boolean indicating whether to run only the log likelihood of the current free parameter values but not move any of the free parameters Details The mxRun function is used to optimize free parameters in MxModel objects based on an expec tation function and fit function MxModel objects included in the mxRun function must include an appropriate expectation and fit functions If the silent flag is TRUE then model execution will not print any status messages to the terminal If the suppressWarnings flag is TRUE then model execution will not issu
199. model One potentially important limitation of the mxRefModels function is for behavioral genetics models If variables x y and Z are measured on twins 1 and 2 creating the modeled variables x1 y1 ZU x2 y27 722 then this function may not create the intended saturated or independence mod els In particular the means of x1 and x are estimated separately Similarly the covariance of 242 omxSelectRowsAndCols x1 with yl and x2 with y2 are allowed be be distinct cov x1 y1 covz2 y2 Moreover the cross twin covariances are estimated e g cov x1 y2 Another potential misuse of this function is for models with definition variables If definition vari ables are used the saturated and independence model may not be correct because they do not account for the definition variables When an MxModel has been run some effort is made to make the reference models for only the variables used in the model For covariance data all variables are modeled by default For raw data when the model has been run only the modeled variables are used in the reference models This matches the behavior of mxModel In general it is best practice to give mxRefModels a model that has already been run For IFA models mxExpectationBA81 the independence model preserves equality constraints among item parameters from the original model References The OpenMx User s guide can be found at ht
200. model If a model is not independent independent FALSE then this model shares parameters with one or more other models such that these models must be jointly estimated These dependent models must be entered as submodels of another MxModel objects so that they are simultaneously optimized The options slot contains a list of options for the optimizer The name of each entry in the list is the option name to be passed to the optimizer The values in this list are the values of the optimizer options The standard interface for updating options is through the mxOption function The output slot contains a list of output added to the model by the mxRun function Output includes parameter estimates optimization information model fit and other information as dictated by the objective function If a model has not been optimized using the mxRun function the output slot will be NULL Named entities in MxModel objects may be viewed and referenced by name using the symbol For instance for an MxModel named yourModel containing an MxMatrix named yourMatrix the contents of yourMatrix can be accessed as yourModel yourMatrix Slots i e matrices algebras etc in an mxMatrix may also be referenced with the symbol e g yourModel matrices or yourModel algebras See the documentation for Classes and the examples in mxModel for more information References The OpenMx User s guide can be found at http openmx psyc virginia edu d
201. mp L U name R mxExpectationNormal covariance R dimnames manifestVars mxFitFunctionML mxData observed cov demoOneFactor type cov numObs 500 Get all free parameters params omxGetParameters factorModel lbound lt omxGetParameters factorModel fetch lbound Set new values for these params saving them in a new model newFactorModel omxSetParameters factorModel names params values 1 10 Read out the values from the new model newParams omxGetParameters newFactorModel omxGetRAMDepth omxGetRAMDepth Description Get the potency of a matrix for inversion speed up Usage omxGetRAMDepth A maxdepth nrow A 1 Arguments A MxMatrix object maxdepth Numeric maximum depth to check Details This function is used internally by the mxExpectationRAM function to determine how far to expand I A T I A A Itis similarly used by mxExpectationLISREL in expanding I B I B B B In many situations A is a zero matrix nilpotent of order 2 So when A has large dimension it is much faster to compute J A than A 1 omxGraphviz 231 omxGraphviz Show RAM Model in Graphviz Format Description The function accepts a RAM style model and outputs a visual representation of the model in Graphviz format The function will output either to a file or to the console The recommended file extension for an output file is dot Usage omxGr
202. mputation a vector of expectation or fit function names what what to compute default is nothing how to compute it optional Not used Forces remaining arguments to be specified by name freeSet names of matrices containing free variables verbose the level of debugging output is bestfit do not use for backward compatibility Details The information matrix is only valid when parameters are at the maximum likelihood estimate The information matrix is returned in model output hessian You cannot request both the information matrix and the Hessian The information matrix is invarient to the sign of the log likelihood scale whereas the Hessian is not Use the how parameter to specify which approximation to use one of default hessian sandwich bread and meat 90 mxComputeSequence Examples data demoOneFactor factorModel lt mxModel name One Factor mxMatrix type Full nrow 5 ncol 1 free TRUE values 0 2 name A mxMatrix type Symm nrow 1 ncol 1 free FALSE values 1 name z L mxMatrix type Diag nrow 5 ncol 5 free TRUE values 1 name U mxAlgebra expression A L t A U name R mxFitFunctionML mxExpectationNormal covariance R dimnames names demoOneFactor mxData observed cov demoOneFactor type cov numObs 500 mxComputeOnce fitfunction fit factorModelFit mxRun factorModel factorModelFit output fit 972 15 mxComputeReportDeriv Report derivatives D
203. mula This formula is equivalent to the formula for the Kalman updated scores in a state space model with zero dynamics Priestly amp Subba Rao 1975 Thus to compute the regression factor scores the appropriate state space model is set up and the mxKalmanScores function is used to produce the factor scores and their standard errors Value An array with dimensions Number of Rows of Data Number of Latent Variables 2 The third dimension has the scores in the first slot and the standard errors in the second slot References Estabrook R amp Neale M C 2013 A Comparison of Factor Score Estimation Methods in the Presence of Missing Data Reliability and an Application to Nicotine Dependence Multivariate Behavioral Research 48 1 27 Priestley M amp Subba Rao T 1975 The estimation of factor scores and Kalman filtering for discrete parameter stationary processes International Journal of Control 21 971 975 The OpenMx User s guide can be found at http openmx psyc virginia edu documentation See Also mxKalmanScores Examples Create and estimate a factor model require OpenMx data demoOneFactor manifests lt names demoOneFactor latents lt c G mxFIML Objective 131 factorModel lt mxModel OneFactor type LISREL manifestVars list exo manifests latentVars list exo latents mxPath from latents to manifests mxPath from manifests arrows 2 mxPath from latents arrows 2 free
204. mxExpectationBA81 103 print MxExpectationLISREL method mxExpectationLISREL 108 print MxExpectationNormal method mxExpectationNormal 112 print MxExpectationRAM method mxExpectationRAM 115 print MxExpectationStateSpace method mxExpectationStateSpace 117 print MxFitFunctionAlgebra method mxFitFunctionAlgebra 134 print MxFitFunctionML method mxFitFunctionML 138 print MxFitFunctionR method mxFitFunctionR 142 print MxFitFunctionRow method mxFitFunctionRow 144 print MxFitFunctionWLS method mxFitFunctionWLS 146 print MxFlatModel method MxFlatModel class 147 print MxInterval method MxInterval class 153 print MxMatrix method MxMatrix class 162 print MxModel method MxModel class 17 print MxNonNullData method MxData class 96 print MxPath method mxPath 177 print MxThreshold method mxThreshold 196 read table 85 191 rvectorize 11 63 247 251 255 257 sapply 240 SdiagMatrix class MxMatrix class 162 INDEX sfApply 216 sfLapply 231 sfSapply 240 show BaseCompute method BaseCompute class 9 show MxAlgebra method MxAlgebra class 65 show MxAlgebraFormula method MxAlgebraFormula class 66 show MxConstraint method mxConstraint 91 show MxDataDynamic method mxDataDynamic 98 show MxDataStatic method MxDataStatic class 98 show MxExpectationBA81 method mxExpectationBA81 103 show MxExpectationLISREL method mxExpectationLISREL 108 sh
205. mxTryHard 198 mxTypes 769 200 mxVersion 200 myAutoregressiveData 201 myFADataRaw 202 myGrowthKnownClassData 203 204 myGrowthMixtureData 203 204 myLongitudinalData 205 myRegData 206 207 myRegDataRaw 207 265 myTwinData 208 253 mzfData 209 mzmData 210 Named entities 70 173 named entity 65 77 93 96 162 171 Named entities Named entity 212 named entities 69 named entities Named entity 212 Named entity 212 named entity Named entity 212 names 240 names MxFlatModel method MxF latModel class 147 names MxMatrix method MxMatrix class 162 names MxModel method MxModel class 171 ncol MxMatrix method MxMatrix class 162 nrow MxMatrix method MxMatrix class 162 nuclear_twin_design_data 212 NULL 96 numHess1 213 numHess2 214 omxAllInt 64 214 omxAnd 64 omxAnd omxLogi cal 233 omxApply 216 232 240 omxApproxEquals 64 omxApproxEquals omxLogical 233 omxAssignFirstParameters 217 229 232 243 244 omxBrownie 218 omxCbind omxMatrixOperations 234 omxCheckCloseEnough 219 220 222 224 226 omxCheckEquals 219 220 221 222 224 226 omxCheckError 221 225 omxCheckIdentical 279 221 222 224 226 omxCheckNamespace 223 omxCheckSetEquals 279 222 223 224 226 omxCheckTrue 2 9 222 224 224 225 226 omxCheckWarning 221 225 omxCheckWi thinPercentError 219 222 224 225 226 266 omxConstrainMLThres
206. mxVerifyMatrix 55 imxVerifyMatrix ZeroMatrix method imxVerifyMatrix 55 imxVerifyModel 55 imxVerifyModel MxLISRELModel method imxVerifyModel 55 imxVerifyModel MxModel method imxVerifyModel 55 imxVerifyModel MxRAMModel method imxVerifyModel 55 imxVerifyName 55 imxVerifyReference 56 imxWlsChiSquare 56 imxWlsStandardErrors 57 jointdata 58 lapply 231 latentMultipleRegExample1 59 60 latentMultipleRegExample2 60 length MxMatrix method MxMatrix class 162 logm 61 64 LowerMatrix class MxMatrix class 162 make names 159 make unique 759 matrix 95 97 100 Mod 19 multiDatal 61 MxAlgebra 62 64 67 66 72 91 92 95 97 104 106 110 113 116 118 120 123 125 126 132 134 137 145 156 163 167 172 173 182 188 212 MxAlgebra MxAlgebra class 65 INDEX mxAlgebra 62 65 68 95 97 102 135 140 162 163 169 245 MxAlgebra class 65 MxAlgebraFormula MxAlgebraFormula class 66 MxAlgebraFormula class 66 mxAlgebraFromString 66 mxAlgebraObjective 67 169 MxAlgebras 76 77 172 mxAvailableOptimizers 69 MxBaseExpectation class 69 MxBaseFitFunction class 70 MxBaseNamed MxBaseNamed class 70 MxBaseNamed class 70 MxBaseObjectiveMetaData MxBaseObjectiveMetaData class 70 MxBaseObjectiveMetaData class 70 MxBounds 68 7 110 113 116 120 125 132 134 158 167 173 182 MxBounds MxBounds class 72 mxBounds 71 72 162 169 245 MxBounds cla
207. n be found at http openmx psyc virginia edu documentation See Also MxAlgebra for the S4 class created by mxAlgebra mxFitFunctionAlgebra for an objective function which takes an MxAlgebra or MxMatrix object as the function to be minimized MxMatrix and mxMatrix for objects which may be entered in the expression argument and the function that creates them More information about the OpenMx package may be found here Examples A lt mxMatrix Full nrow 3 ncol 3 values 2 name A Simple example algebra B simply evaluates to the matrix A B lt mxAlgebra A name B Compute B C mxAlgebra A B name C MxAlgebra class 65 Compute sin C D lt mxAlgebra sin C name D Make a model and evaluate the mxAlgebra object D A lt mxMatrix Full nrow 3 ncol 3 values 2 name A model lt mxModel model AlgebraExample A B C D fit lt mxRun model mxEval D fit Numbers in mxAlgebras are upgraded to 1x1 matrices Example of Kronecker powering and multiplication A lt mxMatrix type Full nrow 3 ncol 3 value c 1 9 name A m1 lt mxModel model kron A mxAlgebra A 2 name KroneckerPower mxRun m1 KroneckerPower Running kron mxAlgebra KroneckerPower formula A 2 result E1 E 2T 0 33 1 1 16 49 2 4 25 64 F353 9 36 81 dk db db MxAlgebra class MxAlgebra Class Description MxAlgebra
208. n is met In addition the forward and backward differ ence estimates of the gradient are compared for symmetry When sufficient asymmetry is detected the standard error is flagged In the case profile likelihood confidence intervals should be used for inference instead of standard errors see mnxComputeConf idenceInterval Examples library OpenMx data demoOneFactor factorModel lt mxModel name One Factor mxMatrix type Full nrow ncol 1 free FALSE values mxMatrix type Symm nrow 1 ncol 1 free FALSE values mxMatrix type Diag nrow ncol 5 free TRUE values 2 name A 1 name L 1 name U I mxComputeOnce 89 mxAlgebra A L t A U name R mxExpectationNormal covariance R dimnames names demoOneFactor mxFitFunctionML mxData cov demoOneFactor type cov numObs 500 mxComputeSequence list mxComputeNumericDeriv mxComputeReportDeriv factorModelFit mxRun factorModel factorModelFit output hessian mxComputeOnce Compute something once Description Some models are optimized for a sparse Hessian Therefore it can be much more efficient to compute the inverse Hessian in comparison to computing the Hessian and then inverting it Usage mxComputeOnce from what nothing how NULL lt j freeSet NA_character_ verbose L is bestfit FALSE Arguments from the object to perform the co
209. n row likelihoods even though the fit function value is still 1x1 Multiple groupd fit function sums the model likelihoods from its component models mgFitFun lt mxFitFunctionMultigroup c glmodel g2model Define the models ml lt mxModel model gimodel M S1 A I expect fitFunction mxData observed ds1 type raw m2 mxModel model g2model M S2 A I expect fitFunction mxData observed ds2 type raw mg mxModel model multipleGroup m1 m2 mgFitFun Fit the model and print a summary mgOut mxRun mg Look at summary of model summary mgOut Examine fit function results fitResOnly lt mxEval fitfunction mgOut glFit lt mxEval gimodel fitfunction mgOut g2Fit mxEval g2model fitfunction mgOut Look at the row likelihoods alone glRowLike attr glFit likelihoods g2RowLike attr g2Fit likelihoods mxFitFunctionR Create MxFitFunctionR Object Description mxFitFunctionR returns an MxFitFunctionR object mxFitFunctionR 143 Usage mxFitFunctionR fitfun units 21nL Arguments fitfun A function that accepts two arguments The initial state information to the objective function units optional The units of the fit statistic Details The mxFitFunctionR function evaluates a user defined R function called the fitfun mxFitFunc tionR is useful in defining new mxFitFunctions since any calculation that can be perfo
210. n that generates the warning and the mes sage that is supposed to be generated respectively References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation See Also omxCheckError omxCheckWithinPercentError omxCheckIdentical omxCheckSetEquals omxCheckTrue omxCheckEquals Examples msg lt paste Objective functions like mxFIMLObjective have been deprecated in favor of expectation and fit functions Wn Please use mxExpectationNormal covariance means instead and add a call to mxFitFunctionML See examples at help mxExpectationNormal foo omxCheckWarning mxFIMLObjective cov mean msg 226 omxCheck WithinPercentError omxCheckWithinPercentError Approximate Percent Equality Testing Function Description This function tests whether two numeric vectors or matrixes are approximately equal to one another within a specified percentage Usage omxCheckWithinPercentError a b percent 0 1 Arguments a a numeric vector or matrix b a numeric vector or matrix percent a non negative percentage Details Arguments a and b must be of the same type ie they must be either vectors of equal dimension or matrices of equal dimension The two arguments are compared element wise for approximate equality If the absolute value of the difference of any two values is greater than the percentage difference of a then an error will be thrown
211. nal of Business Research 58 935 43 Examples library OpenMx data demoOneFactor load the demoOneFactor dataframe manifests lt names demoOneFactor set the manifest to the 5 demo variables latents lt c G define 1 latent variable model lt mxModel model One Factor type RAM manifestVars manifests latentVars latents mxPath from latents to manifests labels paste b 1 5 sep mxPath from manifests arrows 2 labels paste u 1 5 sep mxPath from latents arrows 2 free FALSE values 1 0 mxData cov demoOneFactor type cov numObs 500 model lt mxRun model Run the model returning the result into model Show summary of the fitted model summary model Compute the summary and store in the variable statistics statistics summary model Access components of the summary statistics parameters statistics SaturatedLikelihood Specify a saturated likelihood for testing summary model SaturatedLikelihood 3000 Add a CI and view it in the summary model mxRun mxModel model model mxCI b5 intervals TRUE summary model tr trace Description This function returns the trace of an n by n square matrix x defined to be the sum of the elements on the main diagonal the diagonal from the upper left to the lower right Usage tr x Arguments x an input matrix Must be square Details The input matrix must be squa
212. nd here Examples showClass MxExpectationGREML 108 mxExpectationLISREL mxExpectationLISREL Create MxExpectationLISREL Object Description This function creates a new MxExpectationLISREL object Usage mxExpectationLISREL LX NA LY NA BE NA GA NA PH NA PS NA TD NA TE NA TH NA TX NA TY NA KA NA AL NA dimnames NA thresholds NA threshnames dimnames Arguments LX An optional character string indicating the name of LX matrix LY An optional character string indicating the name of the LY matrix BE An optional character string indicating the name of the BE matrix GA An optional character string indicating the name of the GA matrix PH An optional character string indicating the name of the PH matrix PS An optional character string indicating the name of the PS matrix TD An optional character string indicating the name of the TD matrix TE An optional character string indicating the name of TE matrix TH An optional character string indicating the name of the TH matrix TX An optional character string indicating name of the X matrix TY An optional character string indicating name of the TY matrix KA An optional character string indicating the name of the KA matrix AL An optional character string indicating the name of the AL matrix dimnames An optional character vector that is currently ignored thresholds An optional character string
213. nd numeric vector The upper bounds of free parameters Details The mxPath function creates MxThreshold objects These consist of a list of ordinal variables and the thresholds that define the relationship between the observed ordinal variable and the continuous latent variable assumed to underly it This function directly mirrors the usage of mxPath but is used to specify thresholds rather than means variances and bivariate relationships The vars argument specifies which variables you wish to specify thresholds for Variables are referenced by name and these names must appear in the manifestVar argument of the mxModel mx Threshold 197 function if thresholds are to be correctly processed Additionally variables for which thresholds are specified must be specified as ordinal factors in whatever data is included in the model The nThresh argument specifies how many thresholds are to be specified for the variable or vari ables included in the vars argument The number of thresholds for a particular variable should be one fewer than the number of categories specified for that variable The free argument specifies whether the thresholds created by the mxThreshold function are free or fixed parameters This argument may take either TRUE for free parameters FALSE for fixed parameters or a vector of TRUEs and FALSEs to be applied in order to the created thresholds The values is a numeric vectors containing the starti
214. new MxBounds object Usage mxBounds parameters min NA max NA Arguments parameters A character vector indicating the names of the parameters on which to apply bounds min A numeric value for the lower bound NA means use default value max A numeric value for the upper bound NA means use default value Details Creates a set of boundaries or limits for a parameter or set of parameters Parameters may be any free parameter or parameters from an MxMatrix object Parameters may be referenced either by name or by referring to their position in the spec matrix of an MxMatrix object Minima and maxima may be specified as scalar numeric values Value Returns a new MxBounds object If used as an argument in an MxModel object the parameters referenced in the parameters argument must also be included prior to optimization References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation See Also MxBounds for the S4 class created by mxBounds MxMatrix and mxMatrix for free parameter specification More information about the OpenMx package may be found here Examples Create lower and upper bounds for parameters A and B bounds mxBounds c A B 3 5 Create a lower bound of zero for a set of variance parameters varianceBounds lt mxBounds c Var1 Var2 Var3 0 72 MxCharOrList class MxBounds class MxBounds Class Description MxBounds is an S4 class
215. ng values of the created thresholds values gives a starting value for estimation The labels argument specifies the names of the parameters in the resulting MxThreshold object The Ibound and ubound arguments specify lower and upper bounds for the created threshold parameters Thresholds for multiple variables may be specified simultaneously by including a vector of variable names to the vars argument When multiple variables are included in the vars argument the length of the vars argument must be evenly divisable by the length of the nThresh argument All subsequent arguments free through ubound should have their lengths a factor of the total number of thresholds specified for all variables If four variables are included in the vars argument then the nThresh argument should contain ei ther one two or four elements If the nThresh argument specifies two thresholds for each variable then free values and all subsequent arguments should specify eight values by including one two four or eight elements Whenever fewer values are specified than are required e g specify two values for eight thresholds then the entire vector of values is repeated until the required num ber of values is reached and will return an error if the correct number of values cannot be achieved by repeating the entire vector Value Returns a list of thresholds References T
216. nifest covariate variable 7 to the observed variable in row 7 The D matrix is sometimes called the feedthrough or feedforward matrix The Q argument refers to the Q matrix in the State Space approach This matrix gives the covari ance of the dynamic noise The dynamic noise can be thought of as unmeasured covariate inputs active at all times This matrix must be symmetric diagonal or zero As a special case it is often diagonal The Q matrix is the covariance of the process noise Just as in factor analysis and general mxExpectationStateSpaceContinuous Time 125 structural equation modeling the scale of the latent variables is usually set by fixing some factor loadings in the C matrix or fixing some factor variances the Q matrix The R argument refers to the R matrix in the State Space approach This matrix consists of residual covariances among the observed manifest variables This matrix must be symmetric As a special case it is often diagonal The R matrix is the covariance of the observation noise The x0 argument refers to the zo matrix in the State Space approach This matrix consists of the column vector of the initial values for the latent variables The state space expectation uses the zo matrix as the starting point to recursively estimate the latent variables values at each time These starting values can be difficult to pick however for sufficiently long time series they often do not greatly impact the es
217. nous data at the thresholds into an ordered factor For state space models i e models with an mxExpectationStateSpace expectation the data are generated based on the autoregressive structure of the model The rows of data in a state space model are not independent replicates of a stationary process Rather they are the result of a latent possibly non stationary autoregressive process For state space models different rows of data often correspond to different times Value A matrix or data frame with nrows rows References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation mxGenerateData 149 Examples Create data based on state space model require OpenMx nvar lt 5 varnames lt paste x 1 nvar ssModel lt mxModel model State Space Manual Example mxMatrix Full 1 1 TRUE 3 name A mxMatrix Zero 1 1 namez B mxMatrix Full nvar 1 TRUE 6 name C dimnames list varnames F1 mxMatrix Zero nvar 1 name D mxMatrix Diag 1 1 FALSE 1 name Q mxMatrix Diag nvar nvar TRUE 2 name R mxMatrix Zero 1 1 name x0 mxMatrix Diag 1 1 FALSE 1 name PQ mxMatrix Zero 1 1 name u mxExpectationStateSpace A B C D Q xg pg mxFitFunctionML ssData lt mxGenerateData ssModel 200 200 time points Add simulated data to model ssModel mxModel ssM
218. o along the diagonal if x is symmetric Note that very few vectors have the correct number of elements to construct a symmetric matrix For example vectors with 1 3 6 10 and 15 elements can be used to make a symmetric matrix but none of the other numbers between 1 and 15 can An error is thrown if the number of elements in x cannot be used to make a symmetric matrix See Also vech2full vech vechs rvectorize cvectorize 258 vechs2full Examples vechs2full 1 10 matrix 1 16 4 4 vechs matrix 1 16 4 4 vechs2full vechs matrix 1 16 4 4 Index Classes MxExpectationGREML class 106 MxFitFunctionGREML class 136 MxMatrix class 162 Topic datasets Bollen 10 demoOneFactor 11 demoTwoFactor 12 dzfData 14 dzmData 16 dzoData 17 1 1 20 example2 21 factorExamplel 22 factorScaleExamplel 23 factorScaleExample2 24 HS ability data 26 imxConstraintRelations 29 imxDataTypes 32 imxModelTypes 44 imxReservedNames 49 imxSeparatorChar 50 imxVariableTypes 54 jointdata 58 latentMultipleRegExample1 59 latentMultipleRegExample2 60 multiDatal 61 myAutoregressiveData 201 myFADataRaw 202 myGrowthKnownClassData 203 myGrowthMixtureData 204 myLongitudinalData 205 myRegData 206 myRegDataRaw 207 myTwinData 208 mzfData 209 mzmData 210 nuclear twin design data 212 numHess1 213 259 numHess2 214 omxSymbolTable 244 ordinalTwinData 246 twin NA
219. obian is evaluated numerically and generally takes a few seconds but much less than a minute The identification may not be accurate for model where definition variables are used Currently only the first row of the definition variable is evaluated When TRUE the details argument provides the names of the non identified parameters Other wise only the status and Jacobian are returned 74 mxChecklIdentification Value A named list with components status logical TRUE if the model is locally identified otherwise FALSE jacobian matrix The numerically evaluated Jacobian non identified parameters vector The free parameter names that are not identified References Bekker P A Merckens A Wansbeek T J 1994 Identification Equivalent Models and Com puter Algebra Academic Press Orlando FL Bollen K A amp Bauldry S 2010 Model Identification and Computer Algebra Sociological Methods amp Research 39 p 127 156 See Also mxModel Examples require OpenMx data demoOneFactor manifests names demoOneFactor latents lt G1 model2 lt mxModel model One Factor type RAM manifestVars manifests latentVars latents mxPath from latents 1 to manifests 1 5 mxPath from manifests arrows 2 lbound 1e 6 mxPath from latents arrows 2 free FALSE values 1 0 mxData cov demoOneFactor type cov numObs 500 fit2 mxRun model2 id2 mxCheckIdentificat
220. ocumentation See Also mxModel for creating MxModel objects More information about the OpenMx package may be found here 174 mxOption mxOption Set or Clear an Optimizer Option Description The function sets shows or clears an option that is specific to the optimizer in the back end Usage mxOption model key value reset FALSE Arguments model An MxModel object or NULL key The name of the option value The value of the option reset If TRUE then reset all options to their defaults Details mxOption is used to set clear or query an option given in the key argument in the back end optimizer Valid option keys are listed below Use value NULL to remove an existing option Leaving value blank will return the current value of the option specified by key To reset all options to their default values use reset TRUE When reset TRUE key and value are ignored If the model argument is set to NULL the default optimizer option i e those applying to all models by default will be set To see the defaults use getOption mxOptions Before the model is submitted to the back end all keys and values are converted into strings using the as character function The maximum number of major iterations the option Major iterations for optimization for NPSOL can be specified either by using a numeric value such as 50 1000 etc or by specify ing a user defined functi
221. odel mxData ssData raw Fit model to simulated data ssRun mxRun ssModel Compare parameters estimated from random data to their true generating values cbind Rand omxGetParameters ssRun Gen omxGetParameters ssModel Note the parameters should be close up to sampling error to the generating values require OpenMx manifests lt paste x 1 5 latents c G factorModel mxModel One Factor type RAM manifestVars manifests latentVars latents mxPath from latents to manifests values 8 mxPath from manifests arrows 2 values 2 mxPath from latents arrows 2 free FALSE values 1 0 mxPath from one to manifests factorData lt mxGenerateData factorModel 100 150 mxGetExpected factorModel lt mxModel factorModel mxData factorData raw factorRun lt mxRun factorModel cbind Rand omxGetParameters factorRun Gen omxGetParameters factorMode1 mxGetExpected Extract the component from a model s expectation Description This function extracts the expected means covariance or thresholds from a model Usage mxGetExpected model component imxGetExpectationComponent model component Arguments model MxModel object from which to extract the expectation component component A character The name of the component to extract Details The expected means covariance or thresholds can be extracted from Normal mxExpectationNor mal RAM mxE
222. odel since it identifies which matrices in the model have been assigned the roles of A and S in the mxExpectationRAM statement Note that in models of type RAM the necessary matrices and expectation statement are automatically assembled from the mxPath objects If model contains any submodels with independent TRUE that use RAM expectation mxStandardizeRAMpaths automatically applies itself recursively over those submodels Use of SE TRUE requires that package numDeriv be installed It also requires that model contain no mxConstraint statements and have a nonempty hessian element in its output slot There are three common reasons why the latter condition may not be met First the model may not have been run yet i e it was not output by mxRun Second mxOption Hessian might be set to No Third computing the Hessian matrix might possibly have been skipped per a user defined mxComputex statement if any are present in the model If model contains RAM expectation submodels with independent TRUE these conditions are checked separately for each such submodel In any event using these standard errors for hypothesis testing or forming confidence intervals is not generally advised Instead it is considered best practice to conduct likelihood ratio tests or compute likelihood based confidence intervals from mxCI as in examples below The user should note that mxStandardizeRAMpaths only cares whether an element of A or S is nonzero
223. odel object data frame or matrix run logical If TRUE runs the models before returning otherwise returns built mod els without running Details For typical structural equation models the saturated model is the free est possible model All covari ances and when possilbe all means are estimated In the case of ordinal data the ordinal means are fixed to zero and the thresholds are estimated When the ordinal data are binary those vari ances are also constrained to one This is the free est possible model only constrained for model identification The saturated model is used to create the RMSEA and Chi squared fit indices The independence model sometimes called the null model is a model of each variable being com pletely independent of every other variable As such all the variances and when possible all means are estimated However covariances are set to zero Ordinal variables are handled the same for the independence and saturated models The independence model is used along with the saturated model to create CFI and TLI fit indices When the mxFitFunctionMultigroup fit function is used mxRefModels creates the appropriate multigroup saturated and independence models Saturated and independence models are created separately for each group Each group has its own saturated and independence model The multi group saturated model is a multigroup model where each group has its own saturated model and similarly for the independence
224. on Description OpenMx is a package for structural equation modeling matrix algebra optimization and other sta tistical estimation problems Try the example below We try and have useful help files for instance help mxRun to learn more Also the reference manual Details OpenMXx solves algebra optimization and statistical estimation problems using matrix algebra Most users use it for Structural equation modeling The core function is mxModel which makes a model Models are containers for data matrices mxPaths algebras bounds and constraints Models most often have an expectation function e g mxExpectationNormal to calculate the expectations for the model Models need a fit function Several of these are built in e g mxFitFunctionML OpenMx also allows user defined fit func tions for purposes not covered by the built in functions e g mxFitFunctionR or mxFitFunction Algebra Once built the resulting mxModel can be run i e optimized using mxRun This returns the fitted model You can see the resulting parameter estimates algebra evaluation etc using summary yourModel The user s manual is online see reference below but functions mxRun mxModel mxMatrix all have working examples to get you started as well The main OpenMx functions are mxAlgebra mxBounds mxCI mxConstraint mxData mxMa trix mxModel and mxPath Expectation functions include mxExpectationNormal mxExpectationRAM mxExpectationLISREL
225. on c fit gradient hessian ihessian freeSet c Ve mxComputeStandardError freeSet c Ve mxComputeReportDeriv freeSet c Ve 2 testmod mxModel GREMLtest mxData observed dat type raw mxMatrix type Full nrow 1 ncol 1 free TRUE values 1 labels ve lbound 0 0001 name Ve mxMatrix Iden nrow z100 namez I condenseSlots TRUE mxAlgebra I x Ve name V ge gff plan str testmod MxExpectationGREML class Class MxExpectationGREML Description MxExpectationGREML is a type of expectation class It contains the necessary elements for speci fying a GREML model For more information see mxExpectationGREML Objects from the Class Objects can be created by calls of the form mxExpectationGREML V yvars Xvars addOnes blockByPheno Slots V Object of class MxCharOrNumber Identifies the MxAlgebra or MxMatrix to serve as the V matrix yvars Character vector Each string names a column of the raw dataset to be used as a pheno types Xvars A list of data column names specifying the covariates to be used with each phenotype addOnes Logical pertains to data handling at runtime blockByPheno Logical pertains to data handling at runtime staggerZeroes Logical pertains to data handling at runtime dataset is yX Logical pertains to data handling at runtime y Object of class MxData Its observed slot will contain the phenotype vector y
226. on The user defined function should accept two arguments as input the number of parameters and the number of constraints and return a numeric value as output OpenMx options Number of Threads 1 the number of processor cores to use Use detectCores to find how many are Calculate Hessian Yes No calculate the Hessian explicitly after optimization Standard Errors Yes No return standard error estimates from the explicitly calculate hessian Default optimizer NPSOL SLSQP the gradient descent optimizer to use Number of Threads 011121 1101 number of threads used for optimization This is how parallelism works Default Feasibility tolerance r the maximum acceptable absolute violations in linear and nonlinear constraints Optimality tolerance r the maximum acceptable difference in fit mxOption 175 Gradient algorithm see list finite difference method either forward or central Gradient iterations 1 4 the number of Richardson extrapolation iterations SLSQP is our new experimental optimizer NPSOL specific options Nolist this option suppresses printing of the options Print level the value of i controls the amount of printout produced by the major iterations Minor print level the value of i controls the amount of printout produced by the minor iterations Print file for i gt 0 a full log is sent to the file with logical unit number i Summary file for i gt 0 a brief log will be output to file 7 Function precision a me
227. ormal covariance expCov means M dimnames tmpNames Choose a fit function fitFunction mxFitFunctionML Define the model tmpModel mxModel model exampleModel M S A I expCov expFunction fitFunction mxData observed tmpFrame type raw Fit the model and print a summary tmpModelOut mxRun tmpModel summary tmpModelOut MxFitFunction class MxFitFunction Description This is an internal class and should not be used directly 134 mxFitFunctionAlgebra mxFitFunctionAlgebra Create MxFitFunctionAlgebra Object Description mxFitFunctionAlgebra returns an MxFitFunctionAlgebra object Usage mxFitFunctionAlgebra algebra numObs NA numStats NA gradient NA_character_ hessian NA_character_ verbose OL units 21nL Arguments algebra A character string indicating the name of an MxAlgebra or MxMatrix object to use for optimization numObs optional An adjustment to the total number of observations in the model numStats optional An adjustment to the total number of observed statistics in the model Not used Forces remaining arguments to be specified by name gradient optional A character string indicating the name of an MxAlgebra object hessian optional A character string indicating the name of an MxAlgebra object verbose optional An integer to increase the level of runtime log output units optional The units of the fit statistic Details If you want to fit a
228. ostic information to standard error This func tion should not be called from R We make it available only for testing Usage imxLog str Arguments str the character string to output imxLookupSymbolTable imxLookupSymbolTable Description This is an internal function exported for those people who know what they are doing Usage imxLookupSymbolTable name Arguments name name 44 imxModelTypes imxModelBuilder imxModelBuilder Description This is an internal function exported for those people who know what they are doing Usage imxModelBuilder model lst name manifestVars latentVars submodels remove independent Arguments model model Ist Ist name name manifestVars manifestVars latentVars latent Vars submodels submodels remove remove independent independent Details TODO It probably makes sense to split this into separate methods For example modelAddVari ables and modelRemove Variables could be their own methods This would reduce some cut amp paste duplication imxModelTypes imxModelTypes Description A list of supported model types Usage imxModelTypes Format listQ imxMpiWrap 45 imxMpiWrap imxMpiWrap Description This is an internal function exported for those people who know what they are doing Usage imxMpiWrap fun Arguments fun fun imxOriginalMx imxOriginalMx Description This is an internal function exported for those
229. ov numObs 100 fitFunction mxFitFunctionML Create the model fit it and print a summary tmpModel mxModel model exampleModel mLX mTD mPH expFunction fitFunction tmpData tmpModelOut mxRun tmpModel summary tmpModelOut 112 mxExpectationNormal Fit factor model with means require OpenMx data demoOneFactor nvar lt ncol demoOneFactor varnames lt colnames demoOneFactor factorMeans mxMatrix Zero 1 1 name Kappa dimnames list F1 NA xIntercepts lt mxMatrix Full nvar 1 free TRUE name TauX dimnames list varnames NA factorLoadings mxMatrix Full nvar 1 TRUE 6 name LambdaX labels paste lambda 1 nvar dimnames list varnames F1 factorCovariance lt mxMatrix Diag 1 1 FALSE 1 name Phi xResidualVariance mxMatrix Diag nvar nvar TRUE 2 name ThetaDelta labels paste theta 1 nvar liModel mxModel model LISREL Factor Model factorMeans xIntercepts factorLoadings factorCovariance xResidualVariance mxExpectationLISREL LX LambdaX PH Phi TD ThetaDelta TX TauX KA Kappa mxFitFunctionML mxData cov demoOneFactor cov means colMeans demoOneFactor numObs nrow demoOneFactor liRun mxRun liModel summary liRun mxExpectationNormal Create MxExpectationNormal Object Description This function creates an MxExpectationNormal object Usage mxEx
230. ow MxExpectationNormal method mxExpectationNormal 112 show MxExpectationRAM method mxExpectationRAM 115 show MxExpectationStateSpace method mxExpectationStateSpace 117 show MxFitFunctionAlgebra method mxFitFunctionAlgebra 134 show MxFitFunctionML method mxFitFunctionML 138 show MxFitFunctionR method mxFitFunctionR 142 show MxFitFunctionRow method mxFitFunctionRow 144 show MxFitFunctionWLS method mxFitFunctionWLS 146 show MxF latModel method MxFlatModel class 147 show MxInterval method MxInterval class 153 show MxMatrix method MxMatrix class 162 show MxModel method MxModel class 171 show MxNonNullData method MxData class 96 show MxPath method mxPath 177 show MxThreshold method mxThreshold 196 StandMatrix class MxMatrix class 162 267 summary 75 113 132 138 146 summary summary MxModel 248 summary MxModel method summary MxMode1 248 summary MxModel 248 SymmMatrix class MxMatrix class 162 tr 251 twin_NA_dot 253 twinData 251 UnitMatrix class MxMatrix class 162 vec2diag 13 14 64 254 vech 11 64 247 251 255 256 257 vech2full 64 255 255 257 vechs 11 64 247 255 256 256 257 vechs2full 64 256 257 ZeroMatrix class MxMatrix class 162
231. pace modeling is directly analogous to the measurement model in LISREL structural equation modeling Note that the covariates u have instantaneous effects on both the state and output equations If lagged effects are desired then the user must create a lagged covariate by shifting their observed variable to the desired lag The state and output equations together with some minimal assumptions and the Kalman filter imply a new expected covariance matrix and means vector for every row of data The expected covariance matrix of row t is S C AP _1A Q CT R The expected means vector of row t is fi Dui The dimnames arguments takes an optional character vector The A argument refers to the A matrix in the State Space approach This matrix consists of time regressive coefficients from the latent variable in column 7 at time t 1 to the latent variable in row i at time t Entries in the diagonal are autoregressive coefficients Entries in the off diagonal are cross lagged regressive coefficients If the A and B matrices are zero matrices then the state space model reduces to a factor analysis The A matrix is sometimes called the state transition model The B argument refers to the B matrix in the State Space approach This matrix consists of regressive coefficients from the input manifest covariate variable 7 at time t to the latent variable in row i at time t Note that the covariate effect is contemporaneous t
232. pectationNormal covariance means dimnames NA thresholds NA threshnames dimnames Arguments covariance A character string indicating the name of the expected covariance algebra means A character string indicating the name of the expected means algebra mxExpectationNormal 113 dimnames An optional character vector to be assigned to the dimnames of the covariance and means algebras thresholds An optional character string indicating the name of the thresholds matrix threshnames An optional character vector to be assigned to the column names of the thresh olds matrix Details Expectation functions define the way that model expectations are calculated The mxExpectation Normal function uses the algebra defined by the covariance and means arguments to define the expected covariance and means under the assumption of multivariate normality The covariance argument takes an MxAlgebra object which defines the expected covariance of an associated Mx Data object The means argument takes an MxAlgebra object which defines the expected means of an associated MxData object The dimnames arguments takes an optional character vector If this argument is not a single NA then this vector is used to assign the dimnames of the means vector as well as the row and columns dimnames of the covariance matrix thresholds The name of the thresholds matrix When needed for modelling ordinal data this matrix should be creat
233. pond to thresholds for subsequent variables in the covariance matrix If more variables exist in the covariance matrix than in the first threshold matrix the first column of the second threshold matrix will be used and so on That is if covariance is a 4x4 matrix and the three threshold matrices are specified one with a single column and the others with two columns each the first column of the first matrix will contain thresholds for the first variable in covariance the two columns of the second matrix will correspond to the second and third variables of covariance respectively and the first column of the third threshold matrix will correspond to the fourth variable Any extra columns will be ignored Each column in the threshold matrices must contain some number of strictly increasing thresholds delineating the boundaries of a cell of integration That is if the integral from 1 to 0 and 0 to 1 are required for a given variable the corresponding threshold column should contain the values 1 0 and 1 in that order Thresholds may be set to Inf or Inf if a boundary at positive or negative infinity is desired Within a threshold column a value of Inf if it exists is assumed to be the largest threshold and any rows after it are ignored in that column A value of NA if it exists indicates that there are no further thresholds in that column and is otherwise ignored A threshold column consisting of only Inf or NA values will cause an erro
234. present multiple observations on the same variable One example of the latter case is longitudinal data where the multiple phenotypes are repeated measures on a single phenotype Details For a monophenotype analysis only argument Xdata can be a character vector In a polypheno type analysis if the same covariates are to be used with all phenotypes then Xdata can be a list of length 1 Note the synergy between the output of mxGREMLDataHandler and arguments dataset is yX and casesToDropFromV to mxExpectationGREML If the dataframe or matrix supplied for argument data has n rows and argument yvars is of length p then the resulting y and X matrices will have np rows Then if either matrix contains any NA s the rows containing the NA s are trimmed from both X and y before being returned in the output in which case they will obviously have fewer than np rows Function mxGREMLDataHandler reports which rows of the full size X and y were trimmed out due to missing observations These row indices can be provided as argument casesToDropFromV to mxExpectationGREML Value A list with these two components yX Numeric matrix The first column is the phenotype vector y while the re maining columns constitutethe X matrix of covariates If this matrix is used as the raw dataset for a model then the model s GREML expectation can be constructed with dataset is yX TRUE in mxExpectationGREML casesTo
235. r For all i gt 1 the value in row i must be strictly larger than the value in row i 1 in the same column The return value of omxAllInt is a matrix consisting of a single column with one row for each combination of threshold levels See Also omxMnor Examples data myFADataRaw covariance lt cov myFADataRaw 1 5 means lt colMeans myFADataRaw 1 5 Integrate from Infinity to 0 and 0 to 1 on first variable thresholdForColumn1 lt cbind c Inf 60 1 Note The first variable will never be calculated from 1 to Infinity 216 omxApply These columns will be integrated from Inf to 1 1 to 0 etc thresholdsForColumn2 cbind c Inf 1 0 1 Inf thresholdsForColumns3and4 cbind c Inf 1 96 2 326 Inf c Inf 1 96 2 326 Inf The integration omxAllInt covariance means thresholdForColumn1 thresholdsForColumn2 thresholdsForColumns3and4 thresholdsForColumn2 Notice that columns 2 and 5 are assigned identical thresholds An alternative specification of the same calculation follows covariance lt cov myFADataRaw 1 5 means lt colMeans myFADataRaw 1 5 Note NAs to indicate the end of the sequence of thresholds thresholds lt cbind c Inf 0 1 NA NA c Inf e 0 1 Inf c Inf 1 96 2 32 Inf NA c Inf 1 96 2 32 Inf NA c Inf 0 1 Inf omxAllInt covariance means thresholds omxApply On Demand Parallel Apply Description If t
236. r 3 indicator Factor 1 strongly predicts factor 3 Factor 2 weakly predicts factor 3 Very similar to latentMulti pleRegExamplel Source Simulated References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation Examples data latentMultipleRegExample2 round cor latentMultipleRegExample2 2 logm 61 logm Matrix logarithm Description Matrix logarithm Usage logm x tol Machine double eps Arguments x matrix tol tolerance multiDatal Data for multiple regression Description Data set used in some of OpenMx s examples Usage data multiDatal Format A data frame with 500 observations on the following variables x1 x2 x3 x4 y Details X1 x4 are predictor variables and y is the outcome Source Simulated 62 mxAlgebra References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation Examples data multiDatal summary lm y data multiData1 results can be replicated in OpenMx mxAlgebra Create MxAlgebra Object Description This function creates a new MxAlgebra object Usage mxAlgebra expression name NA dimnames NA fixed FALSE Arguments expression An R expression of OpenMx supported matrix operators and matrix functions name An optional character string indicating the name of the object dimnames list The dimnames attribute for the algebra a list of leng
237. r square and contain no free parameters All elements in matrices of this type When type is Lower or Symm then the arguments to free values labels Ibound or ubound may be vectors of length N N 1 2 where N is the number of rows and columns of the matrix When type is Sdiag or Stand then the arguments to free values labels Ibound or ubound may be vectors of length N N 1 2 162 MxMatrix class Value Returns a new MxMatrix object which consists of a values matrix of numeric starting values free matrix describing free parameter specification a labels matrix of labels for the variable names and Ibound and ubound matrices of the lower and upper parameter bounds This Mx Matrix object can be used as an argument in the mxAlgebra mxBounds mxConstraint and mxModel functions References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation See Also MxMatrix for the S4 class created by mxMatrix More information about the OpenMx package may be found here Examples Create a 3 x 3 identity matrix idenMatrix lt mxMatrix type Iden nrow 3 ncol 3 name I Create a full 4 x 2 matrix from existing value matrix with all free parameters vals lt matrix 1 8 nrow 4 fullMatrix lt mxMatrix type Full values vals
238. rameters Examples A mxMatrix Full 3 3 values c 1 9 labels c a b NA free TRUE name A model lt mxModel model A name model model lt omxAssignFirstParameters model Note All cells with the same label now have the same start value Note also that NAs are untouched model matrices A labels 1 0 21 0 3 218 omxBrownie 1 1 1 1 2 2 2 2 3 3 6 9 1 a a a 4 2 b b p 3 NA NA values 2 11 0 21 0 3 Make Brownies OpenMx Description This function returns a brownie recipe Usage omxBrownie quantity 1 walnuts TRUE Arguments quantity Number of batches of brownies desired Defaults to one walnuts Logical Indicates whether walnuts are to be included in the brownies Defaults to TRUE Details Returns a brownie recipe Alter the quantity variable to make more pans of brownies Ingredients equipment and procedure are listed but neither ingredients nor equipment are provided Value Returns a brownie recipe References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation See Also More information about the OpenMx package may be found here Examples Return a brownie recipe omxBrownie omxCheckCloseEnough 219 omxCheckCloseEnough Approximate Equality Testing Function Description This function tests whether two nume
239. re See Also vech rvectorize cvectorize Examples tr matrix 1 9 3 3 tr matrix 1 12 3 4 twinData Australian twin sample biometric data Description Australian twin data with 3808 observations on the 12 variables including body mass index BMD assessed in both MZ and DZ twins Questionnaires were mailed to 5967 pairs age 18 years and over These data consist of completed questionnaires returned by both members of 3808 64 percent pairs There are two cohort blocks in the data a younger group zyg 1 5 and an older group zyg 6 10 It is a wide dataset with two individuals per line Data include zygosity zyg along with heights in metres weights in kg and the derived variables BMI in kg m 2 stored as htwt1 and htwt2 as well as the log of this variable stored here as bm1 and bm2 The logged values are more closely normally distributed 252 twinData fam is a family identifier Age is entered only once as the both twins in each pair share a common age fam anumeric vector age anumeric vector zyg anumeric vector part anumeric vector wtl anumeric vector wt2 anumeric vector htl a numeric vector ht2 a numeric vector htwt1 a numeric vector htwt2 a numeric vector bmil a numeric vector bmi2 a numeric vector Usage data twinData Format A data frame with 3808 observations on the following 12 variables fam a numeric vectorof family IDs age a numeric vectorof ages years zyg anume
240. re permitted and must be designated as the system missing value The means and numObs arguments cannot be specified as the means argument is not relevant and the numObs argument is automatically populated with the number of rows in the data Data of this type may use fit functions such as mxFitFunctionML function in MxModel objects which will automatically use covariance estimation under full information maximum likelihood for this data type cov The contents of the observed argument are treated as a covariance matrix The means ar gument is not required but may be included for estimations involving means The numObs argument is required which should reflect the number of observations or rows in the data described by the covariance matrix Data of this type may use the fit functions such as mxFit FunctionML depending on the specified model mxData 95 cor The contents of the observed argument are treated as a correlation matrix The means ar gument is not required but may be included for estimations involving means The numObs argument is required which should reflect the number of observations or rows in the data described by the covariance matrix Data of this type may use the fit functions such as mxFit FunctionML functions depending on the specified model acov The contents of the observed argument are treated as the polychoric correlation matrix of the ordinal variables
241. reate MxAlgebra object from a string Description Create MxAlgebra object from a string Usage mxAlgebraFromString algString name NA dimnames NA Arguments algString the character string to convert into an R expression name An optional character string indicating the name of the object dimnames list The dimnames attribute for the algebra a list of length 2 giving the row and column names respectively An empty list is treated as NULL and a list of length one as row names The list can be named and the list names will be used as names for the dimensions Not used Forces any remaining arguments to be specified by name mxAlgebraObjective 67 See Also mxAlgebra Examples A lt mxMatrix values runif 25 nrow 5 ncol 5 name A B mxMatrix values runif 25 nrow 5 ncol 5 name B model lt mxModel A B name model mxAlgebraFromString A B A name test model mxRun model model test result A values B values A values mxAlgebraObjective DEPRECATED Create MxAlgebraObjective Object Description WARNING Objective functions have been deprecated as of OpenMx 2 0 Please use MxFitFunctionAlgebra instead As a temporary workaround MxAlgebraObjective returns a list containing a NULL MxExpectation object and an MxFitFunctionAlgebra object All occurrences of mxAlgebraObjective algebra numObs NA numStats NA Should be changed to mxFitFunct
242. rence models See the example given in mxRefModels OpenMx does not recommend using some fit indices These are GFI AGFI NFI and SRMR The Goodness of Fit Index GFI and Adjusted Goodness of Fit Index AGFI are not recommended because they are strongly influeced by sample size and have rather high Type I error rates Sharma Mukherjee Kumar amp Dillon 2005 The Normed Fit Index NFD has no penalty for model com plexity That is adding more parameters to a model always improves the NFI regardless of how useful those parameters are Because the Non Normed Fit Index NNFI also known as the Tucker Lewis Index TLD does adjust for model complexity it is used instead Lastly the Standardized 250 summary MxModel Root Mean Square Residual SRMR is not reported because it 1 only applies to covariance mod els having no direct extension to missing data 2 has no penalty for model complexity similar to the NFI and 3 is positively biased Hu amp Bentler 1999 References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation Hu L amp Bentler P M 1999 Cutoff criteria for fit indexes in covariance structure analysis Conventional criteria versus new alternatives Structural Equation Modeling 6 1 55 Sharma S Mukherjee S Kumar A amp Dillon W R 2005 A simulation study to investigate the use of cutoff values for assessing model fit in covariance structure models Jour
243. res R MxAvailableOptimizers R 777 Version 2 2 6 R topics documented 9 Bollen 2 a s s He Seq s S BASED Ne OMS eS A E AUR E des 10 CVOCLOTIZG ese ce X psu So cp et tou ee S h ee Q ee wk ne 11 demoOneFactor a E e a W Uk p s us ana 11 demoTWoPactor y 42 9 RA he Ode e XQ Seer Se eee ea 12 CaS 2VCC ghee Ba RG ME Ye AR Pao be oe E Q ee Ea 13 dztData pe MP PT 14 dzimbData S bebe Ba 4 EGO EOS Ge E eR dos a AEE deus 16 dZOD AIA ceo A oe ee E aa Ge n dei ee ERE E eee pod OR 17 OP PDC ELT 19 3 vote eee ee oe ee edu ge dedos Ade eh See Bile etm Beis 20 example2 op A Oe ROO SOY RORURCECE OR X eae SOR Eos 2l On 22 factorExamplel 4 64 sua Bed a U pa OM Pa E EAS EO AUR 22 factorScaleExamplel cs oero V ss s ws a a ew a p q sk h s 23 factorScaleExample2 2 2 s s aa usq w a p aos So won Q a w w h W w W w q Uw aw 24 genericFitDependencies MxBaseFitFunction method 25 DS ability data s 2o 2584 084 a Hoe R 9o n ECROR IE E Roh ow babe e NUR Q 26 imxAddDependency so w soq w k a alaq s Wk p W eee 28 imxCheckMatrices lt 2 42644245 28 4200 6 HN ux e x ARE RS 28 imxCheckVariables 29 imxConDecMat
244. rginia edu documentation myAutoregressiveData Examples Print useful version information mxVersion If you just want the version use this call x mxVersion verbose FALSE library OpenMx data demoOneFactor load the demoOneFactor dataframe 201 manifests lt names demoOneFactor set the manifest to the 5 demo variables latents lt c G define 1 latent variable model lt mxModel model One Factor type RAM manifestVars manifests latentVars latents mxPath from latents to manifests labels paste b 1 5 sep mxPath from manifests arrows 2 mxPath from latents arrows 2 free FALSE values 1 0 mxData cov demoOneFactor type cov numObs 500 mxVersion model verbose TRUE labels paste u 1 5 sep Uu myAutoregressiveData Example data with autoregressively related columns Description Data set used in some of OpenMx s examples Usage data myAutoregressiveData Format A data frame with 100 observations on the following variables x1 x variable and time 1 x2 x variable and time 2 x3 x variable and time 3 x4 x variable and time 4 x5 x variable and time 5 Details The rows are independently and identically distributed but the columns are and auto correlation Structure 202 myFADataRaw Source Simulated References The OpenMx User s guide can be found at http openmx psyc virginia edu docum
245. ric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector es data dzfData str dzfData 15 16 dzmData dzmData DZ Male data Descrip Data for extended twin example ETC88 R Usage dat Format A data frame with 1990 observations on the following 37 variables famid a numeric vector el e2 e3 e4 e5 e6 e7 e8 e9 e10 ell e12 e13 e14 e15 e16 e17 e18 al a2 a3 a4 a5 a6 tion a dzmData a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector dzoData a7 anumeric vector a8 a numeric vector a9 a numeric vector a10 a numeric vector all anumeric vector a12 anumeric vector a13 anumeric vector a14 anumeric vector a15 anumeric vector a16 anumeric vector a17 anumeric vector a18 anumeric vector Examples data dzmData str dzmData dzoData DZ opposite sex data Description Data for extended twin example ETC88 R Usage data dzoData Format A data frame with 3981 observations on the
246. ric vectorof zygosity see below for important details part a numeric vector wt1 a numeric vectorof weights in kg twin 1 wt2 a numeric vectorof weights in kg twin 2 ht1 anumeric vectorof heights in kg twin 1 ht2 a numeric vectorof heights in kg twin 2 htwt1 a numeric vectorof kg m 2 twin 1 htwt2 a numeric vectorof kg m 2 twin 2 bmil a numeric vectorof log BMI for twin 1 bmi2 a numeric vectorof log BMI for twin 2 Details Zygosity is coded as follows 1 MZFF i e MZ females 2 MZMM i e MZ males 3 DZFF 4 DZMM 5 DZOS opposite sex pairs Note Zygosity 6 10 is the same for an older cohort in the sample So 6 MZFF i e MZ females MZMM i e MZ males 8 DZFF 9 DZMM 10 DZOS opposite sex pairs twin_NA_dot 253 References Martin N G amp Jardine R 1986 Eysenck s contribution to behavior genetics In S Modgil amp C Modgil Eds Hans Eysenck Consensus and Controversy Falmer Press Lewes Sussex Martin N G Eaves L J Heath A C Jardine R Feindgold L M amp Eysenck H J 1986 Transmission of social attitudes Proceedings of the National Academy of Science 83 4364 4368 Examples data twinData str twinData plot wtl wt2 data twinData mzData lt as matrix subset myTwinData zyg 1 c bmil bmi2 dzData lt as matrix subset myTwinData zyg 3 c bmil bmi2 twin_NA_dot Twin data on weight and height Description Data set used in
247. ric vectors or matrixes are approximately equal to one another within a specified threshold Usage omxCheckCloseEnough a b epsilon 10 15 na action na fail Arguments a a numeric vector or matrix b a numeric vector or matrix epsilon a non negative tolerance threshold na action either na fail default or na pass Use of na omit or na exclude is not recom mended Details Arguments a and b must be of the same type ie they must be either vectors of equal dimension or matrices of equal dimension The two arguments are compared element wise for approximate equality If the absolute value of the difference of any two values is greater than the threshold then an error will be thrown If a and b are approximately equal to each other by default the function will print a statement informing the user the test has passed To turn off these print statements use options mxPrintUnitTests FALSE When na action is set to na pass a and b are expected to have identical missingness patterns References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation See Also omxCheckWi thinPercentError omxCheckIdentical omxCheckSetEquals omxCheckTrue omxCheckEquals Examples omxCheckCloseEnough c 1 2 3 c 1 1 1 9 3 0 epsilon 0 5 omxCheckCloseEnough matrix 3 3 3 matrix 4 3 3 epsilon 2 Throws an error try omxCheckCloseEnough c 1 2 3 c 1 1 1 9 3 0 eps
248. rixSlots ee 29 imxConstraintRelations lere 29 imxConvertlden fier 30 imxConvertLabel vs yan anus X ORO ee AE Wo Y Re ew 8 30 5 31 imxCreateMatrix llle ee 31 imxDatalype s e s ss kee ae OK RAE ORY S MUQU See Sok NDS 32 imxDefaultGetSlotDisplayNames 32 ImxDeparse ie csk ara KO Q h ee v Y eee OS E dae S e NUR 33 mxDependentModels S Rok OR RUN E eA ROS RS s 33 imxDetermineDefaultOptimizer 33 HDXDIff uos s Q uq s SRS Oq Dok ea eA be eee P E hok s PON SU 34 XDI e ge x C eee ee LAA oe ea Ree 34 WMREVAIBYNAME ius Sa sus s EUR aS SD HERR UR SB Re go ae 35 imxExtractMethod 35 imxExtractNanmies i uses RO Vos Y RO ONCE US 36 imxExtractReferences o a w a C lerne 36 imxExtractSlot 36 imxFlattenModel 37 R topics documented 5 imxFreezeModel 37 imxGenerateLabels lt s 22er 37 imxGenerateNamespace 38 imxGenericModelBuilder oaa 38 IoxGensSwiEtiki eu bd nee eb bees Ve Bebo bores Bod ew den 39 imxGetSlotDisplayNam
249. rmed in R can be treated as an mxFitFunction The fitfun argument must be a function that accepts two arguments The first argument is the mxModel that should be evaluated and the second argument is some persistent state information that can be stored between one iteration of optimization to the next iteration It is valid for the function to simply ignore the second argument The function must return either a single numeric value or a list of exactly two elements If the function returns a list the first argument must be a single numeric value and the second element will be the new persistent state information to be passed into this function at the next iteration The single numeric value will be used by the optimizer to perform optimization The initial default value for the persistant state information is NA Throwing an exception via stop from inside fitfun may result in unpredictable behavior You may want to wrap your code in tryCatch while experimenting Value Returns an MxFitFunctionR object References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation Examples Create and fit a model using mxFitFunctionR library OpenMx A lt mxMatrix nrow 2 ncol 2 values c 1 4 free TRUE name A squared lt function x x 2 Define the objective function in R objFunction lt function model state values lt model A values 144 mxFitFunctionRow retu
250. rn squared values 1 1 4 squared values 1 2 3 squared values 2 1 2 squared values 2 2 1 Define the expectation function fitFunction lt mxFitFunctionR objFunction Define the model tmpModel lt mxModel model exampleModel A fitFunction Fit the model and print a summary tmpModelOut mxRun tmpModel summary tmpModelOut mxFitFunctionRow Create an MxFitFunctionRow Object Description mxFitFunctionRow returns an MxFitFunctionRow object Usage mxFitFunctionRow rowAlgebra reduceAlgebra dimnames rowResults rowResults filteredDataRow filteredDataRow existenceVector existenceVector units 2lnL Arguments rowAlgebra A character string indicating the name of the algebra to be evaluated row wise reduceAlgebra A character string indicating the name of the algebra that collapses the row re sults into a single number which is then optimized dimnames A character vector of names corresponding to columns be extracted from the data set rowResults The name of the auto generated rowResults matrix See details filteredDataRow The name of the auto generated filteredDataRow matrix See details existenceVector The name of the auto generated existenceVector matrix See details units optional The units of the fit statistic mxFitFunctionRow 145 Details Fit functions are functions for which free parameter values are optimized such that the value of a cost func
251. rting is done element of column x in the data Objects created by the mxMatrix function are of a specific type which specifies the number and location of parameters in the labels matrix and the starting values in the values matrix Input values free and labels matrices must be of appropriate shape and have appropriate values for the matrix type requested Nine types of matrices are supported Diag matrices must be square and only elements on the principal diagonal may be specified as free parameters or take ni Full matrices may be either rectangular or square and all elements in the matrix may be freely estimated This type is tl Iden matrices must be square and consist of no free parameters Matrices of this type have a value of 1 for all entries on Lower matrices must be square with a value of 0 for all entries in the upper triangle and no free parameters in the upper tr Sdiag matrices must be square with a value of for all entries in the upper triangle and along the diagonal No free paran Symm matrices must be square and elements in the principle diagonal and lower triangular portion of the matrix may be f Stand matrices are symmetric matrices see Symm with 1 along the main diagonal Unit matrices may be either rectangular or square and contain no free parameters All elements in matrices of this type Zero matrices may be either rectangular o
252. s a T Ty Ayn T Tx 6 The table below is provided as a quick reference to the numerous matrices in LISREL models Note that NX is the number of manifest exogenous independent variables the number of Xs NY is the number of manifest endogenous dependent variables the number of Ys NK is the number of latent exogenous variables the number of Ksis or Xis NE is the number of latent endogenous variables the number of etas mxLISRELObjective 157 Matrix Word Abbreviation Dimensions Expression Description Ag Lambda x LX NX x NK Exogenous Factor Loading Matrix Ay Lambda y LY NY x NE Endogenous Factor Loading Matrix B Beta BE NE x NE Regressions of Latent Endogenous Variables Pre r Gamma GA NEx NK Regressions of Latent Exogenous Variables Pred Phi PH NK x NK cov Covariance Matrix of Latent Exogenous Variable V Psi PS NE x NE Residual Covariance Matrix of Latent Endogeno Theta delta TD NX x NX cov Residual Covariance Matrix of Manifest Exogen Theta epsilon TE NY x NY cov e Residual Covariance Matrix of Manifest Endoge Os Theta delta epsilson TH NX x NY cov d Residual Covariance Matrix of Manifest Exogen T tau x TX NXx1 Residual Means of Manifest Exogenous Variable Ty tau y TY NYx1 Residual Means of Manifest Endogenous Variabl K kappa KA NKx1 mean Means of Latent Exogenous Variables alpha AL NE x 1 Residual Means of Latent Endogenous Variables From the
253. s among the observed manifest variables This matrix must be symmetric As a special case it is often diagonal The R matrix is the covariance of the observation noise The x0 argument refers to the zo matrix in the State Space approach This matrix consists of the column vector of the initial values for the latent variables The state space expectation uses the zo matrix as the starting point to recursively estimate the latent variables values at each time These starting values can be difficult to pick however for sufficiently long time series they often do not greatly impact the estimation The PO argument refers to the P matrix in the State Space approach This matrix consists of the initial values of the covariances of the error in the initial latent variable estimates given in zo That is the P matrix gives the covariance of xtrueg where xtrueg is the vector of true initial values Po is a measure of the accuracy of the intial latent state estimates The Kalman filter uses this initial covariance to recursively generated a new covariance for each time point based on the previous time point The Kalman filter updates this covariance so that it is as small as possible minimum trace Similar to the zo matrix these starting values are often difficult to choose The u argument refers to the u matrix in the State Space approach This matrix consists of the inputs or manifest covariates of the state space expectation The u m
254. sScores xPredicted 1 ssScores xUpdated 1 ssScores xSmoothed 1 Because the autoregressive dynamics are near zero the predicted and updated scores correlate minimally and the updated and smoothed latent state estimates are extremely close The first few latent predicted scores head ssScores xPredicted The predicted latent score for time 10 ssScores xPredicted 10 1 The error covariance of the predicted score at time 10 ssScores PPredicted 10 1 MxLISRELModel class MxLISRELModel Description This is an internal class and should not be used directly mxLISRELObjective Create MxLISRELObjective Object Description This function creates a new MxLISRELObjective object Usage mxLISRELObjective LX NA LY NA BE NA GA NA PH NA PS NA TD NA TE NA TH NA TX NA TY NA KA NA AL NA dimnames NA thresholds NA vector FALSE threshnames dimnames 156 mxLISRELObjective Arguments LX An optional character string indicating the name of the LX matrix LY An optional character string indicating the name of the LY matrix BE An optional character string indicating the name of the BE matrix GA An optional character string indicating the name of the GA matrix PH An optional character string indicating the name of the PH matrix PS An optional character string indicating the name of the PS matrix TD An optional character string indicating the name of the
255. sage imxConvertIdentifier identifiers modelname namespace Arguments identifiers identifiers modelname modelname namespace namespace imxConvertLabel imxConvertLabel Description This is an internal function exported for those people who know what they are doing Usage imxConvertLabel label modelname dataname namespace Arguments label label modelname modelname dataname dataname namespace namespace imxConvertSubstitution 31 imxConvertSubstitution imxConvertSubstitution Description This is an internal function exported for those people who know what they are doing Usage imxConvertSubstitution substitution modelname namespace Arguments substitution substitution modelname modelname namespace namespace imxCreateMatrix Create a matrix Description This is an internal function exported for those people who know what they are doing Not used Usage imxCreateMatrix Object labels values free lbound ubound nrow ncol byrow name condenseSlots persist Arguments Object the matrix labels labels values values free free lbound bound ubound ubound nrow nrow ncol ncol byrow byrow name name condenseSlots condenseSlots persist persist 32 imxDefaultGetSlotDisplay Names imxDataTypes Valid types of data that can be contained by MxData Description Valid types of data that can be contained by MxData Usage imxDataTypes Format n n
256. sage data Bollen Format A data frame with 75 observations on the following 11 numeric variables yl Freedom of the press 1960 y2 Freedom of political opposition 1960 y3 Fairness of elections 1960 y4 Effectiveness of elected legislature 1960 y5 Freedom of the press 1965 y6 Freedom of political opposition 1965 y7 Fairness of elections 1965 y8 Effectiveness of elected legislature 1965 x1 GNP per capita 1960 x2 Energy consumption per capita 1960 x3 Percentage of labor force in industry 1960 Details Variables y1 y4 and y5 y8 are typically used as indicators of the latent trait of political democracy in 1960 and 1965 respectively x1 x3 are used as indicators of industrialization 1960 Source The sem package in turn via pers comm Bollen to Fox References Bollen K A 1979 Political democracy and the timing of development American Sociological Review 44 572 587 Bollen K A 1980 Issues in the comparative measurement of political democracy American Sociological Review 45 370 390 Bollen K A 1989 Structural equation models New York Wiley Interscience cvectorize 11 Examples data Bollen str Bollen plot yl y2 data Bollen cvectorize Vectorize By Column Description This function returns the vectorization of an input matrix in a column by column traversal of the matrix The output is returned as a column vector Usage cvectorize x Arguments
257. scription MxData is an S4 class An MxData object is a named entity New instances of this class can be created using the function mxData MxData is an S4 class union An MxData object is either NULL or a MxNonNullData object Details The MxNonNullData class has the following slots name Thename ofthe object observed Either a matrix or a data frame vector A vector for means or NA if missing type Either cov or cor numObs The number of oberservations The name slot is the name of the MxData object The observed slot is used to contain data either as a matrix or as a data frame Use of the data in this slot by other functions depends on the value of the type slot When type is equal to cov or cor the data input into the matrix slot should be a symmetric matrix or data frame MxData class 97 The vector slot is used to contain a vector of numeric values which is used as a vector of means for MxData objects with type equal to cov or cor This slot may be used in estimation using the mxFitFunctionML function The type slot may take one of four supported values raw The contents of the observed slot are treated as raw data Missing values are permitted and must be designated as the system missing value The vector and numObs slots cannot be specified as the vector argument is not relevant and the numObs argument is automati cally populated wit
258. sed internally by OpenMx If FALSE then the matrices in the values abels Ibound and ubound slots are all of equal dimensions If TRUE then the last four of those slots will condense a matrix consisting entirely of FALSE or NA down to 1x1 display Character string used internally by OpenMx when parsing MxAlgebras dependencies Integer used internally by OpenMx when parsing MxAlgebras Methods signature x MxMatrix lt signature x MxMatrix signature x MxMatrix lt signature x MxMatrix dim signature x MxMatrix dimnames signature x MxMatrix 164 mxMI dimnames lt signature x MxMatrix length signature x MxMatrix names signature x MxMatrix ncol signature x MxMatrix nrow signature x MxMatrix print signature x MxMatrix show signature object MxMatrix Note that some methods are documented separately see below under See Also References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation See Also mxMatrix for creating MxMatrix objects Note that functions imxCreateMatrix imxDeparse imxSquareMatrix imxSymmetricMatrix and imxVerifyMatrix are separately documented methods for this class More information about the OpenMx package may be found here Examples showClass MxMatrix mxMI Est
259. served data fit function defaults to fitfunction Not used Forces remaining arguments to be specified by name maxIter maximum number of iterations tolerance optimization is considered converged when the maximum relative change in fit is less than tolerance verbose level of diagnostic output freeSet names of matrices containing free variables accel name of acceleration method varadhan2008 or ramsay1975 information name of information matrix approximation method infoArgs arguments to control the information matrix method Details This compute plan does not work with any and all expectations It requires a special kind of expec tation that can predict its missing data to create a completed data model The EM algorithm does not produce a parameter covariance matrix for standard errors S EM an implementation of Meng amp Rubin 1991 is included Ramsay 1975 was recommended in Bock Gibbons amp Muraki 1988 References Bock R D Gibbons R amp Muraki E 1988 Full information item factor analysis Applied Psychological Measurement 6 4 431 444 Dempster A P Laird N M amp Rubin D B 1977 Maximum likelihood from incomplete data via the EM algorithm Journal of the Royal Statistical Society Series B Methodological 1 38 Meng X L amp Rubin D B 1991 Using EM to obtain asymptotic variance covariance matrices The SEM algorithm Journal of the American Statistical Association 86 416 899
260. some of OpenMx s examples Usage data twin NA dot Format A data frame with 3808 observations on the following variables fam Family ID variable age Age of the twin pair Range 17 to 88 zyg Integer codes for zygosity and gender combinations part wt1 Weight in kilograms for twin 1 wt2 Weight in kilograms for twin 2 ht1 Height in meters for twin 1 ht2 Height in meters for twin 2 htwt1 Product of ht and wt for twin 1 htwt2 Product of ht and wt for twin 2 bmil Body Mass Index for twin 1 bmi2 Body Mass Index for twin 2 Details Same as myTwinData but has as the missing data value instead of NA 254 vec2diag Source Timothy Bates References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation Examples data twin_NA_dot summary twin NA dot Note that all variables are treated as factors because of the missing data coding vec2diag Create Diagonal Matrix From Vector Description Given an input row or column vector vec2diag returns a diagonal matrix with the input argument along the diagonal Usage vec2diag x Arguments x a row or column vector Details Similar to the function diag except that the input argument is always treated as a vector of elements to place along the diagonal See Also diag2vec Examples vec2diag matrix 1 4 1 4 vec2diag matrix 1 4 4 1 vech 255 vech Half vectorization Description This funct
261. ss 72 MxCharOrList class 72 MxCharOrNumber class 73 mxCheckIdentification 73 741 MxCI 75 76 172 MxCI MxCI class 77 mxCI 75 76 76 153 169 170 194 245 MxCI class 77 mxCompare 78 MxCompute MxCompute class 81 MxCompute class 81 mxComputeConfidenceInterval 76 81 MxComputeConfidenceInterval class mxComputeConfidenceInterval 81 mxComputeDefault 82 MxComputeDefault class mxComputeDefault 82 mxComputeEM 9 82 MxComputeEM class mxComputeEM 82 mxComputeGradientDescent 9 84 198 199 MxComputeGradientDescent class mxComputeGradientDescent 84 mxComputeHessianQuality 9 85 MxComputeHessianQuality class mxComputeHessianQuality 85 263 mxComputeIterate 9 86 MxComputeIterate class mxComputeIterate 86 mxComputeNewtonRaphson 9 87 MxComputeNewtonRaphson class mxComputeNewtonRaphson 87 mxComputeNothing 87 mxComputeNumericDeriv 9 88 MxComputeNumericDeriv class mxComputeNumericDeriv 88 mxComputeOnce 62 89 MxComputeOnce class mxComputeOnce 89 mxComputeReportDeriv 90 MxComputeReportDeriv class mxComputeReportDeriv 90 mxComputeSequence 90 36 MxComputeSequence class mxComputeSequence 90 mxComputeStandardError 91 MxComputeStandardError class mxComputeStandardError 91 MxConstraint 68 91 92 110 113 116 120 125 132 134 136 158 167 172 182 212 MxConstraint MxConstraint class 93 mxConstraint 65 82 91 93 162 163 169 194 245 MxConstraint c
262. stimation There is no imposed limit on the number of MxAlgebra objects that may be added here The latentVars slot contains a list of latent variable names which may be referenced by MxPath objects This slot defaults to NA and is only used when the mxPath function is used The manifestVars slot contains a list of latent variable names which may be referenced by MxPath objects This slot defaults to NA and is only used when the mxPath function is used The data slot contains an MxData object This slot must be filled prior to execution when an objective function referencing data is used Only one MxData object may be included per model but submodels may have their own data in their own data slots If an MxData object is added to an MxModel which already contains an MxData object the new object replaces the existing one The objective slot contains an objective function This slot must be filled prior to using the mxRun function for model execution and optimization MxAlgebra MxData and MxMatrix objects re quired by the included objective function must be included in the appropriate slot of the MxModel prior to using mxRun The independent slot contains a logical value indicating whether or not the model is independent If a model is independent independent TRUE then the parameters of this model are not shared with any other model An independent model may be estimated with no dependency on any other
263. straint objects in an MxModel object This model may then be evaluated using the mxRun function The results of the optimization can be reported using the summary function or accessed directly in the output slot of the resulting model i e modelName output Components of the output may be referenced using the Extract functionality Value Returns a list containing an MxExpectationNormal object and an MxFitFunctionML object References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation MxFitFunction class 133 Examples Create and fit a model using mxMatrix mxAlgebra mxExpectationNormal and mxFitFunctionML library OpenMx Simulate some data x rnorm 1000 mean 0 sd 1 y 5 rnorm 1000 mean 0 sd 1 tmpFrame data frame x y tmpNames names tmpFrame Define the matrices M lt mxMatrix type Full nrow 1 ncol 2 values c 0 0 free c TRUE TRUE labels c Mx My name S lt mxMatrix type Full nrow 2 ncol 2 values c 1 0 0 1 free c TRUE FALSE FALSE TRUE labels c Vx NA NA Vy name S A lt mxMatrix type Full nrow 2 ncol 2 values c 0 1 0 0 free c FALSE TRUE FALSE FALSE labels c NA b NA NA name A I lt mxMatrix type Iden nrow 2 ncol 2 name I Define the expectation expCov lt mxAlgebra solve I A S t solve I A name expCov expFunction lt mxExpectationN
264. string indicating the name of the thresholds matrix threshnames Not Yet Implemented An optional character vector to be assigned to the column names of the thresholds matrix Unused Requires further arguments to be named t Not to be used scores Not to be used Details Expectation functions define the way that model expectations are calculated When used in con junction with the mxFitFunctionML the mxExpectationStateSpace uses maximum likelihood pre diction error decomposition PED to obtain estimates of free parameters in a model of the raw MxData object State space expectations treat the raw data as a multivariate time series of equally spaced times with each row corresponding to a single occasion This is not a model of the block Toeplitz lagged autocovariance matrix State space expectations implement a classical Kalman filter to produce expectations The hybrid Kalman filter combination of classical Kalman and Kalman Bucy filters for continuous latent time with discrete observations is implemented and is available as mxExpectationStateSpace ContinuousTime The following alternative filters are not yet implemented square root Kalman filter in Cholesky or singular value decomposition form extended Kalman filter for linear approx imations to nonlinear state space models unscented Kalman filter for highly nonlinear state space models and Rauch Tung Striebel smoother for updating forecast state estimates after a complete forwar
265. summary m1 show std ordinalTwinData Data for ordinal twin model Description Example data for ordinal twin data modelling Three variables measured in each twin Usage data ordinalTwinData Format A data frame with 139 observations on the following 7 variables zyg anumeric vector var1 twin a numeric vector var2 twin a numeric vector rvectorize 247 var3_twinl a numeric vector var1 twin2 a numeric vector var2 twin2 a numeric vector var3 twin2 a numeric vector Examples data ordinalTwinData str ordinalTwinData rvectorize Vectorize By Row Description This function returns the vectorization of an input matrix in a row by row traversal of the matrix The output is returned as a column vector Usage rvectorize x Arguments x an input matrix See Also cvectorize vech vechs Examples rvectorize matrix 1 9 3 3 rvectorize matrix 1 12 3 4 248 summary Mx Model summary MxModel Model Summary Description This function returns summary statistics of a model after it has been run Usage summary object Arguments object A MxModel object Any number of named arguments see below Details mxSummary allows the user to set or override the following parameters of the model numObs Numeric Specify the total number of observations for the model numStats Numeric Specify the total number of observed statistics for the model refModels List of MxModel objects Sp
266. t Endogenous Variables Pre r Gamma GA NEx NK Regressions of Latent Exogenous Variables Pred Phi PH NK x cov Covariance Matrix of Latent Exogenous Variable V Psi PS NE x NE cov Residual Covariance Matrix of Latent Endogeno Theta delta TD NX x NX cov Residual Covariance Matrix of Manifest Exogen Theta epsilon TE NY x NY cov e Residual Covariance Matrix of Manifest Endogei Os Theta delta epsilson TH NXxNY cov c Residual Covariance Matrix of Manifest Exogen Ty tau x TX NXx1 Residual Means of Manifest Exogenous Variable f tau y TY NY x1 Residual Means of Manifest Endogenous Variabl K kappa KA NKx1 mean Means of Latent Exogenous Variables alpha AL NEx 1 Residual Means of Latent Endogenous Variables From the extended LISREL model several submodels can be defined Subtypes of the LISREL model are defined by setting some of the arguments of the LISREL expectation function to NA Note that because the default values of each LISREL matrix is NA setting a matrix to NA can be accomplished by simply not giving it any other value The first submodel is the LISREL model without means T Ayn e AE The LISREL model without means requires 9 matrices LX LY BE GA PH PS TD TE and TH Hence this LISREL model has TX TY KA and AL as NA This can be accomplished be leaving these matrices at their default values The TX TY KA and AL matrices must be specified if either the mxDa
267. t to sorting in decreasing order of the absolute value of the eigenvalue See Mod for more info eigenvec and ieigenvec return nxn matrices where each column corresponds to an eigenvector These are sorted in decreasing order of the modulus of their associated complex eigenvalue Usage eigenval x eigenvec x ieigenval x ieigenvec x Arguments x the square matrix whose eigenvalues vectors are to be calculated Details Eigenvectors returned by eigenvec and ieigenvec are normalized to unit length See Also eigen Examples lt mxMatrix values runif 25 nrow 5 ncol 5 name G lt mxMatrix values c 0 1 1 1 nrow 2 ncol 2 name G model lt mxModel A G name model mxEval eigenvec A model mxEval eigenvec G model mxEval eigenval A model mxEval eigenval G model mxEval ieigenvec A model mxEval ieigenvec G model mxEval ieigenval A model 20 example 1 mxEval ieigenval G model 1 1 Bivariate twin data example from Classic Mx Manual Description Data set used in some of OpenMx s examples Usage data examplel Format A data frame with 400 observations on the following variables IDNum Twin pair ID Zygosity Zygosity of the twin pair X1 X variable for twin 1 Y1 Y variable for twin 1 X2 X variable for twin 2 Y2 Y variable for twin 2 Details Same as example2 but in wide format instead of tall Source Classic Mx Manual
268. tFunctionML class mxFitFunctionML 138 mxFitFunctionMultigroup 70 134 139 140 24 MxFitFunctionMultigroup class mxFitFunctionMultigroup 140 mxFitFunctionR 70 142 245 MxFitFunctionR class mxFitFunctionR 142 mxFitFunctionRow 70 144 245 MxFitFunctionRow class mxFitFunctionRow 144 mxFitFunctionWLS 70 95 99 100 146 MxFitFunctionWLS class mxFitFunctionWLS 146 MxFlatModel class 147 mxGenerateData 148 mxGetExpected 150 mxGREMLDataHandler 04 151 MxInterval class 153 mxKalmanScores 7 30 153 MxLISRELModel class 155 mxLISRELObjective 155 mxExpectationStateSpaceContinuousTim amp kListOrNull class 159 122 mxExpectationStateSpace 69 117 123 126 148 154 245 MxExpectationStateSpace class mxExpectationStateSpace 117 mxExpectationStateSpaceContinuousTime 118 121 122 mxFactor 128 148 mxFactorScores 129 mxFIMLObjective 131 769 MxFitFunction MxFitFunction class 133 MxFitFunction class 133 mxFitFunctionAlgebra 64 67 70 95 97 134 139 245 MxFitFunctionAlgebra class mxFitFunctionAlgebra 134 MxFitFunctionGREML 35 136 MxFitFunctionGREML MxFitFunctionGREML class 136 mxFitFunctionGREML 70 135 137 mxMakeNames 159 MxMatrices 76 77 172 MxMatrix 62 64 66 68 71 72 76 79 91 101 104 106 108 110 113 115 116 116 120 123 125 126 132 134 137 156 158 160 162 167 169 172 173 182 212 MxMatrix MxMatrix class 162 mxMatrix 62
269. ta object To evaluate place an mxExpectationNormal object the mxData object for which the expected co variance approximates referenced MxAlgebra and MxMatrix objects optional MxBounds or Mx Constraint objects and an mxFitFunction such as mxFitFunctionML in an MxModel object This model may then be evaluated using the mxRun function The results of the optimization can be reported using the summary function or accessed directly in the output slot of the resulting model i e modelName output Components of the output may be referenced using the Extract functionality Value Returns an MxExpectationNormal object 114 mxExpectationNormal References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation Examples Create and fit a model using mxMatrix mxAlgebra mxExpectationNormal and mxFitFunctionML library OpenMx Simulate some data x rnorm 100 mean 0 sd 1 y 0 5 x rnorm 1000 mean 0 sd 1 tmpFrame lt data frame x y tmpNames names tmpFrame Define the matrices M lt mxMatrix type Full nrow 1 ncol 2 values c 0 0 freezc TRUE TRUE labels c Mx My name M S lt mxMatrix type Full nrow 2 ncol 2 values c 1 0 0 1 free c TRUE FALSE FALSE TRUE labels c Vx NA NA Vy name S A lt mxMatrix type Full nrow 2 ncol 2 values c 0 1 0 0 free c FALSE TRUE FALSE FALSE labels c NA b NA NA nam
270. ta type is cov or cor and a means vector is provided or if the mxData type is raw Otherwise the TX TY KA and AL matrices are ignored and the model without means is estimated A second submodel involves only endogenous variables 110 mxExpectationLISREL n Dn Ayn The endogenous only LISREL model requires 4 matrices LY BE PS and TE The LX GA PH TD and TH must be NA in this case However means can also be specified allowing TY and AL if the data are raw or if observed means are provided Another submodel involves only exogenous variables z Az 6 The exogenous model model requires 3 matrices LX PH and TD The LY BE GA PS TE and TH matrices must be NA However means can also be specified allowing TX and KA if the data are raw or if observed means are provided The model that is run depends on the matrices that are not NA If all 9 matrices are not NA then the full model is run If only the 4 endogenous matrices are not NA then the endogenous only model is run If only the 3 exogenous matrices are not NA then the exogenous only model is run If some endogenous and exogenous matrices are not NA but not all of them then appropriate errors are thrown Means are included in the model whenever their matrices are provided The MxMatrix objects included as arguments may be of any type but should have the properties described above The mxExpectationLISREL will not return an error for
271. tained using the mxEval function Value Returns a new MxExpectationStateSpace object mxExpectationStateSpace objects should be in cluded with models with referenced MxAlgebra MxData and MxMatrix objects References K J Astr m and R M Murray 2010 Feedback Systems An Introduction for Scientists and Engineers Princeton University Press J Durbin and S J Koopman 2001 Time Series Analysis by State Space Methods Oxford Uni versity Press mxExpectationStateSpace 121 R E Kalman 1960 A New Approach to Linear Filtering and Prediction Problems Basic Engi neering 82 35 45 G Petris 2010 An R Package for Dynamic Linear Models Journal of Statistical Software 36 1 16 The OpenMx User s guide can be found at http openmx psyc virginia edu documentation See Also mxExpectationStateSpaceContinuous Time Examples Create and fit a model using mxMatrix mxExpectationStateSpace and mxFitFunctionML require OpenMx data demoOneFactor nvar lt ncol demoOneFactor varnames lt colnames demoOneFactor ssModel lt mxModel model State Space Manual Example mxMatrix Full 1 1 TRUE 3 namez A mxMatrix Zero 1 1 name B mxMatrix Full nvar 1 TRUE 6 name C dimnames list varnames F1 mxMatrix Zero nvar 1 name D mxMatrix Diag 1 1 FALSE 1 name Q mxMatrix Diag nvar nvar TRUE 2 name R mxMatrix Zero 1 1 name x0 mxMatrix Diag 1
272. ted rowResults matrix See details filteredDataRow The name of the auto generated filteredDataRow matrix See details existenceVector The name of the auto generated existenceVector matrix See details Details Objective functions are functions for which free parameter values are chosen such that the value of the objective function is minimized The mxRowObjective function evaluates a user defined MxAlgebra object called the rowAlgebra in a row wise fashion It then stores results of the row wise evaluation in another MxAlgebra object called the rowResults Finally the mxRowObjective function collapses the row results into a single number which is then used for optimization The MxAlgebra object named by the reduceAlgebra collapses the row results into a single number The filteredDataRow is populated in a row by row fashion with all the non missing data from the current row You cannot assume that the length of the filteredDataRow matrix remains constant unless you have no missing data The existenceVector is populated in a row by row fashion with a value of 1 0 in column j if a non missing value is present in the data set in column j and a value of 0 0 otherwise Use the functions omxSelectRows omxSelectCols and omxSelectRowsAndCols to shrink other matrices so that their dimensions will be conformable to the size of filteredDataRow Value Please use mxFitFunctionRow instead As a temporary workaro
273. tence vector which specifies what data entries are missing This can be seen in the demo RowObjectiveFIMLBivariateSaturated Value Returns a new matrix with the filtered data References The function is most often used when filtering data for missingness This can be seen in the demo RowObjectiveFIMLBivariateSaturated The OpenMx User s guide can be found at http openmx psyc virginia edu documen The omxSelect functions share some similarity to the Extract function in the R programming lan guage Examples loadings lt c 1 0 625 0 1953125 1 0 375 0 0703125 1 0 375 0 703125 loadings matrix loadings 3 3 byrow TRUE existencelist lt c 1 0 1 existencelist matrix existencelist 1 3 byrow TRUE rowsAndCols omxSelectRowsAndCols loadings existenceList rows lt omxSelectRows loadings existenceList cols lt omxSelectCols loadings existenceList omxSetParameters Assign Model Parameters Description Modify the attributes of parameters in a model This function cannot modify parameters that have NA labels Often you will want to call omxAssignFirstParameters after using this to force the starting values of equated parameters to the same value otherwise the model cannot begin to be evaluated 244 omxSymbolTable Usage omxSetParameters model labels free NULL values NULL newlabels NULL lbound NULL ubound NULL indep FALSE strict TRUE name NULL Argum
274. th 2 giving the row and column names respectively An empty list is treated as NULL and a list of length one as row names The list can be named and the list names will be used as names for the dimensions Not used Forces argument fixed to be specified by name fixed If TRUE this algebra will not be recomputed automatically when things it de pends on change mxComputeOnce can be used to force it to recompute Details The mxAlgebra function is used to create algebraic expressions that operate on one or more MxMa trix objects To evaluate an MxAlgebra object it must be placed in an MxModel object along with all referenced MxMatrix objects and the mxFitFunctionAlgebra function The mxFitFunctionAlgebra function must reference by name the MxAlgebra object to be evaluated Note that if the result for an MxAlgebra depends upon one or more definition variables see mxMatrix then the value returned after the call to mxRun will be computed using the values of those definition variables in the first i e first before any automated sorting is done row of the raw dataset The following operators and functions are supported in mxAlgebra Operators mxAlgebra 63 solve Inversion t Transposition Elementwise powering Kronecker powering Addition Subtraction Matrix Multiplication Elementwise product Elementwise division x Kronecker product amp Quadratic product Functions cov2cor Convert cov
275. ther direction and are not necessarily symmetric around the parameter estimate Estimation of confidence intervals requires both that MxCI object be included in the model and that the inter vals argument of the mxRun function is set to TRUE When estimated confidence intervals can be accessed in the model output at output confidenceIntervals or by using summary on a fitted MxModel object A typical use case is when a parameter estimate is obtained that is at or near a lower bound In this case there is no point in computing the lower part of the CI Only the upper bound is needed In all cases a two sided hypothesis test is assumed Therefore the upper bound will exclude 2 5 for interval 0 95 even though only one bound is requested To obtain a one sided CI for a one sided hypothesis test interval 0 90 will obtain a 95 confidence interval The likelihood based confidence intervals returned using MxCI are obtained by increasing or de creasing the value of each parameter until the 2 log likelihood of the model increases by an amount corresponding to the requested interval The confidence limit specified by the interval argument is transformed into a corresponding difference in the model 2 log likelihood based on the likelihood ratio test Thus a requested confidence interval for a parameter will first determine the correspond ing quantile from the chi squared distribution with one degree of freedom a value of 3 841459 when
276. ther elements associated with your model For data frames ensure you have set the names For matrices set names using for instance columns Covariance and correlation matrices need to have both the row and column names set and these must be identical for instance by using dimnames list varNames varNames Value Returns a new MxData object References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation See Also MxData for the S4 class created by mxData matrix and data frame for objects which may be entered as arguments in the observed slot More information about the OpenMx package may be found here Examples library OpenMx 96 MxData class Create a covariance matrix covMatrix lt matrix c 77642931 39590663 0 39590663 0 49115615 nrow 2 ncol 2 byrow TRUE covNames lt c x dimList list covNames covNames dimnames covMatrix dimList Create an MxData object including that covariance matrix testData mxData observed covMatrix type cov numObs 100 testModel mxModel model testModel mxMatrix type Symm nrow 2 ncol 2 values c 2 1 2 free TRUE name expCov dimnames dimList mxExpectationNormal covariance expCov dimnames covNames mxFitFunctionML testData outModel mxRun testModel summary outModel MxData class MxData Class De
277. tic data Description Internal static data class Details Not to be used mxDataWLS 99 mxDataWLS Create MxData Object for Least Squares WLS DLS ULS Analyses Description This function creates a new MxData object of type ULS unweighted least squares WLS weighted least squares or DLS diagonally weighted least squares The appropriate fit function to include with these models is mxFitFunctionWLS Usage mxDataWLS data type 5 useMinusTwo TRUE returnInverted TRUE debug FALSE fullWeight TRUE Arguments data A matrix or data frame which provides raw data to be used for WLS type A character string WLS default DLS or ULS for weighted diagonal unweighted least squares useMinusTwo Logical indicating whether to use 2LL default or LL returnInverted Logical indicating whether to return the information matrix default or the co variance matrix debug Logical to set debugging on or off default fullWeight Logical determining if the full weight matrix is returned default Needed for standard error and quasi chi squared calculation Details The mxDataWLS function creates an MxData object which can be used in MxModel objects This function takes raw data and returns an MxData object to be used in a model to fit with weighted least squares Both Ordinal and continuous data are supported A combination of these data types succeeds with out error but w
278. timation The PO argument refers to the P matrix in the State Space approach This matrix consists of the initial values of the covariances of the error in the initial latent variable estimates given in zo That is the Py matrix gives the covariance of 0 xtrueg where xtrueg is the vector of true initial values Po is a measure of the accuracy of the intial latent state estimates The Kalman filter uses this initial covariance to recursively generated a new covariance for each time point based on the previous time point The Kalman filter updates this covariance so that it is as small as possible minimum trace Similar to the zo matrix these starting values are often difficult to choose The u argument refers to the u matrix in the State Space approach This matrix consists of the inputs or manifest covariates of the state space expectation The u matrix must be a column vector with the same number of rows as the B and D matrices have columns If no inputs are desired u can be a zero matrix If time varying inputs are desired then they should be included as columns in the MxData object and referred to in the labels of the u matrix as definition variables There is an example of this below The t argument refers to the matrix in the State Space approach This matrix should be 1x1 1 row and 1 column and not free The label for the element of this matrix should be data YourTime Variable The data part does not change but
279. tion is calculated and exists in the output of summary More information is displayed when verbose TRUE and less when verbose FALSE summary Mx Model 249 The Information Criteria AIC BIC are reported in a table The table shows different ver sions of the information criteria Each entry in the table is an AIC or BIC obtained using different penalties In particular the entries of the table do not show different penalties but rather different versions of AIC and BIC For example the AIC is reported with both a Parameters Penalty and a Degrees of Freedom Penalty AIC generally takes the form 2LL 2 k With the Parameters Penalty k is the number of free parameters With the Degrees of Freedom Penalty k is the model degrees of freedom BIC is defined similarly 2LL k x log N where k is either the number of free parameters or the degrees of freedom The Sample Size Adjusted BIC is only defined for the parameters penalty 2LL k log N 2 24 The refModels SaturatedLikelihood SaturatedDoF IndependenceLikelihood and IndependenceDoF arguments can be used to obtain further fit statistics RMSEA CFI TLI Chi Squared For covari ance data saturated and independence models are fitted automatically so all fit indices are reported For raw data these reference models are not estimated to save computational time For an easy way to make reference models for most cases is provided by the mxRefModels function When the Satur
280. tion is minimized The mxFitFunctionRow function evaluates a user defined MxAlgebra object called the rowAlgebra in a row wise fashion It then stores results of the row wise evaluation in another MxAlgebra object called the rowResults Finally the mxFitFunctionRow function collapses the row results into a single number which is then used for optimization The MxAlgebra object named by the reduceAlgebra collapses the row results into a single number The filteredDataRow is populated in a row by row fashion with all the non missing data from the current row You cannot assume that the length of the filteredDataRow matrix remains constant unless you have no missing data The existenceVector is populated in a row by row fashion with a value of 1 0 in column j if a non missing value is present in the data set in column j and a value of 0 0 otherwise Use the functions omxSelectRows omxSelectCols and omxSelectRowsAndCols to shrink other matrices so that their dimensions will be conformable to the size of filteredDataRow Value Returns a new MxFitFunctionRow object Only one MxFitFunction object should be included in each model There is no need for an MxExpectation object when using mxFitFunctionRow References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation Examples Model that adds two data columns row wise then sums that column Notice no optimization is performed her
281. tor to be assigned to the column names of the thresh olds matrix 182 mxRAMObjective Details NOTE THIS DESCRIPTION IS DEPRECATED Please change to using mxExpectationRAM and mxFitFunctionML as shown in the example below Objective functions were functions for which free parameter values are chosen such that the value of the objective function was minimized The mxRAMObjective provided maximum likelihood estimates of free parameters in a model of the covariance of a given MxData object This model is defined by reticular action modeling McArdle and McDonald 1984 The A S arguments must refer to MxMatrix objects with the associated properties of the A S and F matrices in the RAM modeling approach The dimnames arguments takes an optional character vector If this argument is not a single NA then this vector be assigned to be the column names of the F matrix and optionally to the M matrix if the M matrix exists The A argument refers to the A or asymmetric matrix in the RAM approach This matrix consists of all of the asymmetric paths one headed arrows in the model A free parameter in any row and column describes a regression of the variable represented by that row regressed on the variable represented in that column The S argument refers to the S or symmetric matrix in the RAM approach and as such must be square This matrix consists of all of the symmetric paths two headed arrows
282. tp openmx psyc virginia edu documentation Examples require OpenMx data demoOneFactor manifests lt names demoOneFactor latents lt c G factorModel mxModel One Factor type RAM manifestVars manifests latentVars latents mxPath from latents to manifests mxPath from manifests arrows 2 mxPath from latents arrows 2 free FALSE values 1 0 mxData observed cov demoOneFactor type cov numO0bs 500 summary factorRun mxRun factorModel factorSat mxRefModels factorRun run TRUE summary factorRun refModels factorSat omxSelectRowsAndCols Filter rows and columns from an mxMatrix Description This function filters rows and columns from a matrix using a single row or column R matrix as a selector Usage omxSelectRowsAndCols x selector omxSelectRows x selector omxSelectCols x selector omxSetParameters 243 Arguments x the matrix to be filtered selector A single row or single column R matrix indicating which values should be fil tered from the mxMatrix Details omxSelectRowsAndCols omxSelectRows and omxSelectCols returns the filtered entries in a target matrix specified by a single row or single column selector matrix Each entry in the selector matrix is treated as a logical data indicating if the corresponding entry in the target matrix should be excluded 0 or FALSE or included not 0 or TRUE Typically the function is used to filter data from a target matrix using an exis
283. ttp openmx psyc virginia edu documentation See Also omxCheckCloseEnough omxCheckWi thinPercentError omxCheckSetEquals omxCheckTrue omxCheckEquals Examples omxCheckIdentical c 1 2 3 c 1 2 3 omxCheckIdentical FALSE FALSE Throws an error try omxCheckIdentical c 1 2 3 c 2 1 3 omxCheckNamespace 223 omxCheckNamespace omxCheckNamespace Description This is an internal function exported for those people who know what they are doing Usage omxCheckNamespace model namespace Arguments model model namespace namespace Details This function checks that the named entities in the model are valid omxCheckSetEquals Set Equality Testing Function Description This function tests whether two vectors contain the same elements Usage omxCheckSetEquals a b Arguments the first vector to compare the second vector to compare Details Performs the setequal function on the two arguments If the two arguments do not contain the same elements then an error will be thrown If a and b contain the same elements by default the function will print a statement informing the user the test has passed To turn off these print statements use options mxPrintUnitTests FALSE References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation 224 omxCheckTrue See Also omxCheckCloseEnough omxCheckWi thinPercentError omxCheckIdentica
284. umeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector a numeric vector Examples data mzmData str mzmData 211 212 nuclear_twin_design_data Named entity Named Entities Description A named entity is an S4 object that can be referenced by name Details Every named entity is guaranteed to have a slot called name Within a model the named entities of that model can be accessed using the operator Access is limited to one nesting depth such that if is a submodel of A and is a matrix of B then C must be accessed using The following S4 classes are named entities in the OpenMx library MxAlgebra MxConstraint MxMatrix MxModel MxData and MxObjective Examples library OpenMx Create a model add a matrix to it and then access the matrix by name testModel mxModel model anEmptyModel testMatrix lt mxMatrix type Full nrow 2 ncol 2 values c 1 2 3 4 name yourMatrix yourModel lt mxModel testModel testMatrix name noLongerEmpty yourModel yourMatrix nuclear twin design data Twin data from a nuclear family design Description Data set used in some of Op
285. und mxRowObjective returns a list containing a NULL MxExpectation object and an MxFitFunctionRow object mxRun 189 References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation Examples Model that adds two data columns row wise then sums that column Notice no optimization is performed here library OpenMx xdat lt data frame a rnorm 10 b 1 10 Make data set amod lt mxModel model example1 mxData observed xdat type raw mxAlgebra sum filteredDataRow name rowAlgebra mxAlgebra sum rowResults name reduceAlgebra mxFitFunctionRow rowAlgebra rowAlgebra reduceAlgebra reduceAlgebra dimnames c a b amodOut mxRun amod mxEval rowResults model amodOut mxEval reduceAlgebra model amodOut Model that find the parameter that minimizes the sum of the squared difference between the parameter and a data row bmod lt mxModel model example2 mxData observed xdat type raw mxMatrix values 75 ncol 1 nrow 1 free TRUE name B mxAlgebra filteredDataRow B 2 name rowAlgebra mxAlgebra sum rowResults name reduceAlgebra mxFitFunctionRow rowAlgebra rowAlgebra reduceAlgebra reduceAlgebra dimnames c a bmodOut mxRun bmod mxEval B model bmodOut mxEval reduceAlgebra model bmodOut mxEval rowResults model bmodOut mxRun Send a Model to the Optimizer Description This function begins opti
286. vector absent Path versus Matrix specification All orders of permutations of latents with manifests imxPPML Test Test 47 imxPPML Test Test imxPPML Test Test Description Test that PPML solutions match non PPML solutions Usage imxPPML Test Test model checkLL TRUE checkByName FALSE tolerance 0 5 testEstimates TRUE Arguments model the MxModel to evaluate checkLL whether to check log likelihood checkByName check values using their names tolerance closeness tolerance for check testEstimates whether to test for the same parameter estimates Details This is an internal function used for comparing PPML and non PPML solutions Generally non developers will not use this function imxPreprocessModel imxPreprocessModel Description This is an internal function exported for those people who know what they are doing Usage imxPreprocessModel model Arguments model model 48 imxReplaceModels imxReplaceMethod imxReplaceMethod Description This is an internal function exported for those people who know what they are doing Usage imxReplaceMethod x name value Arguments x the thing name name value value imxReplaceModels Replace parts of a model Description Replace parts of a model Usage imxReplaceModels model replacements Arguments model model replacements replacements imxReplaceSlot 49 imxReplaceSlot imxReplaceSlot Description Ch
287. ved slot of MxData objects these names are not recognized as variable names in MxPath objects Variable names must be specified using the man ifestVars argument of the mxModel function prior to use in MxPath objects The mxData function does not currently place restrictions on the size shape or symmetry of matri ces input into the observed argument While it is possible to specify MxData objects as covariance or correlation matrices that do not have the properties commonly associated with these matrices failure to correctly specify these matrices will likely lead to problems in model estimation References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation See Also mxData for creating MxData objects matrix and data frame for objects which may be entered as arguments in the matrix slot More information about the OpenMx package may be found here 98 MxDataStatic class mxDataDynamic Create dynamic data Description Create dynamic data Usage mxDataDynamic type expectation verbose QL Arguments type type of data Not used Forces remaining arguments to be specified by name expectation the name of the expectation to provide the data verbose Increase runtime debugging output MxDataFrameOrMatrix class MxDataFrameOrMatrix Description Internal class that is the union of data frame and matrix Details Not to be used MxDataStatic class Create sta
288. ws of y or X that contained missing observations By default no cases are dropped from V Ignored unless dataset is yX TRUE mxExpectationGREML 105 Details GREML stands for genomic relatedness matrix restricted maximum likelihood In the strictest sense of the term it refers to genetic variance component estimation from matrices of subjects pairwise degree of genetic relatedness as calculated from genome wide marker data It is from this original motivation that some of the terminology originates such as calling y the pheno type vector However OpenMx s implementation of GREML is applicable for analyses from any subject matter domain and in which the following assumptions are reasonable 1 Conditional on X the covariates the phenotype vector response variable y is a single realization from a multivariate normal distribution having in general a dense covariance ma trix V 2 The parameters of the covariance matrix such as variance components are of primary interest 3 The random effects are normally distributed 4 Weighted least squares regression using the inverse of V as a weight matrix is an adequate model for the phenotypic means Note that the regression coefficients are not actually free parameters to be numerically optimized Computationally the chief distinguishing feature of an OpenMx GREML analysis is that the phe notype vector is a single realization of a rando
289. x 1 measVar 1 5 y lt cbind obs xtrnorm tlen sd sqrt measVar tim t plot t y 1 1 mxExpectationStateSpaceContinuous Time 127 Model Specification Note the bounds are here only to keep SLSQP from stepping too far off a cliff With the bounds in place SLSQP finds the right solution Without the bounds SLSQP goes crazy cdim list obs c ksi ksiDot amat mxMatrix Full 2 2 c FALSE TRUE FALSE TRUE c 0 1 1 2 name A lbound 10 bmat lt mxMatrix Zero 2 1 name B cmat mxMatrix Full 1 2 FALSE c 1 0 name C dimnames cdim dmat lt mxMatrix Zero 1 1 name D qmat mxMatrix Zero 2 2 name Q rmat mxMatrix Diag 1 1 TRUE 4 name R lbound 1e 6 xmat lt mxMatrix Full 2 1 TRUE c 0 0 name x0 lbound 10 ubound 10 pmat mxMatrix Diag 2 2 FALSE 1 name PQ umat lt mxMatrix Zero 1 1 name u tmat mxMatrix Full 1 1 name time labels data tim osc lt mxModel LinearOscillator amat bmat cmat dmat qmat rmat xmat pmat umat tmat mxExpectationSSCT A B C D Q R PO u time mxFitFunctionML mxData y raw oscr mxRun osc Results Examination summary oscr ssFreqParam lt mxEval sqrt AL2 1 oscr freqParam ssMeasVar lt mxEval R oscr measVar dampingParam lt 0 ssDampingP
290. xed designations or lower bounds or upper bounds depending on the fetch argument Using fetch with all returns a data frame that is populated with all of the attributes See Also omxSetParameters omxLocateParameters omxAssignFirstParameters Examples library OpenMx A lt mxMatrix Full 2 2 labels c A11 A12 A21 NA values 1 4 free c TRUE TRUE FALSE TRUE byrow TRUE name A model lt mxModel A name model Request all free parameters in model omxGetParameters model A11 A12 model A 2 2 1 2 4 Request fixed parameters from model omxGetParameters model free FALSE A21 3 A labels DET 1521 1 1 11 12 2 A21 NA A free 1 2 1 TRUE TRUE 2 FALSE TRUE A labels 14 2521 1 1 A11 A12 2 A21 NA Example using un labelled parameters 230 omxGetRAMDepth Read in some demo data data demoOneFactor Grab the names for manifestVars manifestVars lt names demoOneFactor nVar length manifestVars 5 variables factorModel mxModel One Factor mxMatrix name A type Full nrow nVar ncol 1 values 0 2 free TRUE lbound 0 0 labels letters 1 nVar mxMatrix name L type Symm nrow 1 ncol 1 values 1 free FALSE it the U matrix has nVar 5 anonymous free parameters mxMatrix name U type Diag nrow nVar ncol nVar values 1 free TRUE mxAlgebra expression A a
291. xpectationRAM and LISREL mxExpectationLISREL models Value A matrix giving the expectation component requested References The OpenMx User s guide can be found at http openmx psyc virginia edu documentation Examples require OpenMx manifests lt paste x 1 5 latents lt c G factorModel mxModel One Factor type RAM manifestVars manifests latentVars latents mxPath from latents to manifests mxPath from manifests arrows 2 mxGREMLDataHandler 151 mxPath from latents arrows 2 free FALSE values 1 0 mxPath from one to manifests mxGetExpected factorModel covariance oops Starting values indicate a zero covariance matrix Probably should adjust them mxGREMLDataHandler Helper Function for Structuring GREML Data Description This function takes dataframe or matrix and uses it to setup the y and X matrices fora GREML analysis this includes trimming out NAs from X and y The result is a matrix the first column of which is the y vector and the remaining columns of which constitute X Usage mxGREMLDataHandler data yvars character Xvars list addOnes TRUE Arguments data yvars Xvars addOnes blockByPheno staggerZeroes blockByPheno TRUE staggerZeroes TRUE Either a dataframe or matrix with column names containing the variables to be used as phenotypes and covariates in y and X
292. ype NA name NA Arguments model This argument is either an MxModel object or a string If model is an Mx Model object then all elements of that model are placed in the resulting Mx Model object If model is a string then a new model is created with the string as its name If model is either unspecified or model is a named entity data source or MxPath object then a new model is created mxModel 169 An arbitrary number of mxMatrix mxPath mxData and other functions such as mxConstraints and mxCI These will all be added or removed from the model as specified in the model argument based on the remove argument manifestVars For RAM type models A list of manifest variables to be included in the model latentVars For RAM type models A list of latent variables to be included in the model remove logical If TRUE elements listed in this statement are removed from the original model If FALSE elements listed in this statement are added to the original model independent logical If TRUE then the model is evaluated independently of other models type character vector The model type to assign to this model Defaults to op tions mxDefaultType See below for valid types name An optional character vector indicating the name of the object Details The mxModel function is used to create MxModel objects Objects created by this function may be new or may be modified versions of existing MxModel ob
Download Pdf Manuals
Related Search
Related Contents
個人用火災総合保険「ほ~むジャパン」( PDF Télécharger Programme de la saison 2013-2014 ATS22D88Q - Schneider Electric Mode d`emploi du convertisseur pour l`élève manual de instrucciones certificado de garantia ワゴン取扱説明書 - Garage User`s Manual 取扱説明書(J) Kärcher K 3.150 Les services au candidat Copyright © All rights reserved.
Failed to retrieve file