{"action":"created","issue":{"url":"https://api.github.com/repos/OpenMx/OpenMx/issues/23","repository_url":"https://api.github.com/repos/OpenMx/OpenMx","labels_url":"https://api.github.com/repos/OpenMx/OpenMx/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/OpenMx/OpenMx/issues/23/comments","events_url":"https://api.github.com/repos/OpenMx/OpenMx/issues/23/events","html_url":"https://github.com/OpenMx/OpenMx/issues/23","id":252876960,"number":23,"title":"Check for NAs in definition variables (data.varName labels)","user":{"login":"tbates","id":736156,"avatar_url":"https://avatars3.githubusercontent.com/u/736156?v=4","gravatar_id":"","url":"https://api.github.com/users/tbates","html_url":"https://github.com/tbates","followers_url":"https://api.github.com/users/tbates/followers","following_url":"https://api.github.com/users/tbates/following{/other_user}","gists_url":"https://api.github.com/users/tbates/gists{/gist_id}","starred_url":"https://api.github.com/users/tbates/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbates/subscriptions","organizations_url":"https://api.github.com/users/tbates/orgs","repos_url":"https://api.github.com/users/tbates/repos","events_url":"https://api.github.com/users/tbates/events{/privacy}","received_events_url":"https://api.github.com/users/tbates/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-08-25T11:49:25Z","updated_at":"2017-08-25T12:25:28Z","closed_at":null,"body":"IIRC, we used to check for NAs in definition variables and halt. But this isn't happening now. We should.\r\n\r\n_Background_: I was getting odd results building a new model with algebras and definition variables. Everything looked OK, but the model was returning start values and code RED).\r\n\r\nTurns out the issue is that the definition variables contained NAs, but the model didn't report this... no idea what it did when it hit them, in fact.\r\n\r\nHere's a quick model which I think should trigger a **stop**(\"_definition vars 'data.wt2' can't have missing values..._\") error.\r\n\r\n```splus\r\nrequire(umx)\r\ndata(twinData) # ?twinData from Australian twins.\r\nfit1 = mxModel(\"fit1\",\r\n\tmxMatrix(name=\"x\", \"Full\", nrow=1, ncol=1, free=F, values=1),\r\n\tmxMatrix(name=\"def\", \"Full\", nrow=1, ncol=1, free=F, labels= \"data.wt2\"),\r\n\tmxAlgebra(x %*% def, name=\"prod\"),\r\n\tmxFitFunctionAlgebra(\"prod\"),\r\n\tmxData(twinData[,\"wt2\", drop=F], type=\"raw\")\r\n)\r\n# ====================\r\n# = This should fail =\r\n# ====================\r\nfit1 = mxRun(fit1) \r\n# Because...\r\nsum(complete.cases(twinData$wt2))\r\n[1] 86\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/OpenMx/OpenMx/issues/comments/324904457","html_url":"https://github.com/OpenMx/OpenMx/issues/23#issuecomment-324904457","issue_url":"https://api.github.com/repos/OpenMx/OpenMx/issues/23","id":324904457,"user":{"login":"mcneale","id":2318093,"avatar_url":"https://avatars3.githubusercontent.com/u/2318093?v=4","gravatar_id":"","url":"https://api.github.com/users/mcneale","html_url":"https://github.com/mcneale","followers_url":"https://api.github.com/users/mcneale/followers","following_url":"https://api.github.com/users/mcneale/following{/other_user}","gists_url":"https://api.github.com/users/mcneale/gists{/gist_id}","starred_url":"https://api.github.com/users/mcneale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcneale/subscriptions","organizations_url":"https://api.github.com/users/mcneale/orgs","repos_url":"https://api.github.com/users/mcneale/repos","events_url":"https://api.github.com/users/mcneale/events{/privacy}","received_events_url":"https://api.github.com/users/mcneale/received_events","type":"User","site_admin":false},"created_at":"2017-08-25T12:25:28Z","updated_at":"2017-08-25T12:25:28Z","body":"In classic Mx, rows with NA for any definition variable were dropped - declaring variables as definition variables did this automatically.  However, I don’t know whether this behavior is inherent in OpenMx.  If it were (it’s not unreasonable) then I think it should be noted somewhere (summary? or during fitting) that x many rows of the data have been eliminated.  Number of statistics would be a bit too cryptic by itself.  Or simply stop and offer user syntax to clean out NA’s manually.\r\n\r\nCheers\r\nMike\r\n\r\nMichael C. Neale, Ph.D.\r\nProfessor, Virginia Institute for Psychiatric and Behavioral Genetics\r\nVirginia Commonwealth University\r\nShipping Address: 800 East Leigh St. Suite 1-156, Richmond VA 23219-1534\r\nMailing Address : Box 980126 Richmond VA 23298-0126\r\nTelephone: (804) 828-3369  michael.neale@vcuhealth.org<mailto:michael.neale@vcuhealth.org>\r\n\r\nOn Aug 25, 2017, at 7:49 AM, Tim Bates <notifications@github.com<mailto:notifications@github.com>> wrote:\r\n\r\n\r\nIIRC, we used to check for NAs in definition variables and halt. But this isn't happening now. We should.\r\n\r\nBackground: I was getting odd results building a new model with algebras and definition variables. Everything looked OK, but the model was returning start values and code RED).\r\n\r\nTurns out the issue is that the definition variables contained NAs, but the model didn't report this... no idea what it did when it hit them, in fact.\r\n\r\nHere's a quick model which I think should trigger a stop(\"definition vars 'data.wt2' can't have missing values...\") error.\r\n\r\nrequire(umx)\r\ndata(twinData) # ?twinData from Australian twins.\r\nfit1 = mxModel(\"fit1\",\r\n        mxMatrix(name=\"x\", \"Full\", nrow=1, ncol=1, free=F, values=1),\r\n        mxMatrix(name=\"def\", \"Full\", nrow=1, ncol=1, free=F, labels= \"data.wt2\"),\r\n        mxAlgebra(x %*% def, name=\"prod\"),\r\n        mxFitFunctionAlgebra(\"prod\"),\r\n        mxData(twinData[,\"wt2\", drop=F], type=\"raw\")\r\n)\r\n# ====================\r\n# = This should fail =\r\n# ====================\r\nfit1 = mxRun(fit1)\r\n# Because...\r\nsum(complete.cases(twinData$wt2))\r\n[1] 86\r\n\r\n\r\n—\r\nYou are receiving this because you are subscribed to this thread.\r\nReply to this email directly, view it on GitHub<https://github.com/OpenMx/OpenMx/issues/23>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ACNfDTul9YL2-Yoh1KI8hktFP9PF0fGHks5sbrTFgaJpZM4PCj2H>.\r\n\r\n"}}
{"actor":{"display_login":"mcneale"}}