Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ VignetteBuilder:
Encoding: UTF-8
Language: en-US
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
RoxygenNote: 7.3.3
Config/testthat/edition: 3
Config/testthat/parallel: true
Config/Needs/website:
Expand Down
32 changes: 32 additions & 0 deletions R/datasets.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,38 @@
NULL


#' Preferences of Poop vs Chocolate
#'
#' A subset of Hussey and Cummins replication of _Balcetis & Dunning (2010)
#' Study 3b_. Each scale is average of 3 items both for "a toilet filled with
#' human poop" and for and for "a toilet filled with human poop" (how positive
#' or negative / pleasant or unpleasant / good or bad).
#'
#' @references Hussey, I., & Cummins, J. (2025). (Not so) simple preferences. https://github.com/ianhussey/not-so-simple-preferences

Check warning on line 94 in R/datasets.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=R/datasets.R,line=94,col=121,[line_length_linter] Lines should not be more than 120 characters. This line is 133 characters.
#'
#' @docType data
#'
#' @name preferences2025
#'
#' @keywords data
#'
#' @format A data frame with 489 rows and 3 variables:
#' \describe{
#' \item{participant_id}{Unique identifier for each participant}
#' \item{poop}{Preference rating of poop (1 = low, 7 = high)}
#' \item{chocolate}{Preference rating of poop (1 = low, 7 = high)}
#' }
#'
#' ```{r}
#' data("preferences2025")
#' head(preferences2025, n = 5)
#' ```
#' @family effect size datasets
#'
#' @seealso [repeated_measures_d()]
NULL


# Tables ------------------------------------------------------------------

#' Fictional Results from a Workers' Randomized Control Trial
Expand Down
36 changes: 17 additions & 19 deletions R/repeated_measures_d.R
Original file line number Diff line number Diff line change
Expand Up @@ -105,32 +105,30 @@
#' @examples
#' # Paired data -------
#'
#' data("sleep")
#' sleep2 <- reshape(sleep,
#' direction = "wide",
#' idvar = "ID", timevar = "group"
#' )
#'
#' repeated_measures_d(Pair(extra.1, extra.2) ~ 1, data = sleep2)
#'
#' # Same as:
#' # repeated_measures_d(sleep$extra[sleep$group==1],
#' # sleep$extra[sleep$group==2])
#' # repeated_measures_d(extra ~ group | ID, data = sleep)
#' data("preferences2025")
#' # Is chocolate preferred over... poop?
#'
#' repeated_measures_d(Pair(chocolate, poop) ~ 1, data = preferences2025)
#'
#' # More options:
#' repeated_measures_d(Pair(extra.1, extra.2) ~ 1, data = sleep2, mu = -1)
#' repeated_measures_d(Pair(extra.1, extra.2) ~ 1, data = sleep2, alternative = "less")
#' repeated_measures_d(Pair(chocolate, poop) ~ 1, data = preferences2025,
#' mu = 3.4)
#' repeated_measures_d(Pair(chocolate, poop) ~ 1, data = preferences2025,
#' alternative = "greater")
#'
#' # Other methods
#' repeated_measures_d(Pair(extra.1, extra.2) ~ 1, data = sleep2, method = "av")
#' repeated_measures_d(Pair(extra.1, extra.2) ~ 1, data = sleep2, method = "b")
#' repeated_measures_d(Pair(extra.1, extra.2) ~ 1, data = sleep2, method = "d")
#' repeated_measures_d(Pair(extra.1, extra.2) ~ 1, data = sleep2, method = "z", adjust = FALSE)
#' repeated_measures_d(Pair(chocolate, poop) ~ 1, data = preferences2025,
#' method = "av")
#' repeated_measures_d(Pair(chocolate, poop) ~ 1, data = preferences2025,
#' method = "b")
#' repeated_measures_d(Pair(chocolate, poop) ~ 1, data = preferences2025,
#' method = "d")
#' repeated_measures_d(Pair(chocolate, poop) ~ 1, data = preferences2025,
#' method = "z")
#'
#' # d_z is the same as Cohen's d for one sample (of individual difference):
#' cohens_d(extra.1 - extra.2 ~ 1, data = sleep2)
#' cohens_d(chocolate - poop ~ 1, data = preferences2025)
#'
#'
#'
#'
Expand Down Expand Up @@ -264,7 +262,7 @@
r <- stats::cor(x, y)
f <- 2 * (1 - r)

if (method == "rm") {

Check warning on line 265 in R/repeated_measures_d.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=R/repeated_measures_d.R,line=265,col=3,[if_switch_linter] Prefer switch() statements over repeated if/else equality tests, e.g., switch(x, a = 1, b = 2) over if (x == "a") 1 else if (x == "b") 2.
# nolint
s <- stats::sd(x - y) / sqrt(f)
d <- (m - mu) / s
Expand Down
Binary file added data-raw/data_processed.rds
Binary file not shown.
14 changes: 14 additions & 0 deletions data-raw/df data.R
Original file line number Diff line number Diff line change
Expand Up @@ -259,3 +259,17 @@
save(rouder2016, file = "data/rouder2016.rdata")

# styler: on


# https://github.com/ianhussey/not-so-simple-preferences -----------------

preferences2025 <- read.csv(url("https://github.com/ianhussey/not-so-simple-preferences/raw/refs/heads/main/data/processed/data_processed_subset_with_exclusions.csv"))

Check warning on line 266 in data-raw/df data.R

View workflow job for this annotation

GitHub Actions / lint / lint

file=data-raw/df data.R,line=266,col=121,[line_length_linter] Lines should not be more than 120 characters. This line is 167 characters.

Check warning on line 266 in data-raw/df data.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=data-raw/df data.R,line=266,col=121,[line_length_linter] Lines should not be more than 120 characters. This line is 167 characters.

preferences2025 <- preferences2025[
,
c("participant_id", "evaluations_poop", "evaluations_chocolate")
]

colnames(preferences2025) <- gsub("evaluations_", "", colnames(preferences2025))

Check warning on line 273 in data-raw/df data.R

View workflow job for this annotation

GitHub Actions / lint / lint

file=data-raw/df data.R,line=273,col=35,[fixed_regex_linter] Use "evaluations_" with fixed = TRUE here. This regular expression is static, i.e., its matches can be expressed as a fixed substring expression, which is faster to compute.

Check warning on line 273 in data-raw/df data.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=data-raw/df data.R,line=273,col=35,[fixed_regex_linter] Use "evaluations_" with fixed = TRUE here. This regular expression is static, i.e., its matches can be expressed as a fixed substring expression, which is faster to compute.

save(preferences2025, file = "data/preferences2025.rdata")
Binary file added data/preferences2025.rdata
Binary file not shown.
16 changes: 5 additions & 11 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Awang
Azen
BESD
BMC
Balcetis
Baptista
BayestestR's
Behaviour
Expand All @@ -35,10 +36,10 @@ Codecov
Compatibiity
Cramer's
Cramér's
Cummins
Cureton
DOI
Delacre
Dom
Doutelle
Doutelle's
EQS
Expand Down Expand Up @@ -67,6 +68,7 @@ Hjort
Hoekstra
Hotelling's
Hu
Hussey
IFI
IRRs
Intraclass
Expand Down Expand Up @@ -176,15 +178,13 @@ arcsin
bayestestR
biserial
blogspot
bmwiernik
brglm
brms
brussels
cbu
cfa
cgam
cglm
cles
cohens
complmrob
cplm
Expand All @@ -197,23 +197,21 @@ effectsize’
et
fixest
frac
friedman
ggstatsplot
github
glmmadmb
gtsummary
homoscedasticity
http
https
ianhussey
independant
infty
intraclass
jeffrouder
joss
kruskal
labelled
lifecycle
lm
mattansb
mis
mixor
modelling
Expand All @@ -228,21 +226,17 @@ noncentrality
num
partialled
partilled
patilindrajeets
pb
pkgdown
ppd
pre
preprint
rb
rempsyc
rescale
rmANOVA
sd
semipartial
statswiki
strengejacke
th
uk
wilcox
פ
4 changes: 2 additions & 2 deletions man/F_to_eta2.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/Music_preferences.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/Music_preferences2.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/RCT_table.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/Smoking_FASD.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/effectsize.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions man/eta_squared.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/food_class.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/hardlyworking.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/interpret_gfi.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 48 additions & 0 deletions man/preferences2025.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/r2_semipartial.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading