1

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.

user14538
  • 11
  • 1
  • Hi @user14538, welcome to Stackoverflow! You will increase the likelihood that someone answers your question if you provide a minimum reproducible example; for more information about it, take a look at this link: https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – Álvaro A. Gutiérrez-Vargas Jun 24 '21 at 13:07

0 Answers0