I am trying to run logistic regressions on a bunch of dependent variables 
like so:

using GLM

outcomes = [:mort30d, :readmit, :reoper, :sar]

for i in 1:length(outcomes)
logit_$(outcomes[i])_unadjusted = glm($(outcomes[i]) ~ race, puf, 
Binomial(),LogitLink())
dump(coef(logit_$(outcomes[i])_unadjusted))
end

Here I want to run the logistic regression four times, once for each 
outcome, and save the return values into four different memory objects:

logit_mort30d_unadjusted
logit_readmit_unadjusted
etc

The glm... part works fine with the interpolation, $(outcomes[i]), but I 
cannot create the memory objects in this way. Is there any way I can use 
some method of string interpolation to this end?


 

Reply via email to