You need to specify that would like to perform
paircomparisons (in older versions of quickpsy
the comparisons are performed by default)
library(quickpsy)
fit <- quickpsy(qpdat, phase, resp, grouping = c("participant", "cond"),
paircomparisons = TRUE,
B = 30)
plot(fit, color = cond)
#> `height` was translated to `width`.All the possible pair comparisons across parameters are include in
the output data frame par_dif. If, for example, we want to
compare the parameters across conditions for each participant we need
the following subset of the data frame
library(dplyr)
fit$par_dif %>% filter(participant == participant2)
#> # A tibble: 6 × 11
#> parn participant cond par participant2 cond2 par2 dif difinf difsup
#> <chr> <chr> <chr> <dbl> <chr> <chr> <dbl> <dbl> <dbl> <dbl>
#> 1 p1 Participant1 cond1 -70.2 Participant1 cond2 -121. 50.8 34.7 65.4
#> 2 p1 Participant2 cond1 -92.5 Participant2 cond2 -130. 37.7 17.9 60.3
#> 3 p1 Participant3 cond1 -81.4 Participant3 cond2 -125. 43.2 10.9 69.3
#> 4 p2 Participant1 cond1 78.5 Participant1 cond2 61.7 16.8 -3.91 32.6
#> 5 p2 Participant2 cond1 67.2 Participant2 cond2 66.1 1.04 -16.8 27.2
#> 6 p2 Participant3 cond1 69.2 Participant3 cond2 78.9 -9.65 -44.7 17.3
#> # ℹ 1 more variable: signif <chr>dif corresponds to the difference in parameters.
difinfand difsup correspond to the limits of
the bootstrap confidence intervals (default 95%). Confidence intervals
that do not include the zero suggests than the parameters differ. In
this case p1 (the parameter of location) seems to differs
across conditions for all participants. p2 only seems to
differ across conditions for Participant 1.
To reduce computation time, we only included 30 bootstrap samples, but you will need to include much more.
The bootstrap differences across thresholds are included in
thresholds_dif
fit$thresholds_dif %>% filter(participant == participant2)
#> # A tibble: 3 × 10
#> participant cond thre participant2 cond2 thre2 dif difinf difsup signif
#> <chr> <chr> <dbl> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <chr>
#> 1 Participant1 cond1 -70.2 Participant1 cond2 -121. 50.8 34.7 65.4 *
#> 2 Participant2 cond1 -92.5 Participant2 cond2 -130. 37.7 17.9 60.3 *
#> 3 Participant3 cond1 -81.4 Participant3 cond2 -125. 43.2 10.9 69.3 *