OpenIntroStat / ims-tutorials

Interactive tutorials developed with the learnr package supporting the textbook OpenIntro::Introduction to Modern Statistics.
https://openintrostat.github.io/ims-tutorials/
Other
34 stars 28 forks source link

[Bug]:%$% not working ANOVA Post-hoc testing #194

Closed ghmorrison closed 1 year ago

ghmorrison commented 1 year ago

Contact Details

ghmwebdesign@gmail.com

Bug

%$% not working ANOVA Post-hoc testing I substituted with and it worked.

https://openintro.shinyapps.io/ims-05-infer-08/#section-post-hoc-testing

also first tidy in the solution needs pipe or variable instead of _____

Not positive but I think the comments on the first should be with adjustment and the third should be Compare with adjusted pairwise t-tests

Reproducible Example

# Run a pairwise t-test on wordsum and class, without adjustment
t_test_results <- gss %$%  
  pairwise.t.test(x = wordsum, g = class, p.adjust.method = "bonferroni")
## Alternative method 
t_test_results <- pairwise.t.test(gss$wordsum, gss$class, p.adjust.method = "bonferroni")
# Tidy the result
tidy(___)
## Compare with un-adjusted pairwise t-tests
gss %$% 
  pairwise.t.test(wordsum, class, p.adjust.method = "none") %>% 
  tidy()

Expected Behavior

# Run a pairwise t-test on wordsum and class, with adjustment
with(gss, pairwise.t.test(x = wordsum, g = class, p.adjust.method = "bonferroni")) %>%
  tidy()
## Alternative method 
pairwise.t.test(gss$wordsum, gss$class, p.adjust.method = "bonferroni") %>%
tidy()
## Compare with adjusted pairwise t-tests
with(gss, pairwise.t.test(wordsum, class, p.adjust.method = "none")) %>%
  tidy()

Session Info

No response

Additional context

No response

npaterno commented 1 year ago

Thanks for bringing this to our attention! You are correct that the first comment should be "with".

The error with the %$% pipe was caused by not loading the magrittr package in the tutorial setup. This has been corrected and the error should go away upon our next deployment.

I will keep this issue open until we deploy and the error is gone.

npaterno commented 1 year ago

Confirmed, the latest deployment fixes this issue.