Customer satisfaction over time in R As a side project I am currently working on determining customer satisfaction over time for quite a large company. We have over 100,000 records in our dataset which need to be analysed. The dataset looks like this:
╔════════╦════════╦═════════╗
║ CustID ║ Rating ║ Loyalty ║
║ 3001   ║ 5      ║ 1       ║
║ 3001   ║ 4      ║ 2       ║
║ 3001   ║ 4      ║ 3       ║
║ 3001   ║ 5      ║ 4       ║
║ 5214   ║ 3      ║ 1       ║
║ 5214   ║ 5      ║ 5       ║
║ 5214   ║ 2      ║ 15      ║
║ 5214   ║ 4      ║ 16      ║
╚════════╩════════╩═════════╝

A customer can rate a product from 1 to 5. The loyalty is the amount of products the customer purchased from us. Please note: there are a lot of gaps in this data as customers don't always respond. As you can see, customer 5214 only responded 4 times while he purchased more than 16 products.
The research question is:
Do customers become happier with our products as they buy more?
So I looked at both panel data and time-series cross-sectional data analysis, but this seems like the wrong direction to go because it gives detailed information about each specific customer (see here: http://www.princeton.edu/~otorres/Panel101R.pdf)
What we want is an overview of what customers generally speaking think. So I am looking for the best way to achieve this. Preferably in R, but this is of course not necessary. A link to a theory would also be incredibly helpful!
I hope I have provided enough background information on the case. If not, please do let me know!
 A: I assume you use have information about products customers purchased, so there are few things one can calculate:


*

*Customer retention rate quarterly or maybe annually, depending on your company needs. This is a general picture that can be used as some sort of simple "scoring" mechanism.

*I would also suggest getting total amount customer paid, and looking at correlation between how much customer paid per order vs. rating and loyalty.

*To do additional analysis you can use those 2 metrics from above and cluster customers into several groups to suggest the strategy to increase "loyalty", that is conversion of customer into profit.

*And, finally, simplest thing is to just do a scatter plot of rating vs loyalty and try to see either linear or some geometric regression. There might be some sort of regression model that could fit the data. Just remember, if there is a big difference between data, try to use logarithmic scale rather than normal values.
A: I would check the relationship between Rating and Loyality over time.
Either by a simple scatter plot and check visually for a correlation or you could also calculate it.
Next, I would run a linear model by Rating ~ time + Loyalty and check the summary/statistics. Hence, I don't think a linear/random model is wrong, here. A random model makes only sense when you can group/summarize all the customers somehow, but a linear model without random effects will provide general information.
