Introduction to R and Basic Data Analysis

ACTEX Learning - AFDP: R Session 2.1

Author

Federica Gazzelloni and Farid Flici

Published

October 10, 2024

Set-up

If you haven’t already, please download the material for this session from the Actuarial University Dashboard using the course link below: https://www.actuarialuniversity.com/seminar/View/14826. You’ll find a Session2.zip file with all the necessary files. Make sure to unzip it in the same location of Session1.zip.

Introduction to Predictive Modeling

In the first session of this course, we learned about the basics of R and how to perform basic data analysis. In this session, we will delve deeper into predictive modeling and practice using R functions in various actuarial contexts. We will also learn how to manage CSV files, explore R packages for data analysis, and apply our knowledge to a practical project.

Learning Objectives

  • Utilize statistical modeling and simulation techniques
  • Make R functions to use in various actuarial contests
  • Practice managing csv files
  • Learn about R packages for data analysis
  • Apply learned R functions and concepts to a practical project

R is particularly suited for predictive modeling in actuarial work because it supports complex statistical analysis, has a vast collection of libraries (glm, rpart, randomForest, survival), and offers extensive visualization tools to communicate results effectively. Traditional statistical methods (like GLMs) and modern machine learning techniques (like Gradient Boosted Trees - GBMs and decision trees), can be implemented all within the same environment.

Examples

  • Building a linear regression model to predict a company’s sales based on advertising spend.
  • Using a decision tree to classify whether a customer will churn based on demographic and behavioral data.

Resources