vadis_line1: Calculate the first line of evidence for the VADIS method

View source: R/vadis_line1.R

vadis_line1R Documentation

Calculate the first line of evidence for the VADIS method

Description

Calculate the first line of evidence for the VADIS method

Usage

vadis_line1(
  mod_list,
  path = NULL,
  alpha = 0.05,
  method = c("freq", "pd", "rope", "map"),
  overwrite = c("no", "yes", "reload"),
  verbose = FALSE
)

Arguments

mod_list

A list of regression model objects.

path

Path in which to save the output as an R data file (.rds). If NULL, defaults to the current working directory. Set path = FALSE if you do not wish to save to file.

alpha

The significance threshold. Default is .05

method

The method for calculating significance values. See details.

overwrite

Should the function overwrite data to location in path? Default is 'no', which will run the analysis if no file exists. If file in path exists, user with be prompted to set new path or allow file to be overwritten. Set to 'yes' to automatically overwrite existing file, and 'reload' to automatically reload existing file.

verbose

Should messages be printed? Default is FALSE

Details

The function loops through a list of model objects, extracts the coefficient estimates, and compiles them in a single dataframe. There are four possible values for the method argument: "freq", "pd", "rope", "map". For frequentist (non-Bayesian) models, only the standard outputs of glm and glmer are used, i.e. method = "freq".

For Bayesian models, all four methods are available. For method = "freq", significance is determined based on the Highest Posterior Density Interval (HDI), which is determined as 1 - alpha. Significance is defined as whether the HDI contains 0. For method = "pd" ("probability of direction"), the p-value is defined as the proportion of the posterior distribution that is of the median’s sign. In other words, the p-value represents the proportion of the posterior distribution that is above/below 0, whichever is larger). For method = "rope", the p-value is defined as the proportion of the entire posterior distribution that lies within the Region of Practical Equivalence (ROPE), which is defined here as c(-0.1, 0.1) (see Kruschke \& Liddell 2018; Makowski et al. 2019). For method = "map", the p-value is defined as the density value at 0 divided by the density at the Maximum A Posteriori (MAP). See p_direction, p_rope, and p_map for further details.

Value

A list of length 3.

signif.table

A dataframe of P predictors by M models, containing a binary value indicating statistical significance (1 = significant) for each predictor in each model.

distance.matrix

An M by M distance matrix of class dist, derived from signif.table. Values are squared Euclidean distances normalized by the number of predictors P.

similarity.scores

A dataframe of similarity scores derive from distance.matrix. See Szmrecsanyi et al. (2019) for details.

Author(s)

Jason Grafmiller

References

Kruschke, John K. & Torrin M. Liddell. 2018. The Bayesian New Statistics: Hypothesis testing, estimation, meta-analysis, and power analysis from a Bayesian perspective. Psychonomic Bulletin & Review 25(1). 178–206. doi: 10.3758/s13423-016-1221-4.

Makowski, Dominique, Mattan S. Ben-Shachar, S. H. Annabel Chen & Daniel Lüdecke. 2019. Indices of effect existence and significance in the Bayesian framework. Frontiers in Psychology. 10. doi: 10.3389/fpsyg.2019.02767.

Szmrecsanyi, Benedikt, Jason Grafmiller & Laura Rosseel. 2019. Variation-Based Distance and Similarity Modeling: A Case Study in World Englishes. Frontiers in Artificial Intelligence 2. https://doi.org/10.3389/frai.2019.00023.

Examples

## Not run: 
data_list <- split(particle_verbs_short, particle_verbs_short$Variety, drop = TRUE)

fmla <- Response ~ DirObjWordLength + DirObjDefiniteness + DirObjGivenness + DirObjConcreteness + DirObjThematicity + DirectionalPP + PrimeType + Semantics + Surprisal.P + Surprisal.V + Register

glm_func <- function(x) glm(fmla, data = x, family = binomial)

glm_list <- lapply(data_list, glm_func)
names(glm_list) <- names(data_list)

line1 <- vadis_line1(glm_list, path = FALSE)

## End(Not run)

jasongraf1/VADIS documentation built on July 19, 2023, 10:26 p.m.