Search code examples
juliaglm

Use julia glm package for logistic regression while only calculate the coefficients


I am using Julia package glm for logistic regressions. The julia code is below

using GLM
logit = glm(@formula(Y ~ X), my_data, Bernoulli(), LogitLink())

The code will calculate the estimated intercept and slope with the standard error, z value, p value and confidence interval. But I only need the estimated intercept and slope. I don't want Julia calculate anything else except the the intercept and slope. I have a big data set, I am running the logistic regression for a lot of Y but only one X. Since I only need the estimated intercept and slope, if julia also calculate other statistics, it will take a long time.


Solution

  • Z values, p values and confidence intervals are computed in the coeftable() function that is called by the show method.

    Your original code but with a semicolon at the end (to suppress show()) should skip these calculations.