Performing a two-tailed binomial test for each individual dog to assess if their choices were not different from chance level in the test trials
##
## Exact binomial test
##
## data: 16 and 25
## number of successes = 16, number of trials = 25, p-value = 0.2295
## alternative hypothesis: true probability of success is not equal to 0.5
## 95 percent confidence interval:
## 0.4252063 0.8202832
## sample estimates:
## probability of success
## 0.64
##
## Exact binomial test
##
## data: 22 and 25
## number of successes = 22, number of trials = 25, p-value = 0.0001565
## alternative hypothesis: true probability of success is not equal to 0.5
## 95 percent confidence interval:
## 0.6878097 0.9745346
## sample estimates:
## probability of success
## 0.88
##
## Exact binomial test
##
## data: 21 and 25
## number of successes = 21, number of trials = 25, p-value = 0.0009105
## alternative hypothesis: true probability of success is not equal to 0.5
## 95 percent confidence interval:
## 0.6391715 0.9546205
## sample estimates:
## probability of success
## 0.84
##
## Exact binomial test
##
## data: 24 and 25
## number of successes = 24, number of trials = 25, p-value = 1.55e-06
## alternative hypothesis: true probability of success is not equal to 0.5
## 95 percent confidence interval:
## 0.7964831 0.9989878
## sample estimates:
## probability of success
## 0.96
##
## Exact binomial test
##
## data: 23 and 25
## number of successes = 23, number of trials = 25, p-value = 1.943e-05
## alternative hypothesis: true probability of success is not equal to 0.5
## 95 percent confidence interval:
## 0.7396942 0.9901604
## sample estimates:
## probability of success
## 0.92
##
## Exact binomial test
##
## data: 22 and 25
## number of successes = 22, number of trials = 25, p-value = 0.0001565
## alternative hypothesis: true probability of success is not equal to 0.5
## 95 percent confidence interval:
## 0.6878097 0.9745346
## sample estimates:
## probability of success
## 0.88
Performing a one-sample two-tailed Student’s t test on the dogs’ mean choices in the test trials
##
## One Sample t-test
##
## data: x
## t = 7.7144, df = 5, p-value = 0.0005843
## alternative hypothesis: true mean is not equal to 0.5
## 95 percent confidence interval:
## 0.7355968 0.9710698
## sample estimates:
## mean of x
## 0.8533333
## Warning: package 'effsize' was built under R version 4.0.2
##
## Cohen's d (single sample)
##
## d estimate: 3.14941 (large)
## Reference mu: 0.5
## 95 percent confidence interval:
## lower upper
## 0.008213887 6.290606736
Importing and assessing the data
library(readxl)
Kanizsa <- read_excel("/Volumes/ResearchData2/Kanizsa.xlsx",
col_types = c("text", "numeric", "numeric",
"numeric"))
mean(Kanizsa$Age)
## [1] 4.3
## [1] 2.615134
## [1] 84.83333
## [1] 23.92253
Performing a repeated measures binomial logistic regression to analyze if the age of the dog or the length of the training phase affected the choices in the test phase
## Loading required package: Matrix
## boundary (singular) fit: see ?isSingular
## Generalized linear mixed model fit by maximum likelihood (Laplace
## Approximation) [glmerMod]
## Family: binomial ( logit )
## Formula: Choice ~ (1 | Dog) + Age + Training
## Data: Kanizsa
##
## AIC BIC logLik deviance df.resid
## 123.0 135.0 -57.5 115.0 146
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.7581 0.2661 0.3296 0.3787 0.7308
##
## Random effects:
## Groups Name Variance Std.Dev.
## Dog (Intercept) 0 0
## Number of obs: 150, groups: Dog, 6
##
## Fixed effects:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 2.13219 0.95670 2.229 0.02583 *
## Age -0.31427 0.10487 -2.997 0.00273 **
## Training 0.01359 0.01316 1.033 0.30163
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) Age
## Age 0.112
## Training -0.839 -0.595
## convergence code: 0
## boundary (singular) fit: see ?isSingular
## Registered S3 method overwritten by 'parameters':
## method from
## ci.blavaan bayestestR
## Cohen's d | 95% CI
## ------------------------
## 0.73 | [0.27, 1.19]
##
## - Estimated using pooled SD.
## Cohen's d | 95% CI
## -------------------------
## 0.17 | [-0.28, 0.62]
##
## - Estimated using pooled SD.