vadis_line2 | R Documentation |
Calculate the second line of evidence for the VADIS method
vadis_line2(
mod_list,
path = NULL,
weight = 1,
scale = c("abs", "mean", "minmax", "none"),
overwrite = c("no", "yes", "reload"),
verbose = FALSE
)
mod_list |
A list of regression model objects. |
path |
Path in which to save the output as an R data file ( |
weight |
A numeric value indicating the size of the "effects" used for approximating the maximal reasonable distance. Default is 1. |
scale |
How should the distance matrix be scaled? See details |
overwrite |
Should the function overwrite data to location in |
verbose |
Should messages be printed? Default is |
The function loops through a list of model objects, extracts the coefficient estimates, and compiles them in a single dataframe.
For scaling, there are four options. The default, "abs"
(absolute), scales by a constant term based on the maximum reasonable distance, and values are bounded between 0 and 1 (see Szmrecsanyi et al. 2019). "minmax"
uses minmax normalization, defined as
x' = \frac{x - min(x)}{max(x) - min(x)}
Minmax scaling bound values between 0 and 1. "mean"
uses mean normalization, defined as
x' = \frac{x - mean(x)}{max(x) - min(x)}
If scale = "none"
no scaling is applied.
A list
of length 3.
coef.table
A dataframe of P predictors by M models, containing the pointwise estimated coefficients (for glm
and glmer
models) or the mean posterior \beta estimates (for brmsfit
models) for each predictor in each model.
distance.matrix
An M by M distance matrix of class dist
, derived from coef.table
. Values are (normalized) Euclidean distances.
similarity.scores
A dataframe of similarity scores derive from distance.matrix
. See Szmrecsanyi et al. (2019) for details.
Jason Grafmiller
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.
## 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)
line2 <- vadis_line2(glm_list, path = FALSE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.