rho_max function

Constraint on the Pairwise Correlation of Covariates

Constraint on the Pairwise Correlation of Covariates

Constraint which ensures that only one covariate out of a pair of covariates with a correlation of at least rho

will be included in the final model.

rho_max( rho = 0.8, exclude = "(Intercept)", use = c("everything", "all.obs", "complete.obs", "na.or.complete", "pairwise.complete.obs"), method = c("pearson", "kendall", "spearman") )

Arguments

  • rho: a value in the range [0,1] specifying, the maximum allowed collinearity between pairs of covariates.

  • exclude: variables to be excluded form the pairwise correlation constraints (default is "(Intercept)").

  • use: an optional character string giving a method for computing co-variances in the presence of missing values. The parameter is passed to cor, therefore see cor for more information.

  • method: a character string indicating which correlation coefficient is to be computed. See cor

    for more information.

Returns

A holistic generalized model constraint, object inheriting from class "hglmc".

Examples

beta <- 1:3 Sigma <- cov_matrix(k = length(beta) - 1L, 1, 2, 0.9) dat <- rhglm(100, beta, sigma = Sigma) hglm(y ~ ., constraints = rho_max(0.8), data = dat)

See Also

Other Constraint-Constructors: group_equal(), group_inout(), group_sparsity(), include(), k_max(), linear(), lower(), pairwise_sign_coherence(), sign_coherence(), upper()

  • Maintainer: Benjamin Schwendinger
  • License: GPL-3
  • Last published: 2024-12-20

Useful links