I have the following code
attrWeights = list(time = exp(b_tt)/(exp(b_tt)+exp(b_tc)+exp(b_hw)+exp(b_ch)),
cost = exp(b_tc)/(exp(b_tt)+exp(b_tc)+exp(b_hw)+exp(b_ch)),
headway = exp(b_hw)/(exp(b_tt)+exp(b_tc)+exp(b_hw)+exp(b_ch)),
changes = exp(b_ch)/(exp(b_tt)+exp(b_tc)+exp(b_hw)+exp(b_ch)))
It's pretty cumbersome to type in the denominator many times. Is there a way to simplify, such that
time = exp(b)/ c
, where c
is the summation of all the exponent terms?
thanks.