# R Notes for Topic 17: Tests of Significant: Proportions

## R notes for Activity 17-4: Flat Tires

The book asks us to “Use technology to conduct the appropriate test of significance”. A simple approach is to use the Test of Significance Calculator applet.

Of course, it is also easy to do the computation in R, since you know the formula. First, you compute the z-score. We'll do so for the first sample size.

```z = (.3 - .25)/sqrt(.25*(1-.25)/50)
```

Now, how do we find out the p-value? In this case, we want P(Z > z). We can look up the z-score in the normal distribution table with `pnorm`(`z`). Since that gives P(Z < z), we subtract it from 1.

```p = 1 - pnorm(z)
```

Putting it all together for the next sample,

```z = (.3 - .25)/sqrt(.25*(1-.25)/100)
p = 1 - pnorm(z)
z
p
```

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.