Learn R Programming

sdamr

An R package to support Statistics: Data analysis and modelling.

This package provides the datasets analysed in Statistics: Data analysis and modelling, as well as functions to compute sample statistics (mode, variance and standard deviations) and create "raincloud" plots.

Installation

Stable release

The stable release is available from CRAN. In the R console, type

install.packages("sdamr")

Development version

The development version can be installed from GitHub, using the remotes package. If you don't have this install, first type

install.packages("remotes")

in the R console. You can then install the sdamr package by typing

remotes::install_github("mspeekenbrink/sdam-r")

Copy Link

Version

Install

install.packages('sdamr')

Monthly Downloads

300

Version

0.2.0

License

GPL-3

Maintainer

Maarten Speekenbrink

Last Published

November 16th, 2022

Functions in sdamr (0.2.0)

sample_sd

Compute the sample standard deviation
sample_mode

Compute a sample mode
papervotes

Data based on a post-election survey by YouGov (see https://yougov.co.uk/topics/politics/articles-reports/2017/06/13/how-britain-voted-2017-general-election). Note that the data was recreated by combining frequency and percentage results reported in https://d25d2506sfb94s.cloudfront.net/cumulus_uploads/document/smo1w49ph1/InternalResults_170613_2017Election_Demographics_W.pdf. Due to rounding and other potential inconsistencies, this data set will likely differ from the actual results.
plot_raincloud

Create a raincloud plot
position_jitternudge

Simultaneously nudge and jitter
plot_qq_marginals

Q-Q plots with distributions in the margins
redist2015

Redistribution of wealth
metacognition

Data from Rausch, M. & Zehetleitner, M. (2016) Visibility is not equivalent to confidence in a low contrast orientation discrimination task. Frontiers in Psychology, 7, p. 591 tools:::Rd_expr_doi("10.3389/fpsyg.2016.00591")
legacy2015

Legacy motives and pro-environmental behaviour
tetris2015

Tetris and intrusive memories
rps

Data from Experiment 1 in Guennouni, I., Speekenbrink, M. (2022). Transfer of learned opponent models in repeated games. Computational Brain and Behaviour, 5, 326–342 tools:::Rd_expr_doi("10.1007/s42113-022-00133-6"). Participants (n=52) each play 50 rounds of Rock-Paper-Scissors against an AI player who either adopts a "level-1" or "level-2" strategy. A level-1 strategy assumes the opponent will repeat their last action, and chooses the action that beats this. A level-2 strategy assumes the opponent adopts a level-1 strategy, and chooses the action that beats this. On 10% of rounds, the AI players pick a random action. On the remainder, they act according to their strategy.
sample_var

Compute the sample variance
speeddate

Speed dating
uefa2008

Predictions by Paul the Octopus in the 2008 UEFA Cup.
trump2016

Trump votes in 2016 for 50 US states and the District of Columbia
fifa2010teams

FIFA 2010 team statistics
expand_Anova

Expand all contrast terms in car::Anova
center

Mean-centered values
geom_flat_violin

Half violin plot
gestures

Data from Winter, B., & Burkner, P. (2021) Poisson regression for linguists: A tutorial introduction to modelling count data with brms. Language and Linguistics Compass, 15, e12439 tools:::Rd_expr_doi("10.1111/lnc3.12439")
fifa2010

Predictions by Paul the Octopus in the 2010 FIFA World Cup.
GeomFlatViolin

Flat violin geometry
expBelief

Data from Experiment 5 of Gilder, T. S. E., & Heerey, E. A. (2018). The Role of Experimenter Belief in Social Priming. Psychological Science, 29(3), 403–417.
anchoring

Anchoring
cheerleader

Data from Experiment 1 of Carragher, D.J., Thomas, N.A., Gwinn, O.S. et al. (2019) Limited evidence of hierarchical encoding in the cheerleader effect. Scientific Reports, 9, 9329. https://doi.org/10.1038/s41598-019-45789-6