Learn R Programming

hesim (version 0.5.5)

multinom_list: List of multinom objects

Description

Combine multinom objects into a list.

Usage

multinom_list(...)

Value

An object of class multinom_list.

Arguments

...

Objects of class multinom, which can be named.

Examples

Run this code
 library("nnet")
 library("data.table")
 trans_data <- data.table(multinom3_exdata$transitions)
 dat_healthy <- trans_data[state_from == "Healthy"]
 fit_healthy <- multinom(state_to ~ strategy_name + female + age_cat + year_cat, 
                          data = dat_healthy)
 dat_sick <- trans_data[state_from == "Sick"]
 dat_sick$state_to <- droplevels(dat_sick$state_to)
 fit_sick <- multinom(state_to ~ strategy_name + female + age_cat + year_cat, 
                      data = dat_sick)
 fits <- multinom_list(healthy = fit_healthy, sick = fit_sick)
 class(fits)

Run the code above in your browser using DataLab