# R notes for Activity 27-6: Exam Score Improvements

Okay, more data. Let's load it in.

```ExamScores = read.csv("/home/rebelsky/Stats115/Data/ExamScores.csv")
```

They wouldn't give us more `NA` values, would they?

````>` `summary(ExamScores)`
`    Student       Exam1           Exam2      `
` S01    : 1   Min.   :72.00   Min.   :50.00  `
` S02    : 1   1st Qu.:82.25   1st Qu.:68.50  `
` S03    : 1   Median :88.50   Median :80.00  `
` S04    : 1   Mean   :87.38   Mean   :78.65  `
` S05    : 1   3rd Qu.:95.00   3rd Qu.:91.00  `
` S06    : 1   Max.   :98.00   Max.   :97.00  `
` (Other):18                   NA's   : 1.00  `
```

Yes, I guess they would. Let's get rid of it.

```ExamScores = na.omit(ExamScores)
```

## 27-6 a. Scatterplots

```plot(ExamScores\$Exam1, ExamScores\$Exam2)
```

## 27-6 b. Yet another correlation cofficient

You should be able to compute this one on your own.

## 27-6 d. Changing exam 1 grades.

You can change the exam 1 grades en masse with

```ExamScores\$Exam1 = ExamScores\$Exam1 - 10
```

## 27-6 f. Changing exam 2 grades

If you look at 27-6 d., you should be able to figure out how to double the grades on exam 2.

## 27-6 h. Making up data

```exam1 = c(...)
exam2 = exam1 + 10
plot(exam1, exam2)
cor(exam1,exam2)
```

## 27-6 j. Making up data

We can continue to use the exam 1 grades from part h. We just need to change the way we compute the exam 2 grade.

```exam2 = exam1 * 2
plot(exam1, exam2)
cor(exam1,exam2)
```

Samuel A. Rebelsky, rebelsky@grinnell.edu

Copyright (c) 2007-8 Samuel A. Rebelsky.

This work is licensed under a Creative Commons Attribution-NonCommercial 2.5 License. To view a copy of this license, visit `http://creativecommons.org/licenses/by-nc/2.5/` or send a letter to Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, 94105, USA.