You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But need to be careful that modelObject$model exists for all types of allowable model classes.
A good test would be to try to do a spline model (e.g., y ~ bs(x1, df=5))
Behavior (pseudocode):
modelType <- class(modelObject)
if(modelType)=="lm" {
nodeType <- "dnorm";
nodeFormula <- [ extract fitted regression equation from modelObject ]
} else if(modelType == "glm") {
nodeType <- [logic to see which family was used for the glm]
[behavior slightly varies depending on nodeType - may or may not need to specify error distribution]
} else {
nodeType <- "dcat";
[ set multinomial logistic regression equations using the multinom object ]
}
The text was updated successfully, but these errors were encountered:
Within setNode(), we could have a new parameter called modelObject.
Error Checking:
Logic/error checking to ensure class(modelObject) %in% c("lm","glm","multinom",<any others?>)
Logic/error checking to ensure all variables showing up in model equation actually are parents of the node in the graph. Something like:
length(setdiff(setdiff(names(modelObject$model), node), parents("d.dimer", net$dag))) == 0
But need to be careful that modelObject$model exists for all types of allowable model classes.
A good test would be to try to do a spline model (e.g., y ~ bs(x1, df=5))
Behavior (pseudocode):
modelType <- class(modelObject)
if(modelType)=="lm" {
nodeType <- "dnorm";
nodeFormula <- [ extract fitted regression equation from modelObject ]
} else if(modelType == "glm") {
nodeType <- [logic to see which family was used for the glm]
[behavior slightly varies depending on nodeType - may or may not need to specify error distribution]
} else {
nodeType <- "dcat";
[ set multinomial logistic regression equations using the multinom object ]
}
The text was updated successfully, but these errors were encountered: