Explore chapters and articles related to this topic
Reproducible projects with RStudio and R markdown
Published in Rafael A. Irizarry, Introduction to Data Science, 2019
We use the knitR package to compile R markdown documents. The specific function used to compile is the knit function, which takes a filename as input. RStudio provides a button that makes it easier to compile the document. For the screenshot below, we have edited the document so that a report on gun murders is produced. You can see the file here: https://raw.githubusercontent.com/rairizarry/murders/master/report.Rmd. You can now click on the Knit button:
Network analysis of kick-in possession chains in elite Australian football
Published in Journal of Sports Sciences, 2020
Noni Taylor, Paul B. Gastin, Olivia Mills, Jacqueline Tran
Initial tests confirmed that the data met assumptions of normality (Fisher’s coefficients for skewness and kurtosis within the range −1.96 to +1.96) (Pett, 2015) and homoscedasticity (Levene’s test returns a non-significant F value where p < 0.05) (Levene, 1960). Descriptive statistics (e.g., means and standard deviations) for each of these metrics were reported for each kick-in outcome, for each ladder bracket (i.e., top 6, middle 6, bottom 6), and for each match outcome (i.e., win, loss). A three-way analysis of variance (ANOVA) was conducted for each of the four metrics, to determine whether these network characteristics differed due to kick-in outcome, match outcome, and ladder bracket. Main effects and two-factor interaction effects were assessed via the ANOVA procedure. Where significant main or interaction effects were identified for factors with more than 2 levels, Tukey’s Honestly Significant Difference post hoc tests were conducted to locate pairwise differences. The omega squared (ω2) statistic was used to quantify effect sizes within the factorial ANOVA (Lakens, 2013). Effect sizes were interpreted in accordance with the thresholds proposed by Cohen (1988): ω2 ≤ 0.01, small; 0.01 > ω2 ≤ 0.06, medium; ω2 > 0.06, large. The three-way interaction term was omitted from the ANOVA procedure, on the basis that it was unclear whether such an interaction effect was interpretable in a practically meaningful way. All data preparation and statistical analysis procedures were conducted in R (R Core Team, 2018) using the following packages: here (Müller, 2017), readr (Wickham et al., 2017), dplyr (Wickham et al., 2018), tidyr (Wickham & Henry, 2018), stringr (Wickham, 2018), purrr (Henry & Wickham, 2018), stringi (Gagolewski, 2018), reshape2 (Wickham, 2007), igraph (Csardi & Nepusz, 2006), network (Butts, 2008), entropy (Hausser & Strimmer, 2014), fitdistrplus (Delignette-Muller & Dutang, 2015), pastecs (Grosjean & Ibanez, 2018), car (Fox & Weisberg, 2011), sjstats (Lüdecke, 2018), rmarkdown (Allaire et al., 2018), flexdashboard (Iannone et al., 2018), knitr (Xie, 2015), formattable (Ren & Russell, 2016).