ACTEX PA 8ed Preface
ACTEX PA 8ed Preface
ACTEX PA 8ed Preface
(Predictive Analytics)
8th Edition
Contents
Preface v
I A Crash Course in R 1
1 Basics of R Programming 3
1.1 Getting Started in R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.1.1 Basic Infrastructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.1.2 Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.2 Data Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.2.1 Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.2.2 Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.2.3 Data Frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
1.2.4 Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
1.2.5 Sidebar: Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
1.3 Basic Data Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
1.4 for Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
1.5 End-of-Chapter Practice Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
i
ii CONTENTS
Copyright © 2022 ACTEX Learning ACTEX Study Manual for Exam PA (8th Edition)
Ambrose Lo
CONTENTS iii
Copyright © 2022 ACTEX Learning ACTEX Study Manual for Exam PA (8th Edition)
Ambrose Lo
iv CONTENTS
Copyright © 2022 ACTEX Learning ACTEX Study Manual for Exam PA (8th Edition)
Ambrose Lo
Preface
NOTE TO STUDENTS
These are some of the most common comments PA exam candidates who studied for the exam solely
using the SOA’s e-learning modules have voiced on Internet forums (e.g., the old Actuarial Outpost,
Reddit). These “complaints” and the importance of passing this exam to earn the Associateship
of the Society of Actuaries (ASA) designation in today’s exam curriculum have motivated us to
develop a completely new Exam PA study manual with the goal of streamlining, synthesizing, and
augmenting the materials in the PA e-learning modules in a coherent and easy-to-follow manner.
With this manual, you will have in your possession a reliable learning resource that hosts all of the
useful materials in a single place and shows you how to prepare for this exam in the most effective
and efficient way possible. There is no longer a need to alternate among the e-learning modules,
the suggested textbooks in the syllabus, R markdown files, and additional online readings. Starting
from the very basics and adopting a case study approach, we will learn fundamental concepts in
predictive analytics, implement predictive models in R (a powerful programming language) step by
step in concrete settings, make some fancy and informative graphs, understand what the output in
R means, and write your responses to the liking of PA exam graders. No prior knowledge in R or
the SRM exam material is assumed.
Exam Administrations
Exam PA (Predictive Analytics) is a computer-based exam offered for the first time in December
2018 by the Society of Actuaries (SOA). Effective from April 2023, the exam time will decrease from
5.25 hours to 3.5 hours, and there are two sittings each year, one in April and one in October, with
v
vi CONTENTS
each testing window lasting for four days.i In April 2023, the exam will be delivered via computer-
based testing (CBT) in a Prometric exam center on April 18-21. The registration deadline is March
14. More information about Exam PA can be found at the SOA’s official web page:
https://www.soa.org/education/exam-req/edu-exam-pa-detail/.
Once you have registered for the exam and paid the $1,125 exam fee (a lot!), you will receive access
to the PA e-learning modules until the end of the month in which the exam is administered. In view
of the new exam format in 2023, the modules have been streamlined from 9 modules to 5 modules,
plus an additional module that provides an introduction to R. (Well, with this study manual, going
over the modules is not necessary. ,)
• A computer equipped with Microsoft Word, Microsoft Excel, and a PDF reader.
According to the April 2023 PA exam syllabus, the Prometric computers will have the 2016
versions of Microsoft Word and Excel.
• A project statement in the form of a Word document breaking down the business problem into
a series of well-defined tasks you are required to complete. While all tasks refer to the same
business problem and dataset, they can be answered independently. Some tasks are further
broken down into one or more subtasks. These (sub)tasks typically test the following skills:
Specific guidance will be provided in each task to help you stay on track.
i
Over the four days in each sitting, there are usually two different sets of exam papers, but the four days may be
shuffled randomly to reduce cheating (e.g., day 1 may be paired with day 2, day 3, or day 4).
ii
The business problem is not necessarily actuarial in focus. Even if it is actuarially related, there is no expectation
that candidates have specific product or practice-area knowledge.
Copyright © 2022 ACTEX Learning ACTEX Study Manual for Exam PA (8th Edition)
Ambrose Lo
CONTENTS vii
The whole exam is expected to carry a total of 70 points,iii with the points for each task
and subtask shown at the beginning of the (sub)task. As the exam lasts for 3.5 hours, or
210 minutes, on average you should spend 3 minutes per exam point. A 10-point task, for
example, should translate to approximately 30 minutes of work. If you have worked on that
task for 50 minutes, then you know that it is time to move on.
• The Word document that contains the project statement includes designated spaces for you
to type your written responses to different exam tasks and subtasks.
At the end of the exam, you will upload the entire Word file for grading. You will be assessed on
both the technical accuracy of your work as well as the clarity of your thought process. Unlike
other ASA exams, questions in Exam PA tend to be more open-ended (but, thankfully, less open-
ended than the notorious FAP ,) and sometimes there is not a unique best solution, as is true of
modeling in practice. To score high, you are expected to justify the decisions you make carefully
and adequately.
As you can see, the shift of exam focus from working out multiple-choice problems efficiently to
crafting computer-aided written responses makes Exam PA a completely different (and hopefully
enjoyable and practical!) learning experience compared with all other ASA exams you have taken.
To study for this exam effectively:
You will have to spend time understanding the subject, at least at a conceptual level,
and learning how to communicate your thoughts in appropriate language precisely and
concisely. You can’t expect to do well just by drilling mechanical practice problems!
Starting with the April 2023 administration, R and RStudio (a convenient platform to
implement R) will not be available on the exam.
How will this “big” change affect the exam and our preparation? The answer I have in mind is:
You will learn the material and prepare for the exam in essentially the same way, perhaps
paying less attention to coding.
Even when R and RStudio were available in past sittings (from December 2018 to October 2022),
Exam PA was never a coding exam. Candidates did have to know some R, but only to the extent
that they understood what the code (contained in a separate R markdown file generously provided
by the SOA) was doing and knew how to make minor adjustments if necessary. The focus of the
exam has always been on understanding and interpretation. On the exam, there are numerous
instances in which you are asked to explain the predictive analytic concepts covered in this exam
(see Part II of this manual) in the context of whatever business problem you are given. There are
various decisions you have to make and justify, based on a combination of the R output you see
and your prior knowledge of predictive analytics. In short, R is only a tool to implement predictive
analytic models. With R and RStudio no longer available on the exam, perhaps the main difference
iii
In the old 5-hour exam format, the exam carried a total of 100 points, so by a simple proportion, 3.5 hours
translate to 70 points.
Copyright © 2022 ACTEX Learning ACTEX Study Manual for Exam PA (8th Edition)
Ambrose Lo
viii CONTENTS
is that the code and output relevant to the exam tasks will be provided directly in the project
statement; you need not take the trouble to run the code in RStudio or see the R output. The
emphasis on conceptual understanding is likely to remain (or will even be greater).
There is one change I do expect to see in the new exam format:
There may be more tasks where you have to do some simple manual calculations based
on the R output given.
With all the useful code and output given in the project statement, you may be asked to explain
how a certain number in the output means or is calculated, or to use the output to do some simple
arithmetic calculations. This is a good way for the SOA to test your conceptual understanding.
Remember to bring an approved financial calculator with you...you can’t just ask R to do the nasty
work!
The pass rates, which are usually in the 50-65% range (they became noticeably higher after COVID-
19 broke out), are higher than those of other ASA-level exams, which are typically 40-50%. Mean-
while, about half of the candidates failed every time, even among those who have reached this far
in the exam journey. I have heard of candidates who have failed the exam twice or thrice /, so the
exam is neither a beast nor a breeze! Moreover, the exam is offered only twice a year, so if you fail,
you will need to wait another six months, which adds a lot to your travel time to ASA.
iv
The statistics for the October 2022 PA exam will be available on https://www.soa.org/education/
general-info/exam-results/edu-exam-results-detail/ on January 6, 2023.
Copyright © 2022 ACTEX Learning ACTEX Study Manual for Exam PA (8th Edition)
Ambrose Lo
CONTENTS ix
SRM vs. PA
From December 2018 to June 2021, Exam SRM (Statistics for Risk Modeling) was a formal prereq-
uisite for Exam PA. Although this requisite has been removed, knowledge of the SRM materials is
still assumed, so it is reasonable to prepare for PA at the same time as or shortly after taking SRM.
As a rough estimate:
• You need about two months of intensive study to master the materials in Exam PA and get
fully ready, if you earn the credit for Exam SRM by formally passing the exam. While your
knowledge from Exam SRM is definitely useful, you will need time to gain hands-on experience
with fitting and interpreting predictive models in R, and need practice on communicating your
findings.
• You need about three months of intensive study to master the material in Exam PA and get
fully ready, if you earn the credit for Exam SRM by transition credit. Note that this study
manual is self-contained in the sense that it does not assume any prior knowledge from Exam
SRM. All of the theory will be explained from first principles in precise and concise terms,
and you will be able to follow every bit even if you have not taken Exam SRM.
In essence, Exams SRM and PA are about the same subject, but test it differently. While Exam
SRM emphasizes the underlying theory, covering the uses, motivations, mechanics, pros and cons,
do’s and don’ts of, and similarities and differences between different predictive analytic methods,
Exam PA applies and illustrates the theory you learned in Exam SRM to real data by means of
computer-based implementations using R. Some practical considerations are also presented. While
there will be fewer instances in which you have to apply mathematical formulas or do calculations
by hand, in Exam PA you have to explain your thoughts clearly, which depends very much on
whether you have a solid understanding of the subject. After taking Exam PA, you will see the
predictive analytic techniques you learned in Exam SRM in action and gain a much more thorough
understanding.
Copyright © 2022 ACTEX Learning ACTEX Study Manual for Exam PA (8th Edition)
Ambrose Lo
x CONTENTS
If you use this PA study manual, you can rest assured that it is written from an exam taker’s
perspective by a professional instructor who has experienced the “pain” of PA candidates and truly
understands their needs. Drawing upon his “real battle experience” and firm grasp of the exam
topics, the author will go to great lengths to help you prepare for this challenging exam in the best
possible way. You are in capable hands.
Copyright © 2022 ACTEX Learning ACTEX Study Manual for Exam PA (8th Edition)
Ambrose Lo
CONTENTS xi
• Chapter 7: My commentary on the SOA’s past and sample PA projects, which are indicative
of the SOA’s expectations on PA candidates
• Chapter 8: A cheat sheet that provides a broad overview of the entire PA exam, which is
useful for last-minute exam preparation
• Chapter 9: Two original full-length practice exams updated for the new exam format and
designed to mimic the real PA exam in terms of style and difficulty, with detailed illustrative
solutions provided
After you complete Part III, you will be fully ready to take (and pass!) the April 2023 PA exam.
Other Features
This manual throughout is also characterized by the following features that make your learning as
smooth as possible:
• Each chapter in Parts I and II starts by explicitly stating which learning objectives and
outcomes of the PA exam syllabus we are going to cover, to assure you that we are on track
and hitting the right target.
• Objects in R are shown in typewriter font and code chunks with output in gray boxes for easy
identification. Functions and commands that are of importance are boxed to aid retention.
• Important exam items and common mistakes committed by students are highlighted by boxes
that look like:
EXAM NOTE
Copyright © 2022 ACTEX Learning ACTEX Study Manual for Exam PA (8th Edition)
Ambrose Lo
xii CONTENTS
• The main text of this manual is interspersed with more than 100 exercises, all with complete
solutions, to assess your understanding. Some of these exercises are based on recent SOA and
CAS exams (if you have used the ACTEX Study Manual for Exam SRM, you may have seen
some of these past exam questions in some form, but I have rewritten them in the language of
Exam PA. There is also no harm in giving them a second look!), but many are original. These
examples are instrumental in illustrating a number of conceptual items that can be tested in
Exam PA.
Supplementary Files
This study manual comes with a number of supplementary files (e.g., R Markdown files with com-
pletely reproducible R code, datasets, and files to be released) that can be downloaded from the
Actuarial Learning portal:
www.actuariallearning.com.
All users of the manual, printed or digital, will receive by email a keycode that gives them elec-
tronic access to all supplementary files shortly after their order is placed. If for some reason you
can’t retrieve that email (be sure to check your junk/spam folders), please reach out to sup-
[email protected] for assistance.
It is recommended (but not absolutely essential, given the new exam format) that you run the
R Markdown files as you work through this manual, making sure that your output agrees with
what is shown here. This is especially important if you have ordered a printed copy of this study
manual—run the code to see the beautiful colors! ,
NOTE
Copyright © 2022 ACTEX Learning ACTEX Study Manual for Exam PA (8th Edition)
Ambrose Lo
CONTENTS xiii
Instructional Videos
Instructional videos (https://www.actexmadriver.com/orderselection.aspx?id=453147851) ac-
companying the core of this manual (Parts I and II, or Chapters 1 to 6) are available for purchase as
an add-on. In these videos, I will walk you through the fundamental concepts in predictive analytics
and the construction of predictive models in R step by step, with a strong emphasis on key test
items in Exam PA. With the aid of visuals, these videos aim to make the materials in the manual
as accessible as possible and will add substantial value to your learning.
Contact Us
If you encounter problems with your learning, we stand ready to help.
• For technical issues (e.g., not able to access, download, or print supplementary files from
the Actuarial Learning portal, extending your digital license, upgrading your product), please
email Customer Service at [email protected] or leave a message at https://www.
actuariallearning.com/Support.
• Questions related to specific contents of this manual, including potential errors, can be directed
to me by emailing [email protected]. Please note:
Be sure to mention which specific pages of the manual your questions are about.
(If you are using the digital version of the manual, please point out the exact pages in
the header of the PDF file, not in the online portal, e.g., this page is page xiii.)
(Less important in the new exam format) If you experience issues with R, e.g., your code
can’t run and you keep seeing weird error messages, please provide the version of R (not
RStudio!) you are using and a screenshot of the code you use and the error messages.
NOTE
Acknowledgments
I am grateful to Mr. Tony Pistilli for proofreading an early version of this study manual. All errors
that remain are solely mine.
Copyright © 2022 ACTEX Learning ACTEX Study Manual for Exam PA (8th Edition)
Ambrose Lo
xiv CONTENTS
Copyright © 2022 ACTEX Learning ACTEX Study Manual for Exam PA (8th Edition)
Ambrose Lo