kasaai / pc-pricing-tutorial

Practical Ratemaking
https://ratemake.com/
Other
34 stars 8 forks source link

Contrast treatment #110

Open marcopark90 opened 5 years ago

marcopark90 commented 5 years ago

This issue tracks progress and decisions related to contrast treatment for categorical variables. As per discussion on the slack workspace:

Basically it seems that there are two different approaches here:

  1. Set the contrast so the group mean is assigned to the intercept
  2. Set the contrast so the group reference level is assigned to the intercept. These two approaches will lead to the following results:
  3. In this case any new "unseen" levels will have the group mean of the variable.
  4. In this case, assuming the reference level is the one with the highest level of exposure, any 'unseen' variable will have the group mode of the variable. The question is then if it is better to pick the mean or the mode.