Description Usage Arguments Details Value See Also
View source: R/utility_functions.R
function that takes a vector of betas (which are the main effects) and alphas (which are the interaction effects) and converts the alphas to gammas.
1 2 | convert(betas.and.alphas, main.effect.names, interaction.names,
epsilon = 1e-05)
|
betas.and.alphas |
q x 1 data.frame or matrix of main effects and
interaction estimates. For example the output from the |
main.effect.names |
character vector of main effects names. MUST be
ordered in the same way as the column names of |
interaction.names |
character vector of interaction names. MUST be
separated by a colon (e.g. x1:x2), AND MUST be
ordered in the same way as the column names of |
epsilon |
threshold to avoid division by a very small beta e.g. if any of the main effects are less than epsilon, set gamma to zero. This should not really be an important parameter because this function is only used in the initialization step, where the intial estimates are from OLS or ridge regression and therefor should not be very close to 0 |
note that
y = β_0 + β_1 x_1 + ... + β_p x_p + α_{12} x_1 x_2 + ... + α_{p-1,p} x_p x_{p-1}
and
α_{ij} = γ_{ij} * β_i*β_j , i < j
This function is used because the fitting algorithm estimates the gammas,
and furthermore, the L1 penalty is placed on the gammas. It is used only in
the initialization step in the shim
function
a labelled q x 1 data.frame of betas and gammas
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.