the design and implementation of a phone …...the design and implementation of a phone experiment...

23
The Design and Implementation of a Phone Experiment Ryan D. Enos and Anthony Fowler May 7, 2011

Upload: others

Post on 27-Jun-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: The Design and Implementation of a Phone …...The Design and Implementation of a Phone Experiment Ryan D. Enos and Anthony Fowler May 7, 2011 1 Introduction After the November 2010

The Design and Implementation of a PhoneExperiment

Ryan D. Enos and Anthony Fowler

May 7, 2011

Page 2: The Design and Implementation of a Phone …...The Design and Implementation of a Phone Experiment Ryan D. Enos and Anthony Fowler May 7, 2011 1 Introduction After the November 2010

1 Introduction

After the November 2010 election, we closely followed the tight race for thestate legislative seat in Worcester County’s 6th district. After several re-counts, the Republican candidate led by 1 vote, but one disputed vote infavor of the Democrat went to court. The election was declared a tie, andthe state House called for a special election on May 10th.

Before the November election, we conducted surveys to reassess the cal-culus of voting. Riker and Ordeshook (1968) provided the canonical modelof turnout as follows:

R = pB + D − C (1)

An individual’s returns to voting depend on the probability that her votewill shift the result of the election (p), how much she cares about the result(B), her extrinsic utility from the act of voting (D for duty), and the costof voting (C). Surprisingly, citizens perceptions of p and reported levels of Bare unrelated to turnout, suggesting that pB fails to factor into the typicalturnout decision.

The special election in Worcester’s 6th district provides a rare opportu-nity to test for the effect of p on turnout, because the probability that onevote will be pivotal is much higher than normal. Moreover, the low salienceof the race means that few citizens may be aware of this fact. In our exper-iment, we will randomly inform some individuals that p is particularly high(“pivotal condition”). Other respondents will be assigned to a condition thatsimply reminds them of the election (“reminder condition”). The differencein turnout between these two conditions tests whether this increases theirchances of voting.

2 Previous Experiments on Turnout

Before designing our experiment, we reviewed the vast literature on get-out-the-vote experiments http://gotv.research.yale.edu/. We also con-tacted Donald P. Green at Yale for advice on fielding this experiment. Wewant to reach voters in the most effective means possible. If we detect noeffect, we want to attribute this to a minimal effect of p, and rule out thepossibility that our experimental treatment was weak or ineffective.

One of our primary concerns is that many citizens in the district alreadyknow that the last election was tied. We first considered conducting a mail

1

Page 3: The Design and Implementation of a Phone …...The Design and Implementation of a Phone Experiment Ryan D. Enos and Anthony Fowler May 7, 2011 1 Introduction After the November 2010

experiment and a separate survey to assess the extent to which the public wasinformed about the election. Then, we decided that we could do both at onceby administering a phone experiment but also asking some quick questions.Additionally, this approach gives us additional inferential leverage becausewe potentially restrict our analysis to individuals who were previously un-informed about the election or we can interact our experimental treatmentwith prior levels of knowledge.

Experiments conducted through professional phone banks are typicallyineffective (Gerber and Green 2000), but volunteer phone calls (Nickerson2006; Nickerson, Friedricks, and King 2006) can mobilize voters. Accordingto Nickerson, phone calls are effective when the caller is personal, conver-sational, and informal. For this reason, we have asked Harvard students tovolunteer in helping us make the calls. Callers should relax, introduce them-selves by name, mention that they are Harvard students, and convey therelevant information without reading directly from the script.

3 Power Calculations

Before investing the time and money to conduct the experiment, we wantto know whether we can detect a reasonably sized effect. Considering thesize of the district, the time constraints, and the number of volunteer callers,we hope to make about 6000 calls (3000 phone numbers in each of the twoexperimental groups and 300 phone numbers in a survey condition). Usingthis simple back-of-the-envelope formula, we can determine the power of ourtest. How small of an effect can we detect. In technical language, what isthe smallest effect for which could reject the null hypothesis that the effectis zero at the .05?

Effect/[St.Dev ∗ sqrt(2/n)] > 2 (2)

Effect is the expected size of the experimental effect. St.Dev. is thestandard deviation in the outcome variable, in this case turnout in the spe-cial election. N is the sample size in each treatment group (setting themboth to be the same size to maximize efficiency). Setting n to 3000, and thestandard deviation to .5 (the largest possible standard deviation for a binaryoutcome variable), this simple calculation suggests that we can detect aneffect of .026, or 2.6%. This is a conservative approximation because turnout

2

Page 4: The Design and Implementation of a Phone …...The Design and Implementation of a Phone Experiment Ryan D. Enos and Anthony Fowler May 7, 2011 1 Introduction After the November 2010

will probably be lower than 50% in this election (therefore the standard de-viation will be less than .5), and we will be able to reduce the variance ofour estimates by stratifying and conditioning. Nonetheless, this conservativepower calculation gives us some confidence to move forward with the experi-ment. If the minimum detectable effect were 5% or more, there is little thatcould be learned from our experiment.

4 Data

To collect the list of registered voters in the district along with their phonenumbers, vote histories, and other characteristics, we contacted two majorvendors of political data, Catalist and Aristotle. These companies typicallysell data to candidates, parties, PACs, interest groups, etc. but they aremore than happy to work with academics. We purchased a file of approx-imately 19,000 registered voters at 10,000 different unique phone numbersfrom Catalist for approximately $1000. To confirm the validity of phonenumbers, we conducted robo-calls (callfire.com) which automatically calledevery number on the list and confirmed whether each number was valid andrecorded which numbers were answered by a live person. Approximately 46%of calls were answered, 52% were valid but unanswered (busy, voicemail, notanswered), and 2% were invalid. We removed the invalid numbers to increasethe efficiency of our calling efforts. We also removed phone numbers withmore than 4 registered voters to improve the ease of identifying the personwho answers each call.

5 Stratification

We could simply randomly assign each phone number to a treatment con-dition, but this could lead to two different problems. As we saw with thepower calculation, a simple random assignment is inefficient, only allowingus to detect a 2.6% effect. Also, even with random assignment, there couldby chance be slight imbalances between the treatment conditions. We canimprove both balance and efficiency, by stratifying. This means that we willdivide phone numbers into similar groups and randomize within each group.Typically, the more groups (strata) and more covariates used to stratify, thegreater balance and efficiency. However, in this case, not every phone will be

3

Page 5: The Design and Implementation of a Phone …...The Design and Implementation of a Phone Experiment Ryan D. Enos and Anthony Fowler May 7, 2011 1 Introduction After the November 2010

answered, so we have to be careful. If nobody from the treatment (or control)group within a particular stratum answered the phone, then we would haveto exclude the entire stratum from our analysis. To avoid this, we decidedthat every stratum should have at least 100 phone numbers. As a result, wecould only stratify on a few important covariates.

Based on the literature, we know that the best predictor of turnout in thespecial election is likely to be previous turnout (if you voted in the past, youare likely to keep voting). We divided phone numbers into three categoriesbased on the previous voting behavior of individuals at that numbers: (1)numbers where at least one person voted in a low salience special electionin 2009, (2) numbers where at least one person voted in the 2010 generalelection but no one voted in the 2009 special election, (3) numbers wherenobody voted in either election. In doing this, we are assuming that thespecial election in 2009 is a particularly good predictor of turnout in thiselection.

Next, we divided phone numbers by the number of voters listed at eachnumber. We again divided numbers into three categories: (1) 1 registeredvoter, (2) 2 registered voters, (3) 3 or 4 voters (remember that we droppednumbers with more than 4).

Then, we decided that the town could be an important predictor ofturnout in this election. In this district, roughly one-third of the voterslive in Charlton, one-third live in Southbridge, and one-third live in a num-ber of smaller towns. We divided the phone numbers into three categoriesaccordingly.

Lastly, we decided to stratify based on our data collected from robo-calls.It is important that similar numbers of individuals in our treatment groupsanswer the phone, so separated the numbers where a live person answeredfrom all others.

As a result of these categorizations, an individual phone number willfall into one of 54 unique categories (i.e. 1 registered voter, voted in 2010,Southbridge, failed to answer robo-call). Most of these strata had more than100 phone numbers, but some fell short. To ensure that each stratum was ofsufficient size, we combined smaller strata that shared everything in commonexcept their answers of the robo-call. In one case, we also had to combinestrata from different towns. This resulted in 44 unique strata all with at least100 phone numbers. All subsequent randomization was conducted separatelywithin strata.

4

Page 6: The Design and Implementation of a Phone …...The Design and Implementation of a Phone Experiment Ryan D. Enos and Anthony Fowler May 7, 2011 1 Introduction After the November 2010

6 Randomization

All randomization was conducted in Stata. Stata has a command [uniform()]which randomly generates real numbers between 0 and 1 according to a uni-form distribution. If you have a data set in Stata, you can always randomlyorder it with the following code:

gen random = uniform()

sort random

drop random

Then, you can use this random ordering to assign observations into treatmentgroups. Since we randomized within each stratum, we did this separately foreach one. For example, if the stratum labeled as number 1110 had 102 phonenumbers in it, the code would look like this:

treatment = 0

g rand = uniform() if stratum == 1110

scalar stratum_size = 102

scalar big = round(stratum_size/3)

scalar small = round(stratum_size/30)

sort rand

replace treatment = 1 if _n < big + 1

replace treatment = 2 if _n > big & _n < big*2 + 1

replace treatment = 3 if _n > big*2 & _n < big*2 + small + 1

drop rand

This code created 4 different treatment groups from each stratum: (1) ourreminder condition, one-third of the population, (2) our pivotal condition,one-third of the sample, (3) our survey condition, one-thirtieth of the sample,and (4) our no-contact condition.

This randomization scheme ensures that our two primary groups of inter-est will be exactly the same size and be identical in terms of the stratificationvariables. However, there could still be imbalance on some other importantvariables such as age, race, or turnout in other elections. To improve balanceon other covariates, we generated 500 different randomizations and evaluatedthem based on the balance of other variables across the two primary treat-ment groups. Stata allows you to do this with ease, using the command,forvalues. If we wanted to generate 500 different versions of the randomiza-tion above, we could do so with this code:

5

Page 7: The Design and Implementation of a Phone …...The Design and Implementation of a Phone Experiment Ryan D. Enos and Anthony Fowler May 7, 2011 1 Introduction After the November 2010

forvalues i = 1/500{

g treatment‘i’ = 0

qui:g rand = uniform() if stratum == 1110

scalar stratum_size = 102

scalar big = round(stratum_size/3)

scalar small = round(stratum_size/30)

sort rand

qui:replace treatment‘i’ = 1 if _n < big + 1

qui:replace treatment‘i’ = 2 if _n > big & _n < big*2 + 1

qui:replace treatment‘i’ = 3 if _n > big*2 & _n < big*2 + small + 1

drop rand

}

This code generated 500 new variables (treatment1, treatment2, etc.).The qui: that preceded some of the lines simply suppresses Stata’s visualdisplay of the operation and improves the computational speed of this pro-cess.

7 Placebo Tests

Having completed the randomization and checked for balance, we can con-duct some additional tests that provide a better indication of our statisticalpower. We conducted several placebo tests, estimating the (fake) effect ofour treatment on turnout in previous elections. Comparing our two experi-mental groups of interest, we can estimate the effect of being in the pivotaltreatment on turnout in a 2008 special election employing OLS with stratumfixed-effects. Effectively, this procedure calculates the average turnout levelof each stratum, subtracts the stratum average from each person’s turnout,and then calculates the difference in these values between the two treatmentgroups. As expected, the estimated placebo effect was zero. More impor-tantly, the standard error across several different tests was less than .01,suggesting that we can confidently identify any effect larger than 2%.

8 Experiment implementation

With our list of subjects randomized and checked for balance, it is time toconduct our experiment. This required us to recruit callers and to set up the

6

Page 8: The Design and Implementation of a Phone …...The Design and Implementation of a Phone Experiment Ryan D. Enos and Anthony Fowler May 7, 2011 1 Introduction After the November 2010

call infrastructure.

8.1 caller recruitment

As mentioned above, based on a review of the literature, we decided thatHarvard undergraduate and graduate students would be the most effectivecallers. We recruited these callers after writing the script for calls and calcu-lating the length of typical call by including ring time and the estimated timeof the conversation. Based on the time of an average call and the contactrate we were able to determine from the robo-calls, we calculated the numberof completed calls we would be able to make an hour. With this hourly rateof contact, we recruited enough callers to be able to complete our targetednumber of calls.

The scripts used for our treatments are located in Appendix 1.

8.2 call infrastructure

We needed office space and phones to complete the calls so we consulted withthe Harvard Institute for Quantitative Social Science to use the space andphones. We then needed a standardized way to collect the data recordedin the calls. When callers record the outcome of their calls, we could haverecord the data with paper and pencil, but the disadvantage of this methodis the inefficiency and potential for error involved in then having to digitalizethe data. In order to allow our callers to enter data and simultaneously haveaggregated to a single source we created an webpage that combined dataentry and the call scripts for our treatments. The webpages were createdusing Python cgi scripts and are located on our personal webspace. Wepassword protected the pages to protect the data as required by the HarvrdIRB.

The cgi scripts consist of two programs, the first creates the webpagewith the call scripts and html forms that are used to enter the data. Thescript was designed to take information from the list of subjects and outputthe information to the webpage so that callers would know the names ofthe household members and other important information, such as the phonenumber for each call. The cgi script “call page.cgi” is in Appendix 2.

We then needed a script to take the data entered in the original scriptand write it to a file. This script “save.cgi” is in the Appendix 2.

7

Page 9: The Design and Implementation of a Phone …...The Design and Implementation of a Phone Experiment Ryan D. Enos and Anthony Fowler May 7, 2011 1 Introduction After the November 2010

9 Appendix 1: call scripts

Reminder Treatment

Hello, this is XXXX from Harvard University. We are calling registeredvoters to provide information about an upcoming election in your town.

Am I speaking with XXXXXXXX?Did you know that there is a special election coming up?

[IF YES] Do you know when it is?

We just want to remind you that there’s a special election on Tuesday,May 11th to fill the seat of your representative in the Massachusetts StateHouse. For more information on the election you can visit the website of theSecretary of the Commonwealth.

Goodbye

8

Page 10: The Design and Implementation of a Phone …...The Design and Implementation of a Phone Experiment Ryan D. Enos and Anthony Fowler May 7, 2011 1 Introduction After the November 2010

Pivotal Treatment

Hello, this is XXXX from Harvard University. We are calling registeredvoters to provide information about an upcoming election in your town.

Am I speaking with XXXXXXXX?Did you know that there is a special election coming up?

[IF YES] Do you know when it is?

We just want to remind you that there’s a special election on Tuesday,May 11th to fill the seat of your representative in the Massachusetts StateHouse. For more information on the election you can visit the website of theSecretary of the Commonwealth.

The reason that there is a special election is that the last election ended inan exact tie. Had one more or one less person voted in the last election, yourcandidate would have won. The special election on Tuesday is likely to beclose again, so there is a high chance that your vote could make a difference.

Goodbye

9

Page 11: The Design and Implementation of a Phone …...The Design and Implementation of a Phone Experiment Ryan D. Enos and Anthony Fowler May 7, 2011 1 Introduction After the November 2010

Hello, this is XXXX from Harvard University.We are conducting a survey of registered voters in your town and I wouldlike just a few minutes of your time.

This survey is for research purposes only and all answers are anonymous.

Are you willing to answer a few questions about elections in your town?

[YES - CONTINUE TO SURVEY][NO - Thank you, goodbye.]Thankyou for participating. I am about to ask you a series of questionsabout the election. There are lots of reasons that people might not payattention to politics and elections, for example they might be too busy withwork and family or they might just not be interested because they knowthat it does not affect them.

1. Did you know that there is a special election coming up? [NO, SKIPTO QUESTION 4. YES, PROCEED TO QUESTION 2]

2. Do you know when it is?

3. Do you know who is running in this election?

4. The election will be on Tuesday, May 10 for the seat that representsyou in the Massachusetts State House. There is not usually an electionthis time of year. Do you know why we need to have a special electionnow?

Thank you for participating.

For more information on the election you can visit the website of theSecretary of the Commonwealth.

Goodbye

10

Page 12: The Design and Implementation of a Phone …...The Design and Implementation of a Phone Experiment Ryan D. Enos and Anthony Fowler May 7, 2011 1 Introduction After the November 2010

10 Appendix 2: python code for webpages

and data aggregation

10.1 call page.cgi

#!/ usr / bin /env python

import timeimport cg i , c g i tbimport csvfrom os import envi ron

##THE FILE WITH THE SUBJECTS, RANDOMIZEDi n f = open ( ’ Treatment F i l e Random . csv ’ , ’ rU ’ )inc sv = csv . r eader ( i n f )

contents = l i s t ( )

counter = 0

###CREATE COOKIE FOR CALLERS NAMEi f envi ron . has key ( ’HTTP COOKIE ’ ) :

cook i e = environ [ ’HTTP COOKIE ’ ]c a l l e r = s t r ( cook i e )c a l l e r = cook i e . s p l i t ( ’= ’ ) [ 1 ]

else :c a l l e r = ’ ente r your name ’

###TIME OF THE CALL, NEEDED TO APPEND TO OUTDATAca l lTime = time . ctime ( time . time ( ) )ca l lTime = s t r ( ca l lTime )

###CYCLE THROUGH THE FILE OF SUBJECTS, TAKE THE FIRST ROW AND WRITE IT TOTHE HTML PAGE, TAKE THE REST AND REWRITE THE FILE WITH THE NEW DATA

for row in i n c sv :counter = counter + 1i f counter == 1 :

l i n k = rowtreatment = row [ 1 ]number = row [ 0 ]areaCode = s t r (number [ 0 : 3 ] )p r e f i x = s t r ( number [ 3 : 6 ] )s u f f i x = s t r (number [ 6 : 1 0 ] )numberFormat = areaCode+’− ’+p r e f i x+’− ’+s u f f i x

f i r s t 1 = row [ 2 ]f i r s t 2 = row [ 3 ]f i r s t 3 = row [ 4 ]f i r s t 4 = row [ 5 ]

l a s t 1 = row [ 6 ]l a s t 2 = row [ 7 ]

11

Page 13: The Design and Implementation of a Phone …...The Design and Implementation of a Phone Experiment Ryan D. Enos and Anthony Fowler May 7, 2011 1 Introduction After the November 2010

l a s t 3 = row [ 8 ]l a s t 4 = row [ 9 ]

age1 = row [ 1 0 ]age2 = row [ 1 1 ]age3 = row [ 1 2 ]age4 = row [ 1 3 ]

gender1 = row [ 1 4 ]gender2 = row [ 1 5 ]gender3 = row [ 1 6 ]gender4 = row [ 1 7 ]

###START OF THE HTML CODE, INTERRUPTED BY PYTHON COMMANDS THAT USE BOOLEANLOGIC TO SPECIFY CONDITIONS BASED ON THE RANDOMIZATION

###STRING METHODS ARE USED TO ADD PYTHON OBJECTS INTO THE HTML WHERE THE ‘%s’ APPEARS

print ’ Content−type : t ex t /html ’print # Prints an empty l ine , to end the headers#pr in t l i n kprint ”””

<html><head>

< t i t l e > Cal l Page </ t i t l e ><s t y l e type=’ t e x t / css ’>

. t e x t b o rd e r { border : 1px s o l i d b lue ; padding : 2px ;}

. ho r i z { f l o a t : l e f t ; padding : 0 15px ; l i s t −s t y l e : none}

. s c r i p t { co l o r : red ; font−s i z e : l a r g e }</s t y l e>

</head><body><h1>

<center><span s t y l e =’ co l o r : red ’> %s </span></center></h1>

<hr><center>

<!−−SUBJECT TALBE−−>< t a b l e border=”1”><tr>

<th>Person 1</th>””” % numberFormat

i f f i r s t 2 != ’ ’ :print ”””

<th>Person 2</th>”””

i f f i r s t 3 != ’ ’ :print ”””

<th>Person 3</th>”””

i f f i r s t 4 != ’ ’ :print ”””

<th>Person 4</th>”””

print ”””</tr>

12

Page 14: The Design and Implementation of a Phone …...The Design and Implementation of a Phone Experiment Ryan D. Enos and Anthony Fowler May 7, 2011 1 Introduction After the November 2010

<tr><td> %s %s (%s ,%s ) </td> <!−−person1−−>

””” % ( f i r s t 1 , l a s t 1 , age1 , gender1 )i f f i r s t 2 != ’ ’ :

print ”””<td> %s %s (%s ,%s ) </td> <!−−person2−−>

””” % ( f i r s t 2 , l a s t2 , age2 , gender2 )i f f i r s t 3 != ’ ’ :

print ”””<td> %s %s (%s ,%s ) </td> <!−−person3−−>

””” % ( f i r s t 3 , l a s t3 , age3 , gender3 )i f f i r s t 4 != ’ ’ :

print ”””<td> %s %s (%s ,%s ) </td> <!−−person4−−>

””” % ( f i r s t 4 , l a s t4 , age4 , gender4 )print ”””

</tr></tab l e>

<!−−END SUBJECT TALBE−−>

</center>

<hr>

<form act ion = ’ save . c g i ’><input type=’hidden ’ name = ’number ’ va lue = ’%s ’ /><input type=’hidden ’ name = ’ treatment ’ va lue = ’%s ’

/><input type=’hidden ’ name = ’ cal lTime ’ va lue = ’%s ’

/>

< f i e l d s e t ><legend>c a l l outcome</legend>

<ul>< l i c l a s s = ’ hor i z ’>

< l a b e l f o r ’ answered ’><input type=’ radio ’ name = ’

outcome ’ id=’answered ’ va lue=’answered ’ /> Answered

</ l a b e l></ l i>

< l i c l a s s = ’ hor i z ’>< l a b e l f o r ’machine’>

<input type=’ radio ’ name = ’outcome ’ id=’machine ’ va lue=’machine ’ /> AnsweringMachine/Voice Mail

</ l a b e l></ l i>

< l i c l a s s = ’ hor i z ’>< l a b e l f o r ’ busy ’>

<input type=’ radio ’ name = ’outcome ’ id=’busy ’ va lue=’busy ’ /> Busy S igna l

</ l a b e l></ l i>

< l i c l a s s = ’ hor i z ’>

13

Page 15: The Design and Implementation of a Phone …...The Design and Implementation of a Phone Experiment Ryan D. Enos and Anthony Fowler May 7, 2011 1 Introduction After the November 2010

< l a b e l f o r ’ no answer ’><input type=’ radio ’ name = ’

outcome ’ id=’no answer ’va lue=’no answer ’ /> NoAnswer

</ l a b e l></ l i>

</ul></ f i e l d s e t >

””” % (number , treatment , ca l lTime )

i f treatment == ”1” or treatment == ”2” :print ”””

<d iv c l a s s =’ t e x t b o rd e r ’><p c l a s s = ’ s c r i p t ’> Hel lo , t h i s i s %s from Harvard

Unive r s i t y . We are c a l l i n g r e g i s t e r e d vo t e r s toprov ide informat ion about an upcoming e l e c t i o n

in your town . </p><p c l a s s = ’ s c r i p t ’> Am I speak ing with [RESPONDENT

NAME]? </p>””” % c a l l e r

i f treatment == ”3” :print ”””

<d iv c l a s s =’ t e x t b o rd e r ’><p c l a s s = ’ s c r i p t ’>Hel lo , t h i s i s %s from Harvard

Unive r s i t y . </p><p c l a s s = ’ s c r i p t ’> We are conduct ing a survey o f

r e g i s t e r e d vo t e r s in your town and I would l i k ej u s t a few minutes o f your time .</p>

<p c l a s s = ’ s c r i p t ’> Am I speak ing with [RESPONDENTNAME]? </p>

””” % c a l l e r

####RESPODENT BUTTONS########print ”””

< f i e l d s e t ><ul>

< l i c l a s s = ’ hor i z ’>< l a b e l f o r ’NA’>

<input type=’ radio ’ name = ’contac t ’ id=’NA’ va lue=’NA’checked/> N/A

</ l a b e l></ l i>

< l i c l a s s = ’ hor i z ’>< l a b e l f o r ’ person1 ’>

<input type=’ radio ’ name = ’contac t ’ id=’person1 ’ va lue=’person1 ’ /> %s

</ l a b e l></ l i>

””” % f i r s t 1i f f i r s t 2 != ’ ’ :

print ”””< l i c l a s s = ’ hor i z ’>

< l a b e l f o r ’ person2 ’>

14

Page 16: The Design and Implementation of a Phone …...The Design and Implementation of a Phone Experiment Ryan D. Enos and Anthony Fowler May 7, 2011 1 Introduction After the November 2010

<input type=’ radio ’ name = ’contac t ’ id=’person2 ’ va lue=’person2 ’ /> %s

</ l a b e l></ l i>

””” % f i r s t 2i f f i r s t 3 != ’ ’ :

print ”””< l i c l a s s = ’ hor i z ’>

< l a b e l f o r ’ person3 ’><input type=’ radio ’ name = ’

contac t ’ id=’person3 ’ va lue=’person3 ’ /> %s

</ l a b e l></ l i>

””” % f i r s t 3i f f i r s t 4 != ’ ’ :

print ”””< l i c l a s s = ’ hor i z ’>

< l a b e l f o r ’ person4 ’><input type=’ radio ’ name = ’

contac t ’ id=’person4 ’ va lue=’person4 ’ /> %s

</ l a b e l></ l i>

””” % f i r s t 4print ”””

< l i c l a s s = ’ hor i z ’>< l a b e l f o r ’ o ther ’>

<input type=’ radio ’ name = ’contac t ’ id=’ o ther ’ va lue=’other ’ /> Another Person

</ l a b e l></ l i>

</ul></ f i e l d s e t >

”””####END RESPODENT BUTTONS########

i f treatment == ”3” :print ”””

<p c l a s s = ’ s c r i p t ’> This survey i s f o r researchpurposes only and a l l answers are anonymous andi t w i l l take j u s t a few minutes o f your time . </p>

<p c l a s s = ’ s c r i p t ’> Are you w i l l i n g to answer a fewque s t i on s about e l e c t i o n s in your town? </p>

<p c l a s s = ’ s c r i p t ’> <span s t y l e =’ co l o r : b l ue ’>[YES −CONTINUE TO SURVEY]</span> </p>

<p c l a s s = ’ s c r i p t ’> <span s t y l e =’ co l o r : b l ue ’>[NO]</span> Thank you , goodbye . </p>

<p c l a s s = ’ s c r i p t ’> Thankyou fo r p a r t i c i p a t i n g . Iam about to ask you a s e r i e s o f que s t i ons aboutthe e l e c t i o n . There are l o t s o f reasons t ha tpeop le might not pay a t t en t i on to p o l i t i c s ande l e c t i on s , f o r example they might be too busywith work and fami ly or they might j u s t not bei n t e r e s t e d because they know tha t i t does not

15

Page 17: The Design and Implementation of a Phone …...The Design and Implementation of a Phone Experiment Ryan D. Enos and Anthony Fowler May 7, 2011 1 Introduction After the November 2010

a f f e c t them . </p>”””

i f treatment == ”1” or treatment == ”2” :print ”””

<p c l a s s = ’ s c r i p t ’> Did you know tha t the re i s as p e c i a l e l e c t i o n coming up? </p>< f i e l d s e t >

<ul>< l i c l a s s = ’ hor i z ’>

< l a b e l f o r ’NA’><input type=’ radio ’ name = ’

knows e l e c t i on ’ id=’NA’va lue=’NA’ checked/> N/A

</ l a b e l></ l i>

< l i c l a s s = ’ hor i z ’>< l a b e l f o r ’ yes ’>

<input type=’ radio ’ name = ’knows e l e c t i on ’ id=’yes ’va lue=’yes ’ /> Yes

</ l a b e l></ l i>

< l i c l a s s = ’ hor i z ’>< l a b e l f o r ’no’>

<input type=’ radio ’ name = ’knows e l e c t i on ’ id=’no ’va lue=’no ’ /> No

</ l a b e l></ l i>

< l i c l a s s = ’ hor i z ’>< l a b e l f o r ’ r e fu sed ’>

<input type=’ radio ’ name = ’knows e l e c t i on ’ id=’re fu sed ’ va lue=’ re fu sed ’/> re fu sed

</ l a b e l></ l i>

</ul></ f i e l d s e t >

<p c l a s s = ’ s c r i p t ’> <span s t y l e =’ co l o r : b l ue ’>[ IFYES]</span> Do you know when i t i s ? </p>

< f i e l d s e t ><ul>

< l i c l a s s = ’ hor i z ’>< l a b e l f o r ’NA’>

<input type=’ radio ’ name = ’e l e c t i o n d a t e ’ id=’NA’va lue=’NA’ checked/> N/A

</ l a b e l></ l i>

< l i c l a s s = ’ hor i z ’>< l a b e l f o r ’ yes ’>

<input type=’ radio ’ name = ’e l e c t i o n d a t e ’ id=’yes ’va lue=’yes ’ /> Yes

</ l a b e l>

16

Page 18: The Design and Implementation of a Phone …...The Design and Implementation of a Phone Experiment Ryan D. Enos and Anthony Fowler May 7, 2011 1 Introduction After the November 2010

</ l i>< l i c l a s s = ’ hor i z ’>

< l a b e l f o r ’no’><input type=’ radio ’ name = ’

e l e c t i o n d a t e ’ id=’no ’va lue=’no ’ /> No

</ l a b e l></ l i>

< l i c l a s s = ’ hor i z ’>< l a b e l f o r ’ vague ’>

<input type=’ radio ’ name = ’e l e c t i o n d a t e ’ id=’vague’ va lue=’vague ’ /> vague

</ l a b e l></ l i>

< l i c l a s s = ’ hor i z ’>< l a b e l f o r ’ r e fu sed ’>

<input type=’ radio ’ name = ’e l e c t i o n d a t e ’ id=’re fu sed ’ va lue=’ re fu sed ’/> re fu sed

</ l a b e l></ l i>

</ul></ f i e l d s e t >

<p c l a s s = ’ s c r i p t ’> We j u s t want to remind you tha tthere ’ s a s p e c i a l e l e c t i o n on Tuesday , May 11 thto f i l l the s ea t o f your r e p r e s en t a t i v e in the

Massachuset ts S ta t e House . For more informat ionon the e l e c t i o n you can v i s i t the webs i t e o f

the Secre tary o f the Commonwealth . </p>”””

i f treatment == ”2” :print”””

<p c l a s s = ’ s c r i p t ’> <i> The reason tha t there i s as p e c i a l e l e c t i o n i s t ha t the l a s t e l e c t i o n endedin an exac t t i e . Had one more or one l e s s

person voted in the l a s t e l e c t i on , yourcandidate would have won . The s p e c i a l e l e c t i o non Tuesday i s l i k e l y to be c l o s e again , so therei s a high chance t ha t your vote cou ld make a

d i f f e r e n c e . </i> </p>”””

i f treatment == ”3” :print ”””

<p c l a s s = ’ s c r i p t ’> 1 . Did you know tha t there i s as p e c i a l e l e c t i o n coming up? <span s t y l e =’ co l o r :

b l ue ’>[NO, SKIP TO QUESTION 4. YES, PROCEED TOQUESTION 2]</span> </p>

< f i e l d s e t ><ul>

< l i c l a s s = ’ hor i z ’>< l a b e l f o r ’NA’>

<input type=’ radio ’ name = ’knows e l e c t i on ’ id=’NA’va lue=’NA’ checked/> N/A

</ l a b e l>

17

Page 19: The Design and Implementation of a Phone …...The Design and Implementation of a Phone Experiment Ryan D. Enos and Anthony Fowler May 7, 2011 1 Introduction After the November 2010

</ l i>< l i c l a s s = ’ hor i z ’>

< l a b e l f o r ’ yes ’><input type=’ radio ’ name = ’

knows e l e c t i on ’ id=’yes ’va lue=’yes ’ /> Yes

</ l a b e l></ l i>

< l i c l a s s = ’ hor i z ’>< l a b e l f o r ’no’>

<input type=’ radio ’ name = ’knows e l e c t i on ’ id=’no ’va lue=’no ’ /> No

</ l a b e l></ l i>

< l i c l a s s = ’ hor i z ’>< l a b e l f o r ’ r e fu sed ’>

<input type=’ radio ’ name = ’knows e l e c t i on ’ id=’re fu sed ’ va lue=’ re fu sed ’/> re fu sed

</ l a b e l></ l i>

</ul></ f i e l d s e t >

<p c l a s s = ’ s c r i p t ’> 2 . Do you know when i t i s ? </p>< f i e l d s e t ><ul>

< l i c l a s s = ’ hor i z ’>< l a b e l f o r ’NA’>

<input type=’ radio ’ name = ’e l e c t i o n d a t e ’ id=’NA’va lue=’NA’ checked/> N/A

</ l a b e l></ l i>

< l i c l a s s = ’ hor i z ’>< l a b e l f o r ’ yes ’>

<input type=’ radio ’ name = ’e l e c t i o n d a t e ’ id=’yes ’va lue=’yes ’ /> Yes

</ l a b e l></ l i>

< l i c l a s s = ’ hor i z ’>< l a b e l f o r ’no’>

<input type=’ radio ’ name = ’e l e c t i o n d a t e ’ id=’no ’va lue=’no ’ /> No

</ l a b e l></ l i>

< l i c l a s s = ’ hor i z ’>< l a b e l f o r ’ r e fu sed ’>

<input type=’ radio ’ name = ’e l e c t i o n d a t e ’ id=’re fu sed ’ va lue=’ re fu sed ’/> re fu sed

</ l a b e l></ l i>

18

Page 20: The Design and Implementation of a Phone …...The Design and Implementation of a Phone Experiment Ryan D. Enos and Anthony Fowler May 7, 2011 1 Introduction After the November 2010

</ul></ f i e l d s e t >

<p c l a s s = ’ s c r i p t ’> 3 . Do you know who i s runningin t h i s e l e c t i o n ? </p>

< f i e l d s e t ><ul>

< l i c l a s s = ’ hor i z ’>< l a b e l f o r ’NA’>

<input type=’ radio ’ name = ’cand ida tes ’ id=’NA’va lue=’NA’ checked/> N/A

</ l a b e l></ l i>

< l i c l a s s = ’ hor i z ’>< l a b e l f o r ’ both ’>

<input type=’ radio ’ name = ’cand ida tes ’ id=’ both ’va lue=’yes ’ /> both

</ l a b e l></ l i>

< l i c l a s s = ’ hor i z ’>< l a b e l f o r ’ a l i c e a ’>

<input type=’ radio ’ name = ’cand ida tes ’ id=’ a l i c e a ’va lue=’ a l i c e a on l y ’ />Geraldo Al icea

</ l a b e l></ l i>

< l i c l a s s = ’ hor i z ’>< l a b e l f o r ’ durant ’>

<input type=’ radio ’ name = ’cand ida tes ’ id=’durant ’va lue=’ durant on ly ’ />Peter Durant

</ l a b e l></ l i>

< l i c l a s s = ’ hor i z ’>< l a b e l f o r ’ durant ’>

<input type=’ radio ’ name = ’cand ida tes ’ id=’ ne i t h e r ’va lue=’ ne i t h e r ’ />

ne i t h e r</ l a b e l>

</ l i>< l i c l a s s = ’ hor i z ’>

< l a b e l f o r ’ r e fu sed ’><input type=’ radio ’ name = ’

cand ida tes ’ id=’ re fu sed ’va lue=’ re fu sed ’ />

re fu sed</ l a b e l>

</ l i></ul>

</ f i e l d s e t ><p c l a s s = ’ s c r i p t ’> 4 . The e l e c t i o n w i l l be on

Tuesday , May 10 fo r the sea t t ha t r ep re s en t s youin the Massachuset ts S ta t e House . There i s not

19

Page 21: The Design and Implementation of a Phone …...The Design and Implementation of a Phone Experiment Ryan D. Enos and Anthony Fowler May 7, 2011 1 Introduction After the November 2010

u sua l l y an e l e c t i o n t h i s time o f year . Do youknow why we need to have a s p e c i a l e l e c t i o n now?</p>

< f i e l d s e t ><ul>

< l i c l a s s = ’ hor i z ’>< l a b e l f o r ’NA’>

<input type=’ radio ’ name = ’why ’ id=’NA’ va lue=’NA’checked/> N/A

</ l a b e l></ l i>

< l i c l a s s = ’ hor i z ’>< l a b e l f o r ’ yes ’>

<input type=’ radio ’ name = ’why ’ id=’yes ’ va lue=’yes’ /> yes ( e l e c t i o n was at i e )

</ l a b e l></ l i>

< l i c l a s s = ’ hor i z ’>< l a b e l f o r ’no’>

<input type=’ radio ’ name = ’why ’ id=’no ’ va lue=’no ’/> no

</ l a b e l></ l i>

< l i c l a s s = ’ hor i z ’>< l a b e l f o r ’ p a r t i a l ’>

<input type=’ radio ’ name = ’why ’ id=’ p a r t i a l ’ va lue=’ p a r t i a l ’ /> p a r t i a lknowledge

</ l a b e l></ l i>

< l i c l a s s = ’ hor i z ’>< l a b e l f o r ’ unc lear ’>

<input type=’ radio ’ name = ’why ’ id=’unc lear ’ va lue=’unc lear ’ /> unc lear

</ l a b e l></ l i>

< l i c l a s s = ’ hor i z ’>< l a b e l f o r ’ r e fu sed ’>

<input type=’ radio ’ name = ’why ’ id=’ re fu sed ’ va lue=’ re fu sed ’ /> re fu sed

</ l a b e l></ l i>

</ul></ f i e l d s e t >

<p c l a s s = ’ s c r i p t ’> Thank you fo r p a r t i c i p a t i n g . </p>

<p c l a s s = ’ s c r i p t ’> For more informat ion on thee l e c t i o n you can v i s i t the webs i t e o f theSecre tary o f the Commonwealth . </p>

”””

20

Page 22: The Design and Implementation of a Phone …...The Design and Implementation of a Phone Experiment Ryan D. Enos and Anthony Fowler May 7, 2011 1 Introduction After the November 2010

print ”””<p c l a s s = ’ s c r i p t ’> Goodbye </p></div>

< l a b e l f o r ’ notes ’> Notes<t e x t a r ea name =’notes ’ id = ’ notes ’ rows=’6 ’

c o l s =’50’> </tex tarea></ l a b e l>

< l a b e l f o r ’ c a l l e r ’> Ca l l e r<input type=’ t e x t ’ id = ’ c a l l e r ’ name = ’ c a l l e r ’

va lue = %s></ l a b e l>

<center><p>

<input type = ’ submit ’ va lue = ’ c l i c k here whenc a l l i s complete ’ s t y l e =’background−co l o r :

#99FF99 ; ’ /></p></center>

</form>

</body></html>””” % c a l l e r

else :contents . append ( row )

i n f . c l o s e ( )

###WRITE OUT THE NEW FILE FOR THE NEXT CALL

f out = f i l e ( ’ Treatment F i l e Random . csv ’ , ”w” )outcsv = csv . wr i t e r ( fout , l i n e t e rm ina t o r=”\n” )

for item in contents :outcsv . writerow ( item )

fout . c l o s e ( )

10.2 save.cgi

#!/ usr / bin /env python

import c g iimport csv

###WRITE THE INFORMATION FROM THE FORMS TO A NEW FILEform = cg i . F i e ldSto rage ( )outrecord = open ( ’ ca l l ou t comes . csv ’ , ”a” )outrecordCsv = csv . wr i t e r ( outrecord , l i n e t e rm ina t o r = ’ \n ’ )

##input from the forms on the prev ious page . Assign them a name and g i v e a

21

Page 23: The Design and Implementation of a Phone …...The Design and Implementation of a Phone Experiment Ryan D. Enos and Anthony Fowler May 7, 2011 1 Introduction After the November 2010

name to the d e f a u l tnumber = form . ge tva lue ( ’ number ’ , ’ no data ’ )treatment = form . ge tva lue ( ’ treatment ’ , ’ no data ’ )ca l lTime = form . ge tva lue ( ’ ca l lTime ’ , ’ no data ’ )outcome = form . ge tva lue ( ’ outcome ’ , ’ no data ’ )notes = form . ge tva lue ( ’ notes ’ , ’ no data ’ )contact = form . ge tva lue ( ’ contact ’ , ’ no data ’ )knows e l e c t i on = form . ge tva lue ( ’ knows e l e c t i on ’ , ’ no data ’ )e l e c t i o n d a t e = form . ge tva lue ( ’ e l e c t i o n d a t e ’ , ’ no data ’ )su rvey agree = form . ge tva lue ( ’ su rvey agree ’ , ’ no data ’ )cand idate s = form . ge tva lue ( ’ cand idate s ’ , ’ no data ’ )why = form . ge tva lue ( ’why ’ , ’ no data ’ )c a l l e r = form . ge tva lue ( ’ c a l l e r ’ , ’ no data ’ )

###COOKIE WITH THE CALLERS NAMEprint ”Set−Cookie : c a l l e r=%s ;\ r \n” % c a l l e r

###APPEND TO THE NEW FILEoutput = [ number , treatment , cal lTime , c a l l e r , outcome , contact , notes ,

knows e l ec t ion , e l e c t i o n da t e , survey agree , candidates ,why ]outrecordCsv . writerow ( output )outrecord . c l o s e ( )

##SEND THE CALLER BACK TO THE ORIGINAL CALL PAGEprint ( ” Locat ion : c a l l p a g e . c g i ” )

22