15.071 | Spring 2017 | Graduate

The Analytics Edge

4.3 Keeping an Eye on Healthcare Costs: The D2Hawkeye Story

4.3 Keeping an Eye on Healthcare Costs: The D2Hawkeye Story

Quick Question

 

What is the average age of patients in the training set, ClaimsTrain?

Exercise 1

 Numerical Response 

 

What proportion of people in the training set (ClaimsTrain) had at least one diagnosis code for diabetes?

Exercise 2

 Numerical Response 

 

Explanation

Both of these answers can be found by looking at summary(ClaimsTrain). The mean age should be listed under the age variable, and since diabetes is a binary variable, the mean value of diabetes gives the proportion of people with at least one diagnosis code for diabetes.

Alternatively, you could use the mean, table, and nrow functions:

mean(ClaimsTrain$age)

table(ClaimsTrain$diabetes)/nrow(ClaimsTrain)

CheckShow Answer

 

Course Info

As Taught In
Spring 2017
Level
Learning Resource Types
Lecture Videos
Lecture Notes
Problem Sets with Solutions