Apologies, but it looks like my question is off topic for this forum. Thanks for all the excellent replies though. For those who have come across this question if they've been looking for something similar - then the short answer to my question below is very likely 'no'.
Please note this question has been edited in the light of the excellent responses below.
Can anyone recommend a way to easily ‘simplify’ the effects of variables in an R based GLM model? By simplify I mean any or all of the following:
- Group levels of a variable with similar effects.
- Apply a curve to the effects of an ordinal variable.
- Hand-smooth / alter the effects of a variable.
- Band (and re-band) a continuous variable.
Given that one has accepted the pros and cons of taking any of these approaches, are there any packages that might help with this? I’ve drawn a blank so far.
Thanks everyone for your responses.
For clarity (I hope) I have edited the question to remove the (inadvertent) confusing use of terminology , notably removing the use of ‘factor’, which I used in the original wording as a general term for ‘predictor variable’ rather than in the particular R sense of a variable with specific levels (something which as a relatively new user of R I unfortunately overlooked).
Also please note that I’m asking this question from an actuarial rather than a pure research standpoint.
In this field, there are reasonably well understood risk profiles (the chance of having a car accident, illness or death at different age for instance) and also a degree of leeway in applying ‘reasonable’ tweaks to the effects of individual variables (to the extent that most practitioners end up using software specifically designed for this purpose - a package called ‘Emblem’ being pretty much ubiquitous in the insurance industry in the UK).
I’m aware of the costs and benefits of treating any results in this way, but was just wondering if there were methods in R that could aid the process once the pros and cons are accepted.
Original Question:
Can anyone recommend a way to easily ‘simplify’ factors in an R based GLM model? By simplify I mean any or all of the following:
- Combine levels of a factor with similar effects.
- Apply a curve to the effects of a factor. Hand-smooth / alter the effects of a factor.
- Band (and re-band) factors in the model.
Are there any packages that might help with this? I’ve drawn a blank so far.