Learn R Programming

esvis (version 0.2.0)

tpac: Transformed proportion above the cut

Description

This function transforms calls to pac into standard deviation units. Function assumes that each distribution is distributed normally with common variances. See Ho & Reardon, 2012

Usage

tpac(formula, data, cut, ref_group = NULL, diff = TRUE, 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.

cut

The point at the scale from which the proportion above should be calculated 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.

diff

Logical, defaults to TRUE. Should the difference between the groups be returned? If FALSE the raw proportion above the cut is returned for each group.

tidy

Logical. Should the data be returned in a tidy data frame? (see Wickham, 2014). If false, effect sizes returned as a matrix or vector (depending on other arguments passed).

Value

A tidy data frame (or vector) of the transformed proportion above the cutoff. Optionally (and by default) all pairwise comparisons are calculated and returned.

Examples

Run this code
# NOT RUN {
# Compute transformed PAC differences for all pairwise comparisons 
# for each of three cuts
tpac(reading ~ condition, 
		star, 
		cut = c(450, 500, 550)) 

# Report raw transformed PAC, instead of differences in transformed PAC
tpac(reading ~ condition, 
		star, 
		cut = c(450, 500, 550), 
		diff = FALSE) 

# Report transformed differences with regular-sized classrooms as the
# reference group
tpac(reading ~ condition, 
		star, 
		cut = c(450, 500, 550), 
		ref_group = "reg") 

# Return a matrix instead of a data frame 
# (returns a vector if only one cut is provided)
tpac(reading ~ condition, 
		star, 
		cut = c(450, 500, 550), 
		ref_group = "reg",
		tidy = FALSE) 
# }

Run the code above in your browser using DataLab