Skip to content
Prev 82332 / 398502 Next

Matrix of dummy variables from a factor

_______________________________________________________________________________________


Interestingly, for the project I'm working on I actually do call
model.matrix directly. The project is profit optimization for insurance,
where you try to maximize returns as a function of your premium formula.
The premium formula itself is essentially the output from a regression
model, so the parameters are coefficients for various rating factors. To
do the optimization, I create the model matrix of dummy variables
corresponding to the individual parameters, and use that in the
objective function.

Of course, this really amounts to writing my own modelling function, so
I'm not sure if it counts as "straightforward".

PS. Have my messages suddenly had word wrap turned off? Just noticed
this in my recent posts to the list.