stabilise_re_glmer: stabilise_re_glmer

View source: R/stabilise_re_glmer.R

stabilise_re_glmerR Documentation

stabilise_re_glmer

Description

Function to calculate stability of variables' association with an outcome for a given model over a number of bootstrap repeats using clustered data.

Arguments

data

A dataframe containing an outcome variable to be permuted.

outcome

The outcome as a string (i.e. "y").

intercept_level_ids

A vector names defining which variables are random effect, i.e., c("level_2_column_name", "level_3_column_name").

n_top_filter

The number of variables to filter for final model (Default = 50).

boot_reps

The number of bootstrap samples. Default is "auto" which selects number based on dataframe size. For glmer models, these are subsamples of the dataset, set to 80%.

permutations

The number of times to be permuted per repeat. Default is "auto" which selects number based on dataframe size.

perm_boot_reps

The number of times to repeat each set of permutations. Default is 20.

normalise

Normalise numeric variables (TRUE/FALSE)

dummy

Create dummy variables for factors/characters (TRUE/FALSE)

impute

Impute missing data (TRUE/FALSE)

base_id

level of the random effect to bootstrap by, e.g individual. This is likely the lower level of random effect specified

parallel

TRUE or FALSE, whether to set up parallel processing

num_cores

Number of cores to use if parallel processing required

Value

A list containing a table of variable stabilities and a numeric permutation threshold.


stabiliser documentation built on March 9, 2026, 5:08 p.m.