Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in BI by (11.1k points)
edited by

I am trying to connect logistic regression through tableau and r integration

SCRIPT_REAL('dat <- data.frame(DEP_VAR=.arg1, IND_VAR1=.arg2, 
IND_VAR2=.arg3, IND_VAR3=.arg4);
model <- glm(DEP_VAR~IND_VAR1+IND_VAR2+IND_VAR3, data = 
dat, family = binomial(link = "logit"));
prob <- predict(model,newdata=dat,type="response")',
AVG([DEP_VAR]), AVG([IND_VAR1]), AVG([IND_VAR2]), AVG([IND_VAR3]))

I have tried this Tableau script and getting an error

 Error in base::parse(text = .cmd) : :1:32: unexpected symbol 1: dat <- data.frame(DEP_VAR=.arg1, IND_VAR1 ^"

1 Answer

0 votes
by (22.5k points)

Follow the following script

SCRIPT_REAL('
model <- glm(DEP_VAR~IND_VAR1+IND_VAR2+IND_VAR3, family = binomial(link = 
"logit"));
model$fitted.values
',
AVG([DEP_VAR]), AVG([IND_VAR1]), AVG([IND_VAR2]), AVG([IND_VAR3]))

 If you want to learn more about it Tableau, then go through this Tableau Training for more insights.   

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Dec 29, 2020 in BI by dev_sk2311 (45k points)
0 votes
1 answer
asked Dec 29, 2020 in BI by dev_sk2311 (45k points)
0 votes
1 answer

Browse Categories

...