15.071 | Spring 2017 | Graduate

# The Analytics Edge

1.3 Working with Data: An Introduction to R

## 1.3 Working with Data: An Introduction to R

### Quick Question

Please answer the following questions using the entire data frame WHO (and not one of the subsets we have created in R).

What is the mean value of the “Over60” variable?

Exercise 1

Numerical Response

Explanation

You can compute this value by either typing mean(WHO\$Over60) in your R console, or by typing summary(WHO\$Over60) in your R console. The output is 11.16.

Which country has the smallest percentage of the population over 60?

Exercise 2

Japan

United Arab Emirates (UAE)

Sierra Leone

Cuba

Luxembourg

Mali

Explanation

To get this value, you should type which.min(WHO\$Over60) in your R console. The output is 183. Then, to see the name of the 183rd country in your data frame, type WHO\$Country[183] in your R console. The output is United Arab Emirates.

Which country has the largest literacy rate?

Exercise 3

Japan

United Arab Emirates (UAE)

Sierra Leone

Cuba

Luxembourg

Mali

Explanation

To get this value, you should type which.max(WHO\$LiteracyRate) in your R console. The output is 44. Then, to see the name of the 44th country in your data frame, type WHO\$Country[44] in your R console. The output is Cuba.

## Course Info

Spring 2017
##### Learning Resource Types
Lecture Videos
Lecture Notes
Problem Sets with Solutions