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!

  • $\begingroup$ The title of your question refers to this as being an analysis "over time" but you presently do not have time as a variable in your data. May we presume that each record of a rating and loyalty (a strange name for the number of items bought) also comes with a date/time? $\endgroup$
    – Ben
    May 29 at 3:46

2 Answers 2


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.

  • $\begingroup$ Thank you for your comment. I will definitely look into customer retention. The amount the customer paid isn't really interesting information, as all the customers pay the same (it's a subscription customers can cancel on a monthly basis). I didn't think of doing the regression model on a log scale. Will look into this as well. Thanks for the help! $\endgroup$
    – Diederik
    Dec 6, 2015 at 20:12

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.

  • 2
    $\begingroup$ this question is six years old.. why did it show up in my feed..? ^^ $\endgroup$
    – Ben
    Apr 11 at 6:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.