Learn R Programming

esvis (version 0.2.0)

v: Calculate the V effect size statistic

Description

This function calculates the effect size V, as discussed by Ho, 2009. The V statistic is a transformation of auc, interpreted as the average difference between the distributions in standard deviation units.

Usage

v(formula, data, ref_group = NULL, tidy = TRUE)

Arguments

formula

A formula of the type out ~ group where out is the outcome variable and group is the grouping variable. Note this variable can include any arbitrary number of groups.

data

The data frame that the data in the formula come from.

ref_group

Optional. If the name of the reference group is provided (must be character and match the grouping level exactly), only the estimates corresponding to the given reference group will be returned.

tidy

Logical. Should the data be returned in a tidy data frame? (see Wickham, 2014). If false, effect sizes returned as a vector.

Value

By default the V statistic for all possible pairings of the grouping factor are returned as a tidy data frame. Alternatively, a vector can be returned, and/or only the V corresponding to a specific reference group can be returned.

Examples

Run this code
# NOT RUN {
free_reduced <- rnorm(800, 80, 20)
pay <- rnorm(500, 100, 10)
d <- data.frame(score = c(free_reduced, pay), 
				frl = c(rep("free_reduced", 800),  
						rep("pay", 500)))

v(score ~ frl, d)
# Compute V for all pairwise comparisons
v(reading ~ condition, star)

# Specify regular-sized classrooms as the reference group
v(reading ~ condition, 
		star, 
		ref_group = "reg")

# Return a vector instead of a data frame
v(reading ~ condition, 
		star, 
		ref_group = "reg", 
		tidy = FALSE)
# }

Run the code above in your browser using DataLab