calculate_sign_consistency: Calculate Sign Consistency

View source: R/sign_consistency_utils.R

calculate_sign_consistencyR Documentation

Calculate Sign Consistency

Description

The function applies the sign consistency analysis to the dataset of a specific participant. Called from 'test_sign_consistency'

Usage

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

Arguments

data

The dataset of a specific participant, arranged according to the independent variable ('iv')

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 sign consistency. Includes:

  • n_splits - The number of random splits to analyze for the estimation of sign consistency.

  • 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 sign consistency score for the individual under the null hypothesis.

  • max_invalid_reps - The maximal number repetitions in which invalid consistency was computed before returning NA result.

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.