I am trying to use model-based recursive partitioning(MOB) package partykit in R
to do segmentation, but my data is panel data which has a date and a couple of other columns as well.
Here is an example
id date col1 col2 clo3
1. 200910 ...
1. 200911
1. 200912
2. 200910
2. 200911
2. 200912
So Instead of using logistic regression. I am using plm
package in R to do the modeling. Because I do not want the same id clustered to different clusters. However, when I fit in the regression function to MOB, then it gives me the following error.
Error in UseMethod("logLik") :
no applicable method for 'logLik' applied to an object of class "c('plm', 'panelmodel')
seems that MOB can not extract the log-likelihood from the regression model. I am not 100% sure if that's the reason, and if it is possible to run a panel regression model in the MOB.