Learn R Programming

lmvar (version 1.5.2)

beta_sigma_names: Unique names for beta_sigma

Description

Returns adapted names for the coefficients \(\beta_\sigma\) to distinguish them from the names of the coefficients \(\beta_\mu\). This is a helper function which is used in situations where it is necessary or convenient for the coefficient names of \(\beta_\sigma\) to be different from \(\beta_\mu\).

Usage

beta_sigma_names(beta_mu_names, beta_sigma_names, ...)

Arguments

beta_mu_names

Character vector with the names of the coefficients \(\beta_\mu\)

beta_sigma_names

Character vector with the names of the coefficients \(\beta_\sigma\)

...

Additional arguments, not used in the current implementation

Value

Named character vector with the names of the coefficients \(\beta_\sigma\). The name of a vector element is the original name of the coefficient. The value is the adapted name. The name and the value are equal if no adaptation was needed.

Details

When the name of at least one coefficient in \(\beta_\sigma\) is equal to one of the names of the coefficients in \(\beta_\mu\), the string '_s' is appended to the names of all coefficients in \(\beta_\sigma\). Otherwise, the names of the coefficients in \(\beta_\sigma\) are left unchanged.

Examples

Run this code
# NOT RUN {
# If the names in beta_sigma are all different from all of the names in
# beta_mu, the function returns the names of beta_sigma
mu_names = c("(Intercept)", "age", "gender")
sigma_names = c("(Intercept_s)", "smoker", "job_code")

beta_sigma_names(mu_names, sigma_names)

# If at least one of the names in beta_sigma is equal to a name in
# beta_mu, all the names in beta_sigma get the string '_s' appended,
# except for '(intercept_s)'
sigma_names = c("(Intercept_s)", "age", "job_code")

beta_sigma_names(mu_names, sigma_names)
# }

Run the code above in your browser using DataLab