trying_toster

Anova

Run the toster test…

library(TOSTER)

MU_ANOVA <- aov(mean_MU ~ condsFile + Error(participant/condsFile), 
                 data = study_time_FR)

equ_anova(object = MU_ANOVA, eqbound = 0.06)
     effect df1 df2  F.value    p.null        pes eqbound     p.equ
1 condsFile   1  26 1.473684 0.2356775 0.05363985    0.06 0.4410549

The above is non-significant (effect isn’t negligible).

Multiple regression

Run the GLM and put the coefficients through a toster test…

OK here is the actual toster tests:

This one below is from this method.

library(lme4)
Warning: package 'lme4' was built under R version 4.2.3
Loading required package: Matrix

Attaching package: 'Matrix'
The following objects are masked from 'package:tidyr':

    expand, pack, unpack
library(lmerTest)
Warning: package 'lmerTest' was built under R version 4.2.3

Attaching package: 'lmerTest'
The following object is masked from 'package:lme4':

    lmer
The following object is masked from 'package:stats':

    step
library(negligible)

model1 <- lmer(avg_MU ~ avg_studyTime + avg_pupil +
             (1 | participant), 
           model_data)

# Below using the function from the package neglibile
# I think I did it right. Not 100% yet
neg.reg(data = model_data, formula = avg_MU ~ avg_studyTime + avg_pupil, predictor = avg_pupil,
        eil = -0.4, eiu = 0.4)


*** Evaluating Negligible Effects Between Predictor and Outcome in Multiple Regression ***

Unstandardized regression coefficient for avg_pupil and confidence interval using 1000 bootstrap iterations (random seed = 10124):
b = 2.737, 95% CI [0.061, 5.237]
std. error = 1.353

**********************

Anderson-Hauck (AH) procedure: 

Equivalence interval: lower= -0.4, upper= 0.4
Anderson-Hauck T statistic = 2.022
p = 0.944
NHST decision: The null hypothesis that the regression coefficient is non-negligible cannot be rejected. There is insufficient evidence to conclude a negligible effect. Be sure to interpret the magnitude (and precision) of the effect size.

*Note that in rare cases, where p is close to α, NHST decisions using the AH procedure may not match TOST NHST results or the Symmetric CI Approach at 100*(1-2α)% illustrated in the plots. 

**********************

Proportional Distance 

Proportional distance: 6.842 
95% confidence interval for the proportional distance: (0.152, 13.092)

*Note that the confidence interval for the proportional distance may not be precise with small sample sizes 
******************* 

And here is me trying out this other method.

lower <- contest1D(model1, c(0, 0, 1), confint=TRUE, rhs=-0.4) # get t value for test against lower bound
upper <- contest1D(model1, c(0, 0, 1), confint=TRUE, rhs=0.4) # get t value for test against upper bound

print("Below is the lower bound:")
[1] "Below is the lower bound:"
lower$`Pr(>|t|)`/2  # test against lower bound
[1] 0.08943313
print("Below is the upper bound:")
[1] "Below is the upper bound:"
upper$`Pr(>|t|)`/2  # test against upper bound
[1] 0.2243814

Both of the above methods (if I did them right) show that the equivalence tests for the pupil are not significant, meaning that we can’t say our effect is negligible, based on the pilot data at least.

Dominance analysis on multiple regression

Does not work with lmer, only works with standard lm.

library(domir)

da <- domir(
  avg_MU ~ avg_studyTime + avg_pupil, 
  function(formula) {
    lmer_model <- lm(formula, data = model_data)
    summary(lmer_model)[["r.squared"]]
  }
)

da
Overall Value:      0.4026681 

General Dominance Values:
              General Dominance Standardized Ranks
avg_studyTime       0.397985868   0.98837206     1
avg_pupil           0.004682198   0.01162794     2

Conditional Dominance Values:
              Include At: 1 Include At: 2
avg_studyTime   0.395556826   0.400414909
avg_pupil       0.002253157   0.007111239

Complete Dominance Proportions:
                > avg_studyTime > avg_pupil
avg_studyTime >              NA           1
avg_pupil >                   0          NA
summary(da)$Strongest_Dominance
                       
 "avg_studyTime"       
 "completely dominates"
 "avg_pupil"           

Check multicolinearity on multiple regression

The VIF values are identical, but this Stack Exchange answer explains why. The VIF and the correlation coefficient between study time and pupil actually demonstrate that there isn’t a problem. VIF values of 1 suggest no problem at all, VIF values from 1 - 5 suggest a moderate correlation (which many people ignore anyway even when VIF is at 5), so our VIF of 1.01 is fine. Also the correlation is only -0.2. But keep in mind I am just getting the average of the entire maintenance phase! We haven’t decided yet on the time period of interest.

library(car)
library(performance)
vif_model <- vif(model1)
print("Below shows the VIF values of pupil and study time.")
[1] "Below shows the VIF values of pupil and study time."
vif_model
avg_studyTime     avg_pupil 
      1.00946       1.00946 
print("Below shows the correlation between pupil and study time.")
[1] "Below shows the correlation between pupil and study time."
cor(model_data$avg_pupil, model_data$avg_studyTime, use = "complete.obs")
[1] -0.2009554