calculate_directional_effect: Calculate Directional Effect

View source: R/directional_effect_utils.R

calculate_directional_effectR Documentation

Calculate Directional Effect

Description

The function calculates the directional effect analysis to the dataset of a specific participant. The function assumed that the dataset ('data') was sorted according to the independent variable prior to the invocation of this function. Called from 'get_true_score'

Usage

calculate_directional_effect(
  data,
  idv = "id",
  dv = "y",
  iv = "condition",
  params
)

Arguments

data

The dataset to analyze.

idv

The name of the participant identifier column.

dv

The dependent variable to apply the summary function (summary_function) to. For multiple dependent variables use a string list with the names of each dependent variable (e.g., c('dv1','dv2')),

iv

Labels of an independent variable, indicating the different levels under which the dependent variable ('dv') is expected to differ.

params

A list of parameters used by the function to calculate the effect. Includes:

  • summary_function - The summary function applied to the dependent variable(s), 'dv', under each split of the data.

  • null_dist_f - A function that calculates the effect score for the individual under the null hypothesis

Value

the function returns the mean consistency of signs for the given data


mufcItay/weaknull documentation built on Jan. 29, 2025, 7:28 p.m.