R/params_mlogit_list.R
params_mlogit_list.Rd
Create a list containing the parameters of multiple fitted multinomial logit models.
Can be used to parameterize state transitions in a discrete time transition model
by passing to the params
field of a CohortDtstmTrans
object.
params_mlogit_list(...)
Objects of class params_mlogit
, which can be named.
An object of class params_mlogit_list
, which is a list containing
params_mlogit
objects.
# Consider a sick-sicker model
params <- params_mlogit_list(
## Transitions from sick state (sick -> sicker, sick -> death)
sick = params_mlogit(
coefs = list(
sicker = data.frame(
intercept = c(-0.33, -.2),
treat = c(log(.75), log(.8))
),
death = data.frame(
intercept = c(-1, -1.2),
treat = c(log(.6), log(.65))
)
)
),
## Transitions from sicker state (sicker -> death)
sicker = params_mlogit(
coefs = list(
death = data.frame(
intercept = c(-1.5, -1.4),
treat = c(log(.5), log(.55))
)
)
)
)
summary(params)
#> from to term mean sd 2.5% 97.5%
#> <char> <char> <char> <num> <num> <num> <num>
#> 1: sick sicker intercept -0.2650000 0.09192388 -0.3267500 -0.2032500
#> 2: sick sicker treat -0.2554128 0.04563563 -0.2860686 -0.2247570
#> 3: sick death intercept -1.1000000 0.14142136 -1.1950000 -1.0050000
#> 4: sick death treat -0.4708043 0.05659874 -0.5088246 -0.4327840
#> 5: sicker death intercept -1.4500000 0.07071068 -1.4975000 -1.4025000
#> 6: sicker death treat -0.6454921 0.06739447 -0.6907644 -0.6002198
params
#> A "params_mlogit_list" object
#>
#> Summary of coefficients:
#> from to term mean sd 2.5% 97.5%
#> <char> <char> <char> <num> <num> <num> <num>
#> 1: sick sicker intercept -0.2650000 0.09192388 -0.3267500 -0.2032500
#> 2: sick sicker treat -0.2554128 0.04563563 -0.2860686 -0.2247570
#> 3: sick death intercept -1.1000000 0.14142136 -1.1950000 -1.0050000
#> 4: sick death treat -0.4708043 0.05659874 -0.5088246 -0.4327840
#> 5: sicker death intercept -1.4500000 0.07071068 -1.4975000 -1.4025000
#> 6: sicker death treat -0.6454921 0.06739447 -0.6907644 -0.6002198
#>
#> Number of parameter samples: 2
#> Number of starting (non-absorbing) states: 2
#> Number of transitions by starting state: 2 1