Hello,
I'm trying to use a radio button to update the distribution of my piece wise linear regression macro. I copied the glm tool macro language to pull in the distribution of the glm as such:
is.XDF <- FALSE
if (!is.XDF) {
if ('%Question.Quasipoisson%' == "True")
the.family <- "quasipoisson(link='log')"
if ('%Question.Gamma%' == "True")
the.family <- "gamma(link='log')"
} else {
the.family <- "quasipoisson(link='log')"
}
# Create a string of the potential predictors seperated by plus signs
the_preds <- paste(names(the_data)[-1], collapse = " + ")
# Get the name of the target field
the_target <- names(the_data)[1]
# Create a formula expression from the names of the target and predictors
the_form <- as.formula(paste(the_target, the_preds, sep = " ~ "))
# Run the model
fit1 <- glm(the_form, "family = " the.family , data = the_data)
#
And I do not have the radio buttons connected to anything (like the count regression tool has it set up):

I'm not sure why the code is not working. The error I get is unexpected symbol in "fit1 <- glm(the_form, "family =" the.family