I am building a simple GLM model as follows:
model1 = glm(y ~ x1 + x2 + x3, data=train)
And I use predict function to score new prediction
newpred = predict(object=model1, newdata= validation, type = 'term')
By specifying the option type = 'term'
I was hoping to get the the individual term predictions (i.e., beta1 * x1, beta2 * x2 etc). However, it turned out the type = 'term'
option would return 'Centerized' prediction that centers the column values at 0 (as explained here: What does predict.glm(, type="terms") actually do?)
My question is if there is a simple way to get the plain vanilla term prediction rather than the centerized term predictions. The model has categorical variables, I want a single term for each categorical variables (same as the output of the type = 'term'
option) rather than a series of dummy indicator variables.