calc_contrast_aggregated: Calculate between contrast analysis from aggregated data...

View source: R/calc_contrast_aggregated.R

calc_contrast_aggregatedR Documentation

Calculate between contrast analysis from aggregated data (means, sds and ns)

Description

Calculate between contrast analysis from aggregated data (means, sds and ns)

Usage

calc_contrast_aggregated(means, sds, ns, between, lambda_between, data)

Arguments

means

numeric vector of mean values for every condition

sds

numeric vector of standard deviation values for every condition

ns

numeric vector of sample size values for every condition

between

factor for the independent variable that divides the data into independent groups

lambda_between

numeric vector for contrast weights. Names must match the levels of between. If lambda_between does not sum up to zero, this will be done automatically (centering).

data

optional argument for the data.frame containing all variables except for lambda_between

Value

an object of type cofad_bw, including p-value, F-value, contrast weights, different effect sizes

References

Rosenthal, R., Rosnow, R.L., & Rubin, D.B. (2000). Contrasts and effect sizes in behavioral research: A correlational approach. New York: Cambridge University Press.

Examples

library(dplyr)
furr_agg <- furr_p4 %>%
  group_by(major) %>%
  summarize(mean = mean(empathy), sd = sd(empathy), n = n())
lambdas = c("psychology" = 1, "education" = -1, "business" = 0,
            "chemistry" = 0)
calc_contrast_aggregated(mean, sd, n, major, lambdas, furr_agg)


cofad documentation built on Sept. 11, 2024, 6:34 p.m.