0

Using the paraPen term and gamma to control how much penalisation, what is the correct structure of penalty matrix input for paraPen for an interaction to be penalised?

In the case of a numeric variable we would use:

paraPen = list("numeric_variable" = list(rank = 1, diag(1)))

In the case of a factor/character variable we would use:

paraPen = list("categorical_variable" = list(list(rank = length(unique(.data$categorical_variable)) - 1,
                                diag(length(unique(.data$categorical_variable)) - 1))

However, how would the list be structured to penalise the terms in an interaction of numeric_variable:categorical_variable?

Would it be the unique combination of factor levels and the numeric variable name, without the reference level, or is there a better way of specifying linear predictor interaction terms?

The numeric and categorical examples have been found from:

Thank you for any help.

0 Answers0