Summary method for the logistic function

# S3 method for logistic
summary(object, sum_check = "", conf_lev = 0.95, test_var = "", dec = 3, ...)

Arguments

object

Return value from logistic

sum_check

Optional output. "vif" to show multicollinearity diagnostics. "confint" to show coefficient confidence interval estimates. "odds" to show odds ratios and confidence interval estimates.

conf_lev

Confidence level to use for coefficient and odds confidence intervals (.95 is the default)

test_var

Variables to evaluate in model comparison (i.e., a competing models Chi-squared test)

dec

Number of decimals to show

...

further arguments passed to or from other methods

Details

See https://radiant-rstats.github.io/docs/model/logistic.html for an example in Radiant

See also

logistic to generate the results

plot.logistic to plot the results

predict.logistic to generate predictions

plot.model.predict to plot prediction output

Examples

result <- logistic(titanic, "survived", "pclass", lev = "Yes") result <- logistic(titanic, "survived", "pclass", lev = "Yes") summary(result, test_var = "pclass")
#> Logistic regression (GLM) #> Data : titanic #> Response variable : survived #> Level : Yes in survived #> Explanatory variables: pclass #> Null hyp.: there is no effect of pclass on survived #> Alt. hyp.: there is an effect of pclass on survived #> #> OR OR% coefficient std.error z.value p.value #> (Intercept) 0.553 0.124 4.469 < .001 *** #> pclass|2nd 0.453 -54.7% -0.791 0.176 -4.506 < .001 *** #> pclass|3rd 0.204 -79.6% -1.588 0.160 -9.919 < .001 *** #> #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 #> #> Pseudo R-squared: 0.076 #> Log-likelihood: -651.734, AIC: 1309.468, BIC: 1324.317 #> Chi-squared: 106.517 df(2), p.value < .001 #> Nr obs: 1,043 #> #> Model 1: survived ~ 1 #> Model 2: survived ~ pclass #> Pseudo R-squared, Model 1 vs 2: 0 0.076 #> Chi-squared: 106.517 df(2), p.value < .001
res <- logistic(titanic, "survived", c("pclass", "sex"), int = "pclass:sex", lev = "Yes") summary(res, sum_check = c("vif", "confint", "odds"))
#> Logistic regression (GLM) #> Data : titanic #> Response variable : survived #> Level : Yes in survived #> Explanatory variables: pclass, sex #> Null hyp.: there is no effect of x on survived #> Alt. hyp.: there is an effect of x on survived #> #> OR OR% coefficient std.error z.value p.value #> (Intercept) 3.227 0.456 7.079 < .001 *** #> pclass|2nd 0.332 -66.8% -1.103 0.556 -1.982 0.047 * #> pclass|3rd 0.036 -96.4% -3.332 0.484 -6.886 < .001 *** #> sex|male 0.021 -97.9% -3.842 0.487 -7.893 < .001 *** #> pclass|2nd:sex|male 0.949 -5.1% -0.052 0.624 -0.084 0.933 #> pclass|3rd:sex|male 10.570 957.0% 2.358 0.533 4.427 < .001 *** #> #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 #> #> Pseudo R-squared: 0.315 #> Log-likelihood: -483.189, AIC: 978.377, BIC: 1008.076 #> Chi-squared: 443.608 df(5), p.value < .001 #> Nr obs: 1,043 #> #> Variance Inflation Factors #> pclass:sex pclass sex #> VIF 29.262 18.925 8.241 #> Rsq 0.966 0.947 0.879 #>
#> Waiting for profiling to be done...
#> coefficient 2.5% 97.5% +/- #> (Intercept) 3.227 2.439 4.265 1.038 #> pclass|2nd -1.103 -2.286 -0.056 1.047 #> pclass|3rd -3.332 -4.412 -2.476 0.856 #> sex|male -3.842 -4.926 -2.980 0.862 #> pclass|2nd:sex|male -0.052 -1.243 1.243 1.295 #> pclass|3rd:sex|male 2.358 1.389 3.513 1.155 #> #> odds ratio 2.5% 97.5% #> pclass|2nd 0.332 0.102 0.946 #> pclass|3rd 0.036 0.012 0.084 #> sex|male 0.021 0.007 0.051 #> pclass|2nd:sex|male 0.949 0.289 3.465 #> pclass|3rd:sex|male 10.570 4.010 33.553 #>
titanic %>% logistic("survived", c("pclass", "sex", "age"), lev = "Yes") %>% summary("vif")
#> Logistic regression (GLM) #> Data : . #> Response variable : survived #> Level : Yes in survived #> Explanatory variables: pclass, sex, age #> Null hyp.: there is no effect of x on survived #> Alt. hyp.: there is an effect of x on survived #> #> OR OR% coefficient std.error z.value p.value #> (Intercept) 3.515 0.327 10.753 < .001 *** #> pclass|2nd 0.280 -72.0% -1.274 0.226 -5.649 < .001 *** #> pclass|3rd 0.102 -89.8% -2.283 0.226 -10.104 < .001 *** #> sex|male 0.083 -91.7% -2.491 0.166 -14.997 < .001 *** #> age 0.966 -3.4% -0.034 0.006 -5.438 < .001 *** #> #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 #> #> Pseudo R-squared: 0.304 #> Log-likelihood: -490.864, AIC: 991.728, BIC: 1016.477 #> Chi-squared: 428.257 df(4), p.value < .001 #> Nr obs: 1,043 #> #> Variance Inflation Factors #> pclass age sex #> VIF 1.413 1.352 1.053 #> Rsq 0.292 0.260 0.050 #>