
1. Re: Logistic Regression in R  Grouping the Probabilities by Dimension
Bora Beran Feb 16, 2016 2:11 PM (in response to Ed Kukec)Hi Ed,
Yes. This is in fact very easy. SCRIPT_ functions are table calculations and Tableau will call the function once for each partition in your dataset.
So if you click on the pill that contains this function and select Edit Table Calculation and go to Advanced... setting in the compute using drop down and make sure Patient Type is in the box that says Partitioning, you should get the results you're looking for.
Thanks,
Bora

2. Re: Logistic Regression in R  Grouping the Probabilities by Dimension
Ed Kukec Feb 17, 2016 6:09 AM (in response to Bora Beran)Thanks a lot Bora, that seemed to work. Another quick question if I may. I would like to export the results, ie coefficients, standard errors and odds ratios from my logistic regression to some format such as excel but I haven't been able to find a way to do it correctly. There is some sort of summary and write function but the syntax and how to call these functions in Tableau seems to escape me. Here's my regression script below, was hoping you could add in the necessary bits and tell me how to call these procedures since Tableau doesn't really have an R command line to do it. We can just call the results table "results.csv" or something and export it to the root of my C Drive.
SCRIPT_REAL("
admitstatus < .arg1
age < as.factor(.arg2)
triagecode < as.factor(.arg3)
cci_score < .arg4
gender < as.factor(.arg5)
fit < glm(admitstatus ~ age + triagecode + cci_score + gender,family = binomial(logit))
prob < predict(fit,type = 'response')
fit$fitted
",
avg([Admit Status] ),attr([Age Group]),attr([Triagecode]), avg([Cci Score Without Age]), ATTR([Gender])
)
Thanks,
Ed

3. Re: Logistic Regression in R  Grouping the Probabilities by Dimension
Abhishek Pandya Nov 7, 2016 4:18 AM (in response to Ed Kukec)Hi ED KUKEC,
Please find the attached snap for the same, you need to Export it to Excel.
Thanks
Abhi.