{"action":"created","issue":{"url":"https://api.github.com/repos/nutterb/Hyde/issues/6","labels_url":"https://api.github.com/repos/nutterb/Hyde/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/nutterb/Hyde/issues/6/comments","events_url":"https://api.github.com/repos/nutterb/Hyde/issues/6/events","html_url":"https://github.com/nutterb/Hyde/issues/6","id":57724058,"number":6,"title":"Get Node Distributions from Model Object","user":{"login":"jdutch27","id":7571400,"avatar_url":"https://avatars.githubusercontent.com/u/7571400?v=3","gravatar_id":"","url":"https://api.github.com/users/jdutch27","html_url":"https://github.com/jdutch27","followers_url":"https://api.github.com/users/jdutch27/followers","following_url":"https://api.github.com/users/jdutch27/following{/other_user}","gists_url":"https://api.github.com/users/jdutch27/gists{/gist_id}","starred_url":"https://api.github.com/users/jdutch27/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdutch27/subscriptions","organizations_url":"https://api.github.com/users/jdutch27/orgs","repos_url":"https://api.github.com/users/jdutch27/repos","events_url":"https://api.github.com/users/jdutch27/events{/privacy}","received_events_url":"https://api.github.com/users/jdutch27/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nutterb/Hyde/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-15T09:18:08Z","updated_at":"2015-02-20T17:08:17Z","closed_at":"2015-02-20T17:08:17Z","body":"Within setNode(), we could have a new parameter called modelObject.\r\n\r\n----------------------------------------------------\r\nError Checking:\r\n\r\nLogic/error checking to ensure class(modelObject) %in% c(\"lm\",\"glm\",\"multinom\",<any others?>)\r\n\r\nLogic/error checking to ensure all variables showing up in model equation actually are parents of the node in the graph.  Something like:\r\n\r\nlength(setdiff(setdiff(names(modelObject$model), node), parents(\"d.dimer\", net$dag))) == 0\r\n\r\nBut need to be careful that modelObject$model exists for all types of  allowable model classes.\r\n\r\nA good test would be to try to do a spline model (e.g., y ~ bs(x1, df=5))\r\n\r\n----------------------------------------------------\r\nBehavior (pseudocode):\r\n\r\nmodelType <- class(modelObject)\r\n\r\nif(modelType)==\"lm\"  {\r\n  nodeType <- \"dnorm\";\r\n  nodeFormula <- [ extract fitted regression equation from modelObject ]\r\n} else if(modelType == \"glm\") {\r\n  nodeType <- [logic to see which family was used for the glm]\r\n  [behavior slightly varies depending on nodeType - may or may not need to specify error distribution]\r\n} else {\r\n  nodeType <- \"dcat\";\r\n  [ set multinomial logistic regression equations using the multinom object ]\r\n}\r\n  \r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/nutterb/Hyde/issues/comments/75276964","html_url":"https://github.com/nutterb/Hyde/issues/6#issuecomment-75276964","issue_url":"https://api.github.com/repos/nutterb/Hyde/issues/6","id":75276964,"user":{"login":"nutterb","id":1848445,"avatar_url":"https://avatars.githubusercontent.com/u/1848445?v=3","gravatar_id":"","url":"https://api.github.com/users/nutterb","html_url":"https://github.com/nutterb","followers_url":"https://api.github.com/users/nutterb/followers","following_url":"https://api.github.com/users/nutterb/following{/other_user}","gists_url":"https://api.github.com/users/nutterb/gists{/gist_id}","starred_url":"https://api.github.com/users/nutterb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nutterb/subscriptions","organizations_url":"https://api.github.com/users/nutterb/orgs","repos_url":"https://api.github.com/users/nutterb/repos","events_url":"https://api.github.com/users/nutterb/events{/privacy}","received_events_url":"https://api.github.com/users/nutterb/received_events","type":"User","site_admin":false},"created_at":"2015-02-20T17:08:17Z","updated_at":"2015-02-20T17:08:17Z","body":"Implemented on 20 Feb 2015"}}