Description Usage Arguments Details Value Examples
Extracts coefficients from all parameters in GAMLSS model into a neat table.
1 | get_coef_tbl(mod)
|
mod |
object of class |
Note that coefficients at this stage are automatically transformed using the inverse link function. If the link function is not one of identity, log or logit, then an error is thrown as the code does not yet invert using other functions.
A tibble
with column Variable
specifying the variables and columns Mu coefficients
,
Sigma coefficients
and so on for the remaining parameters.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # data
data_mod <- data.frame(x = rnorm(20, 5) + rgamma(20, 0.01, 0.0001))
data_mod[['y']] <- 3 * data_mod[['x']] + rnorm(20, sd = 5)
# model that only uses two parameters
mod_two_param <- gamlss::gamlss(formula = y ~ -1 + x,
family = "NO",
data = data_mod,
control = gamlss::gamlss.control(trace = FALSE))
# model that uses four parameters
mod_four_param <- gamlss::gamlss(formula = y ~ -1 + x,
family = "BCPE",
data = data_mod,
control = gamlss::gamlss.control(trace = FALSE))
coef_tbl(mod_two_param) # columns only for mu and sigma
coef_tbl(mod_four_param) # columns for mu, sigma, nu and tau
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.