{"id":21625729,"url":"https://github.com/dcousin3/cohensdplibrary","last_synced_at":"2025-03-18T19:56:54.387Z","repository":{"id":51769048,"uuid":"324216750","full_name":"dcousin3/CohensdpLibrary","owner":"dcousin3","description":"Tools to compute Cohen's D in both within and between-subject designs; statistics of effect size computed with R.","archived":false,"fork":false,"pushed_at":"2025-03-12T14:47:48.000Z","size":1812,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-12T15:36:44.668Z","etag":null,"topics":["r","statistics"],"latest_commit_sha":null,"homepage":"https://dcousin3.github.io/CohensdpLibrary/","language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dcousin3.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-24T18:40:20.000Z","updated_at":"2025-03-12T14:47:52.000Z","dependencies_parsed_at":"2024-08-22T19:36:07.726Z","dependency_job_id":"7be87112-4e75-4532-8436-f95fd5de4e84","html_url":"https://github.com/dcousin3/CohensdpLibrary","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcousin3%2FCohensdpLibrary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcousin3%2FCohensdpLibrary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcousin3%2FCohensdpLibrary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcousin3%2FCohensdpLibrary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcousin3","download_url":"https://codeload.github.com/dcousin3/CohensdpLibrary/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244297908,"owners_count":20430347,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["r","statistics"],"created_at":"2024-11-25T01:10:25.247Z","updated_at":"2025-03-18T19:56:54.350Z","avatar_url":"https://github.com/dcousin3.png","language":"Fortran","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\nbibliography: \"inst/REFERENCES.bib\"\ncsl: \"inst/apa-6th.csl\"\n---\n\n# Cohen's $d_p$ library: Getting the Cohen's $d_p$ and its confidence interval in any design\n\n\u003c!-- badges: start --\u003e\n[![CRAN Status](https://www.r-pkg.org/badges/version/CohensdpLibrary)](https://cran.r-project.org/package=CohensdpLibrary)\n\u003c!-- badges: end --\u003e\n\nThis library computes the Cohen's $d_p$ and its confidence intervals in any experimental design. In the past, \nresearchers developed distinct versions of standardized mean difference for between and within-subject design.\nThe consequence is that these various estimators could not be compared between each others and more importantly,\nacross experimental design. @L0003-1 noted the existence of two different measures in within-subject design,\nand @w16 noted the existence of at least 5 difference sorts of standardized mean difference. He concluded by\nmaking this very important point: all these estimators ARE NOT Cohen's d measures.\n\nThe measure that J. Cohen [@c69] created is obtained from the mean difference standardized using the pooled\nstandard deviation. Hence, measures such as $d_a_v$, $d_z$, $d_a$, etc. are not Cohen's d and **more importantly**,\nthey cannot be compared! They all return different values because they measure different things. They are not just\ndifferent, they can be markedly different. As an example, a $d_z$, given the means and standard deviations,\ncan be _smaller_  **or** _larger_ than the Cohen's $d$ depending on the amount of correlation across the pairs\nof data. \n\nThis whole mess implies lack of comparability and confusion as to what statistics was actually reported. For that\nreason, I chose to call the true Cohen's $d$ with a distinct subscript $p$, as in $d_p$ so that (i) we clearly see the \ndifference (the reader is not left guessing what $d$ represents); (ii) is is clear that the pooled standard\ndeviation and only this statistic was used to standardized the mean difference. Further, by advocating a unique\nstatistic for standardized mean difference, it allows for comparisons across studies, whether they used within-subject\nor between-subject design.\n\n```{r, echo = FALSE, message = FALSE, results = 'hide', warning = FALSE}\ncat(\"this will be hidden; use for general initializations.\\n\")\nlibrary(CohensdpLibrary)\noptions(\"CohensdpLibrary.SHOWWARNINGS\" = FALSE) # shut down all messages\n```\n\n## Why this package?\n\n`MBESS` is an excellent package which already computes standardized mean difference and returns confidence \nintervals [@k22]. However, it does not compute confidence intervals in within-subject design directly. The\nAlgina and Keselman approximate method can be implemented within MBESS with some programming [@CG057-1]. \nThis package, on the other hand, can be used with any experimental design. It only requires an argument\n`design` which specifies the type of experimental design.\n\nThe confidence interval in within-subect design was unknown until recently. In recent work [@c22a;@c22b],\nits exact expression was found when the population correlation is know and an approximation was\nproposed when the sample correlation is known, but not the population correlation. \n\n# Using ``CohensdpLibrary``\n\n\nYou can install this library on you computer from CRAN (note the uppercase C and uppercase L)\n```{r, echo = TRUE, eval = FALSE}\ninstall.packages(\"CohensdpLibrary\")\n```\n\nor if the library devtools is installed with:\n```{r, echo = TRUE, eval = FALSE}\ndevtools::install_github(\"dcousin3/CohensdpLibrary\")\n```\n\nand before using it:\n```{r, echo = TRUE}\nlibrary(CohensdpLibrary)\n```\n\nThe main function is ``Cohensdp``, which returns the Cohen's $d_p$ and its \nconfidence intervals under various designs. For example, this returns the \ntriplet (lower 95% confidence interval bound, $d_p$, upper 95% confidence interval \nbound) given the sample means, the sample standard deviations, and the correlation\n\n```{r}\nCohensdp( statistics = list(m1=76, m2=72, n=20, s1=14.8, s2=18.8, r=0.2),\n          design = \"within\",\n          method = \"adjustedlambdaprime\"\n)\n```\n\nYou get a more readable output with ``summarize``, e.g.,\n\n```{r}\nsummarize(Cohensdp( statistics = list(m1=76, m2=72, n=20, s1=14.8, s2=18.8, r=0.2),\n                    design = \"within\",\n                    method = \"adjustedlambdaprime\"\n))\n```\n\nThe design can be replaced with ``between`` for a between-subject design:\n\n```{r}\nsummarize(Cohensdp( statistics = list(m1=76, m2=72, n1=10, n2=10, s1=14.8, s2=18.8),\n                    design = \"between\")\n)\n```\n(the statistic ``r`` is removed as there is no correlation in between-group design, and ``n`` is\nprovided separately for each group, ``n1`` and ``n2``).\n\nFinally, it is also possible to get a Cohen's $d_p$ from a single group as long as you have an \nhypothetical mean ``m0`` to compare the sample mean to, e.g., \n```{r}\nsummarize(Cohensdp( statistics = list(m=76, m0=72, n=20, s=14.8),\n                    design = \"single\")\n)\n```\n\nReplace ``summarize`` with ``explain`` for additional information on the result.\n\n\nCheck the web site [https://github.com/dcousin3/CohensdpLibrary](https://github.com/dcousin3/CohensdpLibrary) for more.\nalso, ``help(CohensdpLibrary)`` will get you started.\n\n\n# References\n\n\\insertAllCited{}","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcousin3%2Fcohensdplibrary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcousin3%2Fcohensdplibrary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcousin3%2Fcohensdplibrary/lists"}