strengejacke / sjstats

Effect size measures and significance tests
https://strengejacke.github.io/sjstats
189 stars 21 forks source link

use `is_count` instead of `is_pois` for count model in `model_family()` #62

Closed strengejacke closed 5 years ago

strengejacke commented 5 years ago

Currently, model_family() returns $is_pois, which is true for any count model, including negative binomial models. This value should be renamed into $is_count, and - in the long run - $is_pois should only be TRUE for poisson-models.

library(sjstats)
counts <- c(18,17,15,20,10,20,25,13,12)
outcome <- gl(3,1,9)
treatment <- gl(3,3)

m <- glm(counts ~ outcome + treatment, family = poisson())
model_family(m)
#> $is_bin
#> [1] FALSE
#> 
#> $is_pois
#> [1] TRUE
#> 
#> $is_negbin
#> [1] FALSE
#> 
#> $is_logit
#> [1] FALSE
#> 
#> $is_linear
#> [1] FALSE
#> 
#> $is_zeroinf
#> [1] FALSE
#> 
#> $is_ordinal
#> [1] FALSE
#> 
#> $is_categorical
#> [1] FALSE
#> 
#> $is_multivariate
#> [1] FALSE
#> 
#> $is_trial
#> [1] FALSE
#> 
#> $link.fun
#> [1] "log"
#> 
#> $family
#> [1] "poisson"