Chapter 1 Introduction to Loss Data Analytics

Chapter Description

This course introduces readers to methods of analyzing insurance data. Section 1.1 begins with a discussion of why the use of data is important in the insurance industry. Section 1.2 gives a general overview of the purposes of analyzing insurance data which is reinforced in the Section 1.3 case study. Naturally, there is a huge gap between the broad goals summarized in the overview and a case study application; this gap is covered through the methods and techniques of data analysis covered in the rest of the text.

  • Although not needed to go through the tutorials, some users may wish to download the overheads that the videos are based on.
  • By watching the videos and working through the tutorial exercises, you will get an appreciation for the foundations of loss data analytics. For a deeper dive, see the corresponding chapter in the textbook, Chapter One of Loss Data Analytics.

1.1 Relevance of Analytics to Insurance Activities


In this section, you learn how to:

  • Summarize the importance of insurance to consumers and the economy.
  • Describe analytics.
  • Identify data generating events associated with the timeline of a typical insurance contract.

Video: Insurance and Analytics

Overheads: Insurance and Analytics (Click Tab to View)

Hide
Hide
Hide
Hide
Hide

1.2 Insurance Company Operations


In this section, you learn how to:

  • Describe five major operational areas of insurance companies.
  • Identify the role of data and analytics opportunities within the pricing area.

Video: Insurance Company Operations

Overheads: Insurance Company Operations (Click Tab to View)

Hide
Hide
Hide
Hide

1.3 Case Study: Property Fund Introduction


In this section, we use the Wisconsin Property Fund as a case study. You learn how to:

  • Describe how data generating events can produce data of interest to insurance analysts.
  • Produce relevant summary statistics for each variable.
  • Describe how these summary statistics can be used to develop the cost of insurance.

Sections 1.3, 1.4, and 1.5 analyze aspects of the Wisconsin Property Fund. Although not needed for these tutorials, you may wish to get further background on these data that is summarized in Section 1.3 of Loss Data Analytics. Further, as noted in the Preface, although not needed for the tutorials, you can go to Then, do a “Save Page as” if you wish to download. Alternatively, go directly to the Github page to access the data.

Video: Introducing the Wisconsin Property Fund

Overheads: Introducing the Wisconsin Property Fund (Click Tab to View)

Hide
Hide
Hide
Hide
Hide
Hide

1.3.1 Exercise. Claim Frequency

Assignment Text

The Wisconsin Property Fund data has already been read into a data frame called Insample. These data consist of claim experience for fund members over the years 2006-2010, inclusive. It includes the frequency of claims Freq as well as the claim year Year. The video explored the distribution of the claims frequency for year 2010; in this assignment, we replicate this analysis and conduct a similar investigation for year 2009.

Instructions. For each year:

  • Use the function subset() to create a smaller data set based on a single year.
  • Define the frequency as a global variable.
  • Use the function length() to determine the number of observations in a vector.
  • Use the function mean() to calculate the average.
  • Use the function table() to tabulate the frequency distribution.


eyJsYW5ndWFnZSI6InIiLCJwcmVfZXhlcmNpc2VfY29kZSI6Ikluc2FtcGxlIDwtIHJlYWQuY3N2KFwiaHR0cHM6Ly9yYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tL09wZW5BY3RUZXh0cy9MREFDb3Vyc2UxL21haW4vRGF0YS9JbnNhbXBsZS5jc3ZcIiwgaGVhZGVyPVQsXG4gICAgICAgICAgICAgICAgICAgICAgbmEuc3RyaW5ncz1jKFwiLlwiKSwgc3RyaW5nc0FzRmFjdG9ycz1GQUxTRSkiLCJzYW1wbGUiOiIjICBBbmFseXNpcyBmb3IgWWVhciAyMDEwXG5JbnNhbXBsZTIwMTAgPC0gc3Vic2V0KEluc2FtcGxlLCBZZWFyPT0yMDEwKVxuRnJlcTIwMTAgPC0gSW5zYW1wbGUyMDEwJEZyZXFcbiggTGVuZzIwMTA8LSBsZW5ndGgoRnJlcTIwMTApIClcbiggTWVhbjIwMTA8LSBtZWFuKEZyZXEyMDEwKSApXG4oIFRhYjIwMTA8LSB0YWJsZShGcmVxMjAxMCkgKVxuXG4jICBBbmFseXNpcyBmb3IgWWVhciAyMDA5XG5JbnNhbXBsZTIwMDkgPC0gPz9cbkZyZXEyMDA5IDwtID8/XG4oIExlbmcyMDA5PC0gbGVuZ3RoKD8/KSApXG4oIE1lYW4yMDA5PC1tZWFuKD8/KSApXG4oIFRhYjIwMDk8LXRhYmxlKD8/KSApIiwic29sdXRpb24iOiIjICBBbmFseXNpcyBmb3IgWWVhciAyMDEwXG5JbnNhbXBsZTIwMTAgPC0gc3Vic2V0KEluc2FtcGxlLCBZZWFyPT0yMDEwKVxuRnJlcTIwMTAgPC0gSW5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GVkX21zZz1FcnJvcjE5KSAlPiUgY2hlY2tfcmVzdWx0KCkgJT4lIGNoZWNrX2VxdWFsKGluY29ycmVjdF9tc2c9RXJyb3IyMClcbmV4KCkgJT4lIGNoZWNrX29iamVjdChcIk1lYW4yMDA5XCIsIHVuZGVmaW5lZF9tc2c9RXJyb3IyMSkgJT4lIGNoZWNrX2VxdWFsKGluY29ycmVjdF9tc2c9RXJyb3IyMilcbmV4KCkgJT4lIGNoZWNrX2Z1bmN0aW9uKFwidGFibGVcIiwgbm90X2NhbGxlZF9tc2c9RXJyb3IyMykgJT4lIGNoZWNrX3Jlc3VsdCgpICU+JSBjaGVja19lcXVhbChpbmNvcnJlY3RfbXNnPUVycm9yMjQpXG5leCgpICU+JSBjaGVja19vYmplY3QoXCJUYWIyMDA5XCIsIHVuZGVmaW5lZF9tc2c9RXJyb3IyNSkgJT4lIGNoZWNrX2VxdWFsKGluY29ycmVjdF9tc2c9RXJyb3IyNilcblxuc3VjY2Vzc19tc2coXCJHZXR0aW5nIHN0YXJ0ZWQgaXMgYWx3YXlzIHRoZSBoYXJkZXN0IHRoaW5nIHRvIGRvLiBFeGNlbGxlbnQgc3RhcnQhXCIpIiwiaGludCI6IlRha2Ugc29tZSB0aW1lIHRvIGV4cGxvcmUgdGhlIG9ubGluZSA8Y29kZT5SPC9jb2RlPiBkb2N1bWVudGF0aW9uLjwvcD5cblxuPHA+Tm90ZSB0aGUgZG91YmxlIGVxdWFsIHNpZ25zIDxjb2RlPj09PC9jb2RlPiBuZWVkZWQgZm9yIHRoZSB0aGUgPGNvZGU+c3Vic2V0KCk8L2NvZGU+IGZ1bmN0aW9uLiJ9

1.4 Property Fund Claim Severity

Video: Claim Severity for the Wisconsin Property Fund

Overheads: Claim Severity for the Wisconsin Property Fund (Click Tab to View)

Hide
Hide
Hide
Hide
Hide
Hide
Hide

1.4.1 Exercise. Exploring Claim Severities

Assignment Text

The Wisconsin Property Fund data covering years 2006-2010 has already been read into a data frame called Insample. These data includes the average claim severity yAvg. The video explored the distribution of the claims severity for year 2010; in this assignment, we conduct a similar investigation for year 2009.

Instructions

  • Use the function subset() twice, once to create a smaller data set based on year 2009 experience and again to restrict consideration to fund members with positive claims.
  • From this subset, define the average claim severity as a global variable.
  • Use the function length() to determine the number of members with positive claims.
  • Use the function summary() to calculate several summary statistics.
  • Use the function hist() to produce histograms that visualize the claim severity distribution. Do this once on the original scale and again on the logarithmic scale. Use the mfrow switch in the function par() to set the graphical parameters so that the graphs can be viewed side-by-side to promote comparisons.


eyJsYW5ndWFnZSI6InIiLCJwcmVfZXhlcmNpc2VfY29kZSI6Ikluc2FtcGxlIDwtIHJlYWQuY3N2KFwiaHR0cHM6Ly9yYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tL09wZW5BY3RUZXh0cy9MREFDb3Vyc2UxL21haW4vRGF0YS9JbnNhbXBsZS5jc3ZcIiwgaGVhZGVyPVQsIG5hLnN0cmluZ3M9YyhcIi5cIiksIHN0cmluZ3NBc0ZhY3RvcnM9RkFMU0UpIiwic2FtcGxlIjoiSW5zYW1wbGUyMDA5IDwtIHN1YnNldCg/Pylcbkluc2FtcGxlUG9zMjAwOSA8LSBzdWJzZXQoSW5zYW1wbGUyMDA5LCB5QXZnPjApXG5BdmdDbGFpbTwtIEluc2FtcGxlUG9zMjAwOSR5QXZnXG5cbiMgVGFibGVcbnN1bW1hcnkoPz8pXG4/PyhBdmdDbGFpbSlcblxuIyBGaWd1cmVzXG5wYXIobWZyb3c9YygxLCA/PykpXG5oaXN0KEF2Z0NsYWltLCBtYWluPVwiXCIsIHhsYWI9XCJBdmVyYWdlIENsYWltc1wiKVxuaGlzdCg/PywgbWFpbj1cIlwiLCB4bGFiPVwiTG9nYXJpdGhtaWMgQXZlcmFnZSBDbGFpbXNcIikiLCJzb2x1dGlvbiI6Ikluc2FtcGxlMjAwOTwtIHN1YnNldChJbnNhbXBsZSwgWWVhcj09MjAwOSlcbkluc2FtcGxlUG9zMjAwOTwtIHN1YnNldChJbn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jdF9tc2c9ZXJyb3IxNilcblxuc3VjY2Vzc19tc2coXCJFeGNlbGxlbnQhIFRoaXMgZXhlcmNpc2UgZmVhdHVyZXMgZGF0YSBtYW5pcHVsYXRpb24gKHRocm91Z2ggc3Vic2V0dGluZyksIGNhbGN1bGF0ZXMgc3VtbWFyeSBzdGF0aXN0aWNzLCBhbmQgcG9ydHJheXMgZGF0YSBncmFwaGljYWxseS4gWW91IGhhdmUgZG9uZSBpdCBhbGwhXCIpIiwiaGludCI6IlRoZSA8Y29kZT5SPC9jb2RlPiBmdW5jdGlvbiA8YSBocmVmPVwiaHR0cHM6Ly93d3cucmRvY3VtZW50YXRpb24ub3JnL3BhY2thZ2VzL2Jhc2UvdmVyc2lvbnMvMy42LjIvdG9waWNzL2xvZ1wiPmxvZygpPC9hPiBkZWZhdWx0cyB0byBuYXR1cmFsIGxvZ2FyaXRobXMuIEl0IGNhbiBhbHNvIGJlIHVzZWQgdG8gcHJvZHVjZSBjb21tb24gKGJhc2UgMTApIGFzIHdlbGwgYXMgb3RoZXIgYmFzZXMuIn0=

1.4.2 Exercise. Skewness of the Claim Severity Distribution

Assignment Text

Many distributions used in insurance analytics are skewed. In this assignment, we demonstrate how to detect the skewness and show that skewness is a feature of an entire data set, not the result of a handful of outlying observations. Specifically, we consider the average claim for year 2010 of the Wisconsin Property Fund data that has been made available in the (global) variable AvgClaim; this variable is only for fund members with positive claims. The video remarked on the skewness of this variable and used a logarithmic transformation to facilitate the analysis. In this assignment, we show how an alternative strategy, omitting unusually large observations, does not address the skewed nature of the distribution.

Instructions

  • Use the functions mean() and median() to compute both the mean and median of AvgClaim. You will see that the mean is much larger than the median, a classic diagnostic approach for establishing the right skewness of a distribution.
  • Use the function order() to order the data in terms of decreasing size.
  • Use the function head() to examine the 10 largest observations.
  • Create 6 histograms, graphically presenting them in panels that have 2 rows and 3 columns. In the first histogram, omit the 9 largest observations. In the second, omit the 6 largest. Continuing this pattern, omit 5 in the third histogram, omit 3 in the fourth, omit 1 in the fifth, and do not admit any in the sixth. A careful inspection of this panel of histograms reveals that the distribution remains skewed, despite repeatedly removing large outlying observations.


eyJsYW5ndWFnZSI6InIiLCJwcmVfZXhlcmNpc2VfY29kZSI6Ikluc2FtcGxlIDwtIHJlYWQuY3N2KFwiaHR0cHM6Ly9yYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tL09wZW5BY3RUZXh0cy9MREFDb3Vyc2UxL21haW4vRGF0YS9JbnNhbXBsZS5jc3ZcIiwgaGVhZGVyPVQsIG5hLnN0cmluZ3M9YyhcIi5cIiksIHN0cmluZ3NBc0ZhY3RvcnM9RkFMU0UpXG5JbnNhbXBsZTIwMTA8LSBzdWJzZXQoSW5zYW1wbGUsIFllYXI9PTIwMTApXG5JbnNhbXBsZVBvczIwMTA8LSBzdWJzZXQoSW5zYW1wbGUyMDEwLCB5QXZnPjApXG5BdmdDbGFpbSA8LSBJbnNhbXBsZVBvczIwMTAkeUF2ZyIsInNhbXBsZSI6Im1lYW4oPz8pXG4/PyhBdmdDbGFpbSlcblxuT3JkZXIuQXZnQ2xhaW0gPC0gQXZnQ2xhaW1bPz8oQXZnQ2xhaW0sIGRlY3JlYXNpbmcgPSBUUlVFKV1cbmhlYWQoT3JkZXIuQXZnQ2xhaW0sIG4gPSA/PylcblxuIyBGaWd1cmVzXG5wYXIobWZyb3c9YygyLDMpKVxuaGlzdChPcmRlci5BdmdDbGFpbVstYygxOjkpXSwgbWFpbj1cIlwiLCB4bGFiPVwiQ2xhaW1zIC0gRHJvcCA5XCIpXG5oaXN0KE9yZGVyLkF2Z0NsYWltWz8/XSwgbWFpbj1cIlwiLCB4bGFiPVwiQ2xhaW1zIC0gRHJvcCA2XCIpXG4/PyhPcmRlci5BdmdDbGFpbVstYygxOjUpXSwgbWFpbj1cIlwiLCB4bGFiPVwiQ2xhaW1zIC0gRHJvcCA1XCIpXG5oaXN0KE9yZGVyLkF2Z0NsYWltWy1jKDE6MyldLCBtYWluPVwiXCIsIHhsYWI9XCJDb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IGNoYW5nZXMgdGhlIHNrZXdlZCBuYXR1cmUgb2YgdGhlc2UgZGlzdHJpYnV0aW9ucy5cIikiLCJoaW50IjoiVGhlIHN5bnRheCA8Y29kZT54W29yZGVyKHgpXTwvY29kZT4gcHJvZHVjZXMgYW4gKGluY3JlYXNpbmcpIG9yZGVyZWQgdmVyc2lvbiBvZiBhIHZlY3RvciA8Y29kZT54PC9jb2RlPi4ifQ==

1.4.3 Exercise. Claim Severity by Year

Assignment Text

Much of insurance analytics is about making predictions of future behavior. To understand distributions in future years, we look at trends in distributions from the current and preceding years. Some simple trends that are helpful not only for understanding but also communicating results to others involve looking at the mean, or average, behavior. In this assignment, we examine 2006-2010 of the Wisconsin Property Fund that has been previously loaded into the data frame Insample. As in the video, by Year we calculate mean values of claims frequency (Freq), average claims severity (yAvg) and coverage (BCcov), as well as the number of fund members.

Instructions

  • Load the library needed to use the function ddply(). (The documentation provides that name of the library needed to run this function.)
  • With this function, produce a data frame with the requisite summary statistics.
  • To document results, provide intuitive names of these summary statistics using the names() function.
  • Before displaying the data frame, tidy up the results a bit by rounding the mean values of claim frequency to three digits using the round() function. Also, present the mean coverage in thousands (of dollars), rounding to zero digits. After tidying up, display the results.


eyJsYW5ndWFnZSI6InIiLCJwcmVfZXhlcmNpc2VfY29kZSI6Ikluc2FtcGxlIDwtIHJlYWQuY3N2KFwiaHR0cHM6Ly9yYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tL09wZW5BY3RUZXh0cy9MREFDb3Vyc2UxL21haW4vRGF0YS9JbnNhbXBsZS5jc3ZcIiwgaGVhZGVyPVQsXG4gICAgICAgICAgICAgICAgICAgICAgbmEuc3RyaW5ncz1jKFwiLlwiKSwgc3RyaW5nc0FzRmFjdG9ycz1GQUxTRSkiLCJzYW1wbGUiOiJsaWJyYXJ5KD8/KVxuVGFibGUxSW4gPC0gZGRwbHkoSW5zYW1wbGUsIGMoXCJZZWFyXCIpLCBzdW1tYXJpemUsICBBdmdGcmVxICAgID0gbW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vcl9tc2cgPWxpYm1zZykgJT4lIGNoZWNrX2VxdWFsKClcbmV4KCkgJT4lIGNoZWNrX29iamVjdChcIlRhYmxlMUluXCIsIHVuZGVmaW5lZF9tc2cgPSBcIk1ha2Ugc3VyZSB0byBub3QgcmVtb3ZlIGBUYWJsZTFJbmAhXCIpICU+JSBjaGVja19lcXVhbCgpXG5zdWNjZXNzX21zZyhcIkV4Y2VsbGVudCEgUHJlc2VudGluZyB0aGUgcmlnaHQgc3VtbWFyeSBzdGF0aXN0aWNzIGluIGEgY2xlYW4gd2F5IGlzIGltcG9ydGFudCBmb3IgY29tbXVuaWNhdGlvbiBvZiByZXN1bHRzLiBJdCBpcyBhbHNvIHZlcnkgdXNlZnVsIGFzIHlvdSBhcmUgdHJ5aW5nIHRvIG1ha2Ugc2Vuc2Ugb2YgYSBjb21wbGV4IGRhdGEgc2V0LlwiKSIsImhpbnQiOiJVc2UgPGNvZGU+bWVhbigpPC9jb2RlPiB0byBjb21wdXRlIG1lYW5zLCBvciBhdmVyYWdlcywgYW5kIHVzZSA8Y29kZT5sZW5ndGgoKTwvY29kZT4gdG8gZGV0ZXJtaW5lIHRoZSBsZW5ndGggb2YgdGhlIHZlY3RvciBvZiBvYnNlcnZhdGlvbnMuIn0=

1.5 Property Fund Rating Variables

Video: Rating Variables for the Wisconsin Property Fund

Overheads: Rating Variables for the Wisconsin Property Fund (Click Tab to View)

Hide
Hide
Hide
Hide
Hide

1.5.1 Exercise. Claim by Entity Type, Fire Class, and No Claim Credit

Assignment Text

Analytics of insurance data has much in common with analytics in other areas but insurance also has its own peculiarities. One of example of this is how one only examines summary statistics for positive claims. (Mathematically, the claim severity distribution is defined conditional on the occurrence of a claim). As a consequence, we often need to write specialized routines for insurance applications.

Your supervisor finds useful the analysis of claims outcomes by entity type, fire class, and no claim code (already completed in the video). To make this analysis more impactful, the supervisor wants you to modify the code to include a basic measure of uncertainty, the standard deviation.

Instructions

  • Modify the function created for this specific analysis, ByVarSumm(), to include the standard deviation statistic. Note that, like the mean, we only calculate the standard deviation on the sub-sample of positive claims.
  • Include this standard deviation statistic as part of your table output.


eyJsYW5ndWFnZSI6InIiLCJwcmVfZXhlcmNpc2VfY29kZSI6Ikluc2FtcGxlIDwtIHJlYWQuY3N2KFwiaHR0cHM6Ly9yYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tL09wZW5BY3RUZXh0cy9MREFDb3Vyc2UxL21haW4vRGF0YS9JbnNhbXBsZS5jc3ZcIiwgaGVhZGVyPVQsXG4gICAgICAgICAgICAgICAgICAgICAgbmEuc3RyaW5ncz1jKFwiLlwiKSwgc3RyaW5nc0FzRmFjdG9ycz1GQUxTRSkiLCJzYW1wbGUiOiJCeVZhclN1bW0gPC0gZnVuY3Rpb24oZGF0YXN1Yil7XG4gIEExIDwtIGxlbmd0aChkYXRhc3ViJEZyZXEpXG4gIEEyIDwtIG1lYW4oZGF0YXN1YiRGcmVxKVxuICBkYXRhc3ViMSA8LSAgc3Vic2V0KGRhdGFzdWIsIHlBdmc+MClcbiAgQTMgPC0gbWVhbihkYXRhc3ViMSR5QXZnKVxuICBBNCA8LSA/PyBcbiAgcmV0dXJuKCBjKEExLEEyLEEzLCA/PykgKVxuICB9XG5cbnQxIDwtIEJ5VmFyU3VtbShzdWJzZXQoSW5zYW1wbGUsIFR5cGVWaWxsYWdlID09IDEpKVxudDIgPC0gQnlWYXJTdW1tKHN1YnNldChJbnNhbXBsZSwgVHlwZUNpdHkgPT0gMSkpXG50MyA8LSBCeVZhclN1bW0oc3Vic2V0KEluc2FtcGxlLCBUeXBlQ291bnR5ID09IDEpKVxudDQgPC0gQnlWYXJTdW1tKHN1YnNldChJbnNhbXBsZSwgVHlwZU1pc2MgPT0gMSkpXG50NSA8LSBCeVZhclN1bW0oc3Vic2V0KEluc2FtcGxlLCBUeXBlU2Nob29sID09IDEpKVxudDYgPC0gQnlWYXJTdW1tKHN1YnNldChJbnNhbXBsZSwgVHlwZVRvd24gPT0gMSkpXG50NyA8LSBCeV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W50aW5nIHlvdXIgb3duIGNvZGUgZm9yIGZ1dHVyZSB1c2Vycy5cIikiLCJoaW50IjoiVG8gY29tcHV0ZSBzdGFuZGFyZCBkZXZpYXRpb25zLCB5b3UgY2FuIHVzZSB0aGUgZnVuY3Rpb24gPGEgaHJlZj1cImh0dHBzOi8vd3d3LnJkb2N1bWVudGF0aW9uLm9yZy9wYWNrYWdlcy9zdGF0cy92ZXJzaW9ucy8zLjYuMi90b3BpY3Mvc2RcIj5zZCgpPC9hPi4ifQ==

Contributors

  • Authors. Yvonne Chueh, Central Washington University, Paul Johnson, University of Wisconsin-Madison, and Edward (Jed) Frees, University of Wisconsin-Madison and Australian National University, are the principal authors of the initial version of this chapter.
  • Chapter Maintainers. Please contact Yvonne and/or Jed at for chapter comments and suggested improvements.