Question 1132663
Your data is shown below: 
..........Nightmares	Nice dreams
No clowns	12	35
Clowns   	30	8
---
p1 = 12/47
p2 = 30/38
----
Perform a Z-test on nightmares after the no-clown circus minus nightmares after the clown circus. Report the test statistic.
---
Ho:: p1-p2 = 0
Ha:: p1-p2 # 0
-----
Sample difference:: 12/47-30/38 = -0.534 
Standard deviation = sqrt[(12/47)(25/47)/47 + (30/38)(8/38)/38] 
= sqrt[0.0029+0.0044] = 0.0853
---
Test Statistic:: z(-0.534) = -0.523/0.0853 = -6.132
----

Cheers,
Stan H.