README.md

tailRatio: A package for calculating, visualising and meta-analyzing tail ratios in R.

DOI

Lifecycle:
experimental

tailRatio hexSticker

Description

The tailRatio package is a collection of functions for calculating, visualizing, and meta-analyzing tail ratios.

Differences in group means, variance differences, or a combination of both, can generate large imbalances in the the distributional tail regions. Such imbalances are relevant for any threshold, susceptibility, diathesis-stress, or selection models.

When the tail regions of the distribution are the focus of interest, mean differences such as Hedges g are quite uninformative. You may wish to calculate a tail ratio (TR): the relative proportion of the two groups in the region above (or below) a certain cutoff.

For a thourough discussion see Voracek, Mohr & Hagmann 2013.

Usage

Install the tailRatio

devtools::install_github("cyplessen/tailRatio")

Plot tail ratios

The plot_tail_ratio() function can plot tail ratios for two normally distributed groups.

calculate_tail_ratio()

Calculates tail ratios for 2 normally distributed variables.

library(tailRatio)
library(dplyr)

Example 1: Different means and sds

Two groups differ in intelligence, group 1 has a higher mean IQ = 115 (sd = 12) and group 2 a lower IQ = 95 (sd = 15). Above a cutoff of two standard deviations from the mean of group 1, there are 7x as many individuals from group 1 than 2!

plot_tail_ratio(area = "above", 
                cutoff = 2, 
                mean_high = 115, 
                sd = 12, 
                mean_low = 95, 
                sd_low = 16, 
                x_lab_name = "IQ", 
                mean_of_interest = 100)

Example 2: Different means and equal sds

Two populations differ in their depression scores. Group 1 has a higher score (mean = 10, sd = 3) and group 2 a lower score (mean = 7, sd = 3). Yet below a cutoff of 1 sd from the mean of group 1, there are 1.68x as many indiviuals from group 2 than group 1.

plot_tail_ratio(area = "below", 
                cutoff = 1, 
                mean_high = 10, 
                sd = 3, 
                mean_low = 7, 
                sd_low = 3, 
                x_lab_name = "Depression", 
                mean_of_interest = 10)

Calculating tail ratios

If you simply want to calculate the tail ratios without visualizing them you can use the calculate_tail_ratio() function.

calculate_tail_ratio(area = "below", 
                     cutoff = 2, 
                     mean_high = 100, 
                     sd = 15, 
                     mean_low = 85, 
                     sd_low = 15)

Meta-analyzing tail ratios

The synthesize_tail_ratios() function synthesizes tail ratios for multiple effect sizes using both fixed effect and random effects models. It outputs tail ratios at 1, 2, and 3 standard deviations below the mean of the reference group (group 1).

Dependencies

ggplot2 grid



cyplessen/tailRatio documentation built on July 16, 2020, 12:47 a.m.