Hi Nick,
I understand that you are trying to learn the difference between “fitglm” and “fitLifetimePDModel” functions and want to know why the functions are producing same results.
- The “fitLifetimePDModel” function is specifically designed to handle panel data for lifetime models, where each observation represents a customer with multiple data points over time considering the dependence and correlation among the observations within each individual when fitting the model.
- On the other hand, “fitglm” is a more general function for fitting generalized linear models, including logistic regression and Poisson regression, treating each observation as independent, without considering any panel structure.
- The reason for the results to be exactly same is that both “fitLifetimePDModel” and “fitglm” use logistic regression with the same link function (logit) and distribution (binomial) when fitting the model. In your “fitglm” function call, you explicitly specified the logistic regression formula, which matches the formula used by “fitLifetimePDModel”. Therefore, the resulting models are identical.
Please refer to the below documentation to learn more about “fitglm” and “fitLifetimePDModel” functions:
- https://www.mathworks.com/help/stats/fitglm.html
- https://www.mathworks.com/help/risk/fitlifetimepdmodel.html
Hope it helps.
Regards,
Sai Pavan