Last active
October 8, 2025 21:50
-
-
Save cbaragao/d46afc5a9ea1f0bc98b2d8757c7c6597 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (df as table, independent as text, dependent as text)=> | |
| let | |
| Source = | |
| R.Execute( | |
| "df <- dataset " & | |
| "#(lf)logit <- glm(" & dependent & " ~ " & independent & ", data = df, family = ""binomial"")" & | |
| "#(lf)df$Predicted <- predict(logit, newdata = df, type = ""response"")" & | |
| "#(lf)df$Prediction <- ifelse(df$Predicted > 0.5, 1, 0)" & | |
| "#(lf)df", [dataset=df]), | |
| Return = Source{[Name="df"]}[Value] | |
| in | |
| Return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment