ez.logistics: glm(y~x+covar,family=binomial), for many y and/or many x

View source: R/stats.R

ez.logisticsR Documentation

glm(y~x+covar,family=binomial), for many y and/or many x

Description

glm(y~x+covar,family=binomial), for many y and/or many x

Usage

ez.logistics(
  df,
  y,
  x,
  covar = NULL,
  report = T,
  view = F,
  plot = F,
  pmethods = c("bonferroni", "fdr"),
  cols = 3,
  point.size = 10,
  point.shape = 16,
  lab.size = 18,
  text.size = 16,
  error = T,
  pe = F,
  ...
)

Arguments

df

a data frame. Internally go through dropna (no ez.2value, scale)
glm can handel X factor by default (dummy coding), but not Y factor (You can't have factor/categorical response variables); see below
I do not do standarization here, because
While standardized coefficients in classic linear regression are well-defined,
logistic regression, like other generalized linear models, present additional complexity as a result of
the non-linear link function (logit), and non-normal error function (binomial).
https://think-lab.github.io/d/205/

y

compatible with ez.selcol, could not be factor, has to be 0/1

x

compatible with ez.selcol, can auto dummy coding factors

covar

NULL=no covar, compatible with ez.selcol

report

print results (in APA format)

view

call View(result)

plot

T/F, the black dash line is bonferroni p = 0.05 (again for tests only with a non-NA p values), the grey black dash is uncorrected p = 0.05

pmethods

c('bonferroni','fdr'), type p.adjust.methods for all methods. This correction applies for all possible tests that have been/could be done.

cols

number of columns for multiplot. NULL=auto calculate

error

whether show error message when error occurs

Value

an invisible data frame or list of data frame (if many y and many x)
odds_ratio: odds ratio=exp(b), one unit increase in x result in the odds of being 1 for y "OR" times the odds of being 0 for y
so that the variances of dependent and independent variables are 1.
Therefore, standardized coefficients refer to how many standard deviations a dependent variable will change,
per standard deviation increase in the predictor variable.

dof


jerryzhujian9/ezmisc documentation built on March 9, 2024, 12:44 a.m.