Skip to the content.

Predictive analytics in R

Exam PA is the Society of Actuaries exam in predictive analytics. The sitting is 5 hours and 15 minutes on a Prometric computer with RStudio and Excel, and the work product is a report in Word. The difficult part is communication in both directions: reading the business question closely enough to know which analysis it is asking for, and writing what you did so a grader can follow the choices.

This guide is the R companion for that exam. It goes from loading a data set, cleaning it, and plotting it through the models on the syllabus, then saying what those models are worth in ordinary business language. The modeling chapters follow the same discipline as An Introduction to Statistical Learning: fit on a training set, check the fit on data the model has not seen, and keep the advantages and disadvantages of each method next to the output.

The syllabus weight is about 30–40% writing, 15–25% manipulating data in R, and 40–50% machine learning and statistics. Writing means professional language at a pace that can finish a report, on the order of 50 words a minute. The R portion is cleaning, finding data errors planted in the file, and the usual queries: aggregations, summaries, and transformations. The modeling portion is reading the output in the business setting of the project and changing a parameter because the task asked for that change. The SOA exam page is the source for the current syllabus. Pass rates compiled by actuarial-lookup have been about half of candidates.

The early chapters are the tools that show up on every task. Getting started installs R and RStudio, the ExamPAData package, and ISLR. The R chapter is the subset you need on exam day: notebook chunks, basic operations, lists, functions, and data frames, worked against SOA PA 6/16/20, Task 8. Data exploration covers histograms, box plots, scatterplots, and bar charts, then dplyr for chained summaries, missing values, and the check for whether a column is a factor or a number before it goes into a model.

The modeling half starts with ordinary least squares, R-squared, and Pearson and Spearman correlation, then the split between a regression target and a classification target. Generalized linear models cover an identity link and a log link for a continuous response, a logit for a binary response, how to read a coefficient on each link, and area under the ROC curve. Decision trees, random forests, and gradient boosted trees come next, then unsupervised methods: principal components, k-means, and hierarchical clustering, including past-exam tasks such as SOA PA 6/12/19, Task 3. The writing chapter is spelling, grammar, and how the numerical work becomes the memo. Use the guide with the SOA modules. The welcome page keeps the FAQ, including a 160-hour study sketch that still has to fit around SRM, prior R experience, and how comfortable you are writing under a clock.

## How the manual is organized - **The exam and the Prometric setup.** What the sitting asks for, and the computer you will actually use. See The exam and the Prometric demo. - **Introduction.** Overfitting, underfitting, holdout data, and a loss function, told through the way you already study for an exam. See the introduction. - **Getting started and the R you need.** Install R and RStudio, load ExamPAData and ISLR, then chunks, lists, functions, and data frames. See Getting started and How much R do I need to know to pass? - **Data exploration.** Graphs, dplyr, missing values, and past tasks that reward looking before you fit anything. See Data exploration. - **Linear models and GLMs.** OLS, correlation, regression versus classification, link functions, coefficient interpretation, and AUC. See Introduction to modeling. - **Trees and unsupervised learning.** Decision trees, random forests, gradient boosting, PCA, k-means, and hierarchical clustering. See Tree-based models and Unsupervised learning. - **Writing.** Turn the output into the report the grader reads. See Writing and communication and the references. ## Read a chapter

The exam

Sitting

Five hours and 15 minutes, a Word report, and the split between writing, data work in R, and modeling.

Cheat sheets, notebook chunks, operations, lists, functions, and data frames, with SOA PA 6/16/20, Task 8.

Histograms, box plots, scatterplots, bar charts, missing values, and whether a column is a factor or a number.