Giter Site home page Giter Site logo

Comments (3)

IndrajeetPatil avatar IndrajeetPatil commented on September 3, 2024

This is because there are not enough observations to compute bootstrapped confidence intervals for the effect size (epsilon-squared).

You can see that the error actually traces back to rcompanion::epsilonSquared, which is what ggstatsplot uses in the backdrop to compute effect size + CIs.

# dataframe
r2 <- data.frame(
  treatment = c("a", "a", "a", "a", "a", "e", "f"),
  Age = 1:7,
  Group = c("G2", "G2", "G2", "G2", "G2", "G2", "G2"),
  stringsAsFactors = F
)

# effect size measure
rcompanion::epsilonSquared(x = r2$Age, g = r2$treatment, ci = FALSE)
#> epsilon.squared 
#>           0.643

# effect size measure + CI
rcompanion::epsilonSquared(x = r2$Age, g = r2$treatment, ci = TRUE)
#> Error in kruskal.test.default(Input$x, Input$g): all observations are in the same group

Created on 2019-09-10 by the reprex package (v0.3.0)

Session info
devtools::session_info()
#> - Session info ----------------------------------------------------------
#>  setting  value                       
#>  version  R version 3.6.1 (2019-07-05)
#>  os       Windows 10 x64              
#>  system   x86_64, mingw32             
#>  ui       RTerm                       
#>  language (EN)                        
#>  collate  English_United States.1252  
#>  ctype    English_United States.1252  
#>  tz       Europe/Berlin               
#>  date     2019-09-10                  
#> 
#> - Packages --------------------------------------------------------------
#>  package      * version    date       lib source                        
#>  assertthat     0.2.1      2019-03-21 [1] CRAN (R 3.6.0)                
#>  backports      1.1.4      2019-04-10 [1] CRAN (R 3.6.0)                
#>  boot           1.3-23     2019-07-05 [1] CRAN (R 3.6.1)                
#>  callr          3.3.1      2019-07-18 [1] CRAN (R 3.6.1)                
#>  cli            1.1.0      2019-03-19 [1] CRAN (R 3.6.0)                
#>  codetools      0.2-16     2018-12-24 [1] CRAN (R 3.5.2)                
#>  coin           1.3-1      2019-08-28 [1] CRAN (R 3.6.1)                
#>  crayon         1.3.4      2017-09-16 [1] CRAN (R 3.5.1)                
#>  desc           1.2.0      2019-04-03 [1] Github (r-lib/desc@c860e7b)   
#>  DescTools      0.99.28    2019-03-17 [1] CRAN (R 3.6.0)                
#>  devtools       2.2.0      2019-09-07 [1] CRAN (R 3.6.1)                
#>  digest         0.6.20     2019-07-04 [1] CRAN (R 3.6.0)                
#>  DT             0.8        2019-08-07 [1] CRAN (R 3.6.1)                
#>  ellipsis       0.2.0.1    2019-07-02 [1] CRAN (R 3.6.0)                
#>  EMT            1.1        2013-01-29 [1] CRAN (R 3.5.2)                
#>  evaluate       0.14       2019-05-28 [1] CRAN (R 3.6.0)                
#>  expm           0.999-4    2019-03-21 [1] CRAN (R 3.6.0)                
#>  foreign        0.8-71     2018-07-20 [2] CRAN (R 3.6.1)                
#>  fs             1.3.1      2019-05-06 [1] CRAN (R 3.6.0)                
#>  glue           1.3.1      2019-03-12 [1] CRAN (R 3.6.0)                
#>  highr          0.8        2019-03-20 [1] CRAN (R 3.6.0)                
#>  htmltools      0.3.6      2017-04-28 [1] CRAN (R 3.5.1)                
#>  htmlwidgets    1.3        2018-09-30 [1] CRAN (R 3.5.1)                
#>  knitr          1.24       2019-08-08 [1] CRAN (R 3.6.1)                
#>  lattice        0.20-38    2018-11-04 [2] CRAN (R 3.6.1)                
#>  libcoin        1.0-5      2019-08-27 [1] CRAN (R 3.6.1)                
#>  lmtest         0.9-37     2019-04-30 [1] CRAN (R 3.6.0)                
#>  magrittr       1.5        2014-11-22 [1] CRAN (R 3.5.1)                
#>  manipulate     1.0.1      2014-12-24 [1] CRAN (R 3.5.0)                
#>  MASS           7.3-51.4   2019-03-31 [1] CRAN (R 3.6.0)                
#>  Matrix         1.2-17     2019-03-22 [1] CRAN (R 3.6.0)                
#>  matrixStats    0.55.0     2019-09-07 [1] CRAN (R 3.6.1)                
#>  memoise        1.1.0      2017-04-21 [1] CRAN (R 3.6.0)                
#>  modeltools     0.2-22     2018-07-16 [1] CRAN (R 3.5.1)                
#>  multcomp       1.4-10     2019-03-05 [1] CRAN (R 3.5.2)                
#>  multcompView   0.1-7      2015-07-31 [1] CRAN (R 3.5.1)                
#>  mvtnorm        1.0-11     2019-06-19 [1] CRAN (R 3.6.0)                
#>  nortest        1.0-4      2015-07-30 [1] CRAN (R 3.5.2)                
#>  pkgbuild       1.0.5      2019-08-26 [1] CRAN (R 3.6.1)                
#>  pkgload        1.0.2      2018-10-29 [1] CRAN (R 3.6.0)                
#>  plyr           1.8.4      2016-06-08 [1] CRAN (R 3.5.1)                
#>  prettyunits    1.0.2      2015-07-13 [1] CRAN (R 3.5.1)                
#>  processx       3.4.1      2019-07-18 [1] CRAN (R 3.6.1)                
#>  ps             1.3.0      2018-12-21 [1] CRAN (R 3.6.0)                
#>  R6             2.4.0      2019-02-14 [1] CRAN (R 3.6.0)                
#>  rcompanion     2.3.0      2019-08-27 [1] local                         
#>  Rcpp           1.0.2      2019-07-25 [1] CRAN (R 3.6.1)                
#>  remotes        2.1.0      2019-06-24 [1] CRAN (R 3.6.0)                
#>  rlang          0.4.0      2019-06-25 [1] CRAN (R 3.6.0)                
#>  rmarkdown      1.15       2019-08-21 [1] CRAN (R 3.6.1)                
#>  rprojroot      1.3-2      2018-01-03 [1] CRAN (R 3.5.1)                
#>  sandwich       2.5-1      2019-04-06 [1] CRAN (R 3.6.0)                
#>  sessioninfo    1.1.1      2018-11-05 [1] CRAN (R 3.6.0)                
#>  stringi        1.4.3      2019-03-12 [1] CRAN (R 3.6.0)                
#>  stringr        1.4.0      2019-02-10 [1] CRAN (R 3.6.0)                
#>  survival       2.44-1.1   2019-04-01 [2] CRAN (R 3.6.1)                
#>  testthat       2.2.1      2019-07-25 [1] CRAN (R 3.6.1)                
#>  TH.data        1.0-10     2019-01-21 [1] CRAN (R 3.5.2)                
#>  usethis        1.5.1.9000 2019-09-01 [1] Github (r-lib/usethis@4377307)
#>  withr          2.1.2      2018-03-15 [1] CRAN (R 3.5.1)                
#>  xfun           0.9        2019-08-21 [1] CRAN (R 3.6.1)                
#>  yaml           2.2.0      2018-07-25 [1] CRAN (R 3.5.1)                
#>  zoo            1.8-6      2019-05-28 [1] CRAN (R 3.6.0)                
#> 
#> [1] C:/Users/inp099/Documents/R/win-library/3.6
#> [2] C:/Program Files/R/R-3.6.1/library

from statsexpressions.

IndrajeetPatil avatar IndrajeetPatil commented on September 3, 2024

I think this should ideally return NAs for CIs rather than just failing to work completely.

from statsexpressions.

IndrajeetPatil avatar IndrajeetPatil commented on September 3, 2024
# dataframe
r2 <- data.frame(
  treatment = c("a", "a", "a", "a", "a", "e", "f"),
  Age = 1:7,
  Group = c("G2", "G2", "G2", "G2", "G2", "G2", "G2"),
  stringsAsFactors = F
)

# effect size measure
rcompanion::epsilonSquared(x = r2$Age, g = r2$treatment, ci = TRUE)
#>   epsilon.squared lower.ci upper.ci
#> 1           0.643       NA       NA

Created on 2019-12-27 by the reprex package (v0.3.0)

Session info
devtools::session_info()
#> - Session info ---------------------------------------------------------------
#>  setting  value                       
#>  version  R version 3.6.1 (2019-07-05)
#>  os       Windows 10 x64              
#>  system   x86_64, mingw32             
#>  ui       RTerm                       
#>  language (EN)                        
#>  collate  English_United States.1252  
#>  ctype    English_United States.1252  
#>  tz       Europe/Berlin               
#>  date     2019-12-27                  
#> 
#> - Packages -------------------------------------------------------------------
#>  package      * version    date       lib source                        
#>  assertthat     0.2.1      2019-03-21 [1] CRAN (R 3.6.0)                
#>  backports      1.1.5      2019-10-02 [1] CRAN (R 3.6.1)                
#>  boot           1.3-24     2019-12-20 [1] CRAN (R 3.6.1)                
#>  callr          3.4.0      2019-12-09 [1] CRAN (R 3.6.1)                
#>  cli            2.0.0.9000 2019-12-23 [1] Github (r-lib/cli@0293ae7)    
#>  codetools      0.2-16     2018-12-24 [1] CRAN (R 3.5.2)                
#>  coin           1.3-1      2019-08-28 [1] CRAN (R 3.6.1)                
#>  crayon         1.3.4      2017-09-16 [1] CRAN (R 3.5.1)                
#>  desc           1.2.0      2019-11-11 [1] Github (r-lib/desc@61205f6)   
#>  DescTools      0.99.31    2019-12-02 [1] CRAN (R 3.6.1)                
#>  devtools       2.2.1      2019-09-24 [1] CRAN (R 3.6.1)                
#>  digest         0.6.23     2019-11-23 [1] CRAN (R 3.6.1)                
#>  ellipsis       0.3.0      2019-09-20 [1] CRAN (R 3.6.1)                
#>  EMT            1.1        2013-01-29 [1] CRAN (R 3.5.2)                
#>  evaluate       0.14       2019-05-28 [1] CRAN (R 3.6.0)                
#>  expm           0.999-4    2019-03-21 [1] CRAN (R 3.6.0)                
#>  fansi          0.4.0      2018-11-05 [1] Github (brodieG/fansi@ab11e9c)
#>  fs             1.3.1      2019-05-06 [1] CRAN (R 3.6.0)                
#>  glue           1.3.1      2019-03-12 [1] CRAN (R 3.6.0)                
#>  highr          0.8        2019-03-20 [1] CRAN (R 3.6.0)                
#>  htmltools      0.4.0      2019-10-04 [1] CRAN (R 3.6.1)                
#>  knitr          1.26       2019-11-12 [1] CRAN (R 3.6.1)                
#>  lattice        0.20-38    2018-11-04 [2] CRAN (R 3.6.1)                
#>  libcoin        1.0-5      2019-08-27 [1] CRAN (R 3.6.1)                
#>  lmtest         0.9-37     2019-04-30 [1] CRAN (R 3.6.0)                
#>  magrittr       1.5        2014-11-22 [1] CRAN (R 3.5.1)                
#>  MASS           7.3-51.5   2019-12-20 [1] CRAN (R 3.6.1)                
#>  Matrix         1.2-18     2019-11-27 [1] CRAN (R 3.6.1)                
#>  matrixStats    0.55.0     2019-09-07 [1] CRAN (R 3.6.1)                
#>  memoise        1.1.0      2017-04-21 [1] CRAN (R 3.6.0)                
#>  modeltools     0.2-22     2018-07-16 [1] CRAN (R 3.5.1)                
#>  multcomp       1.4-11     2019-12-10 [1] CRAN (R 3.6.1)                
#>  multcompView   0.1-8      2019-12-19 [1] CRAN (R 3.6.1)                
#>  mvtnorm        1.0-11     2019-06-19 [1] CRAN (R 3.6.0)                
#>  nortest        1.0-4      2015-07-30 [1] CRAN (R 3.5.2)                
#>  pkgbuild       1.0.6      2019-10-09 [1] CRAN (R 3.6.1)                
#>  pkgload        1.0.2      2018-10-29 [1] CRAN (R 3.6.0)                
#>  plyr           1.8.5      2019-12-10 [1] CRAN (R 3.6.1)                
#>  prettyunits    1.0.2      2015-07-13 [1] CRAN (R 3.5.1)                
#>  processx       3.4.1      2019-07-18 [1] CRAN (R 3.6.1)                
#>  ps             1.3.0      2018-12-21 [1] CRAN (R 3.6.0)                
#>  R6             2.4.1      2019-11-12 [1] CRAN (R 3.6.1)                
#>  rcompanion     2.3.9      2019-12-27 [1] local                         
#>  Rcpp           1.0.3      2019-11-08 [1] CRAN (R 3.6.1)                
#>  remotes        2.1.0      2019-06-24 [1] CRAN (R 3.6.0)                
#>  rlang          0.4.2.9000 2019-12-24 [1] Github (r-lib/rlang@ce4f717)  
#>  rmarkdown      2.0        2019-12-12 [1] CRAN (R 3.6.1)                
#>  rprojroot      1.3-2      2018-01-03 [1] CRAN (R 3.5.1)                
#>  sandwich       2.5-1      2019-04-06 [1] CRAN (R 3.6.0)                
#>  sessioninfo    1.1.1      2018-11-05 [1] CRAN (R 3.6.0)                
#>  stringi        1.4.3      2019-03-12 [1] CRAN (R 3.6.0)                
#>  stringr        1.4.0      2019-02-10 [1] CRAN (R 3.6.0)                
#>  survival       3.1-8      2019-12-03 [1] CRAN (R 3.6.1)                
#>  testthat       2.3.1      2019-12-01 [1] CRAN (R 3.6.1)                
#>  TH.data        1.0-10     2019-01-21 [1] CRAN (R 3.5.2)                
#>  usethis        1.5.1.9000 2019-12-12 [1] Github (r-lib/usethis@23dd62c)
#>  withr          2.1.2      2018-03-15 [1] CRAN (R 3.5.1)                
#>  xfun           0.11       2019-11-12 [1] CRAN (R 3.6.1)                
#>  yaml           2.2.0      2018-07-25 [1] CRAN (R 3.5.1)                
#>  zoo            1.8-6      2019-05-28 [1] CRAN (R 3.6.0)                
#> 
#> [1] C:/Users/inp099/Documents/R/win-library/3.6
#> [2] C:/Program Files/R/R-3.6.1/library

from statsexpressions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.