Last active
October 8, 2025 21:35
-
-
Save cbaragao/11039b8cf598d5a84e1e37eeaae4eee1 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, family as text)=> | |
| let | |
| Source = | |
| R.Execute( | |
| "df <- dataset" & | |
| "#(lf)logit <- glm(" & dependent & " ~ " & independent & ", data = df, family = """ & family &""") " & | |
| "#(lf)summary_model <- summary(logit) " & | |
| "#(lf)coef_df <- as.data.frame(summary_model$coefficients) " & | |
| "#(lf)coef_df$Variable <- rownames(coef_df) " & | |
| "#(lf)coef_df <- coef_df[, c(""Variable"", ""Estimate"", ""Std. Error"", ""z value"", ""Pr(>|z|)"")] " & | |
| "#(lf)colnames(coef_df) <- c(""Variable"", ""Estimate"", ""Std_Error"", ""Z_value"", ""P_value"")" & | |
| "#(lf)coef_df$Significant <- coef_df$P_value <= 0.05",[dataset = df]) | |
| in | |
| Source{[Name="coef_df"]}[Value] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment