absentee                package:pscl                R Documentation

_A_b_s_e_n_t_e_e _a_n_d _M_a_c_h_i_n_e _B_a_l_l_o_t_s _i_n _P_e_n_n_s_y_l_v_a_n_i_a _S_t_a_t_e _S_e_n_a_t_e _R_a_c_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     Absentee ballot outcomes contrasted with machine ballots, cast in
     Pennsylvania State Senate elections, selected districts,
     1982-1993.

_U_s_a_g_e:

     data(absentee)

_F_o_r_m_a_t:

     A data frame with 22 observations on the following 8 variables.

     '_y_e_a_r' a numeric vector, year of election, 19xx

     '_d_i_s_t_r_i_c_t' a numeric vector, Pennsylvania State Senate district

     '_a_b_s_d_e_m' a numeric vector, absentee ballots cast for the
          Democratic candidate

     '_a_b_s_r_e_p' a numeric vector, absentee ballots cast for the
          Republican candidate

     '_m_a_c_h_d_e_m' a numeric vector, votes cast on voting machines for the
          Democratic candidate

     '_m_a_c_h_r_e_p' a numeric vector, votes cast on voting machines for the
          Republican candidate

     '_d_a_b_s' a numeric vector, Democratic margin among absentee ballots

     '_d_m_a_c_h' a numeric vector, Democratic margin among ballots case on
          voting machines

_D_e_t_a_i_l_s:

     In November 1993, the state of Pennsylvania conducted elections
     for its state legislature. The result in the Senate election in
     the 2nd district (based in Philadelphia) was challenged in court,
     and ultimately overturned. The Democratic candidate won 19,127 of
     the votes cast by voting machine, while the Republican won 19,691
     votes cast by voting machine, giving the Republican a lead of 564
     votes. However, the Democrat won 1,396 absentee ballots, while the
     Republican won just 371 absentee ballots, more than offsetting the
     Republican lead based on the votes recorded by machines on
     election day. The Republican candidate sued, claiming that many of
     the absentee ballots were fraudulent. The judge in the case
     solicited expert analysis from Orley Ashenfelter, an economist at
     Princeton University. Ashenfelter examined the relationship
     between absentee vote margins and machine vote margins in 21
     previous Pennsylvania Senate elections in seven districts in the
     Philadelphia area over the preceding decade.

_S_o_u_r_c_e:

     Ashenfelter, Orley.  1994.  Report on Expected Asbentee Ballots.
     Typescript.  Department of Economics, Princeton University.

_R_e_f_e_r_e_n_c_e_s:

     Ashenfelter, Orley, Phillip Levine and David Zimmerman.  2003.
     _Statistics and Econometrics: Methods and Applications_.  New
     York: John Wiley and Sons.

     Jackman, Simon.  2007.  _Bayesian Analysis for the Social
     Sciences_.  In preparation.

_E_x_a_m_p_l_e_s:

     ## example code for pscl package
     data(absentee)
     summary(absentee)

     denom <- absentee$absdem + absentee$absrep
     y <- (absentee$absdem - absentee$absrep)/denom * 100
     denom <- absentee$machdem + absentee$machrep
     x <- (absentee$machdem - absentee$machrep)/denom *100

     ols <- lm(y ~ x,
               subset=c(rep(TRUE,21),FALSE)  ## drop data point 22
               )

     ## predictions for disputed absentee point
     yhat22 <- predict(ols,
                       newdata=list(x=x[22]),
                       se.fit=TRUE,
                       interval="prediction")
     tstat <- (y[22]-yhat22$fit[,"fit"])/yhat22$se.fit
     cat("tstat on actual outcome for obs 22:",tstat,"\n")
     cat(paste("Pr(t>",round(tstat,2),") i.e., one-sided:\n",sep=""))
     cat(1-pt(tstat,df=yhat22$df),"\n")

     ## make a picture
     xseq <- seq(min(x)-.1*diff(range(x)),
                 max(x)+.1*diff(range(x)),
                 length=100)
     yhat <- predict(ols,interval="prediction",
                     newdata=list(x=xseq))
     plot(y~x,
          type="n",
          axes=FALSE,
          ylim=range(yhat,y),
          xlim=range(xseq),xaxs="i",
          xlab="Democratic Margin, Machine Ballots (Percentage Points)",
          ylab="Democratic Margin, Absentee Ballots (Percentage Points)")
     polygon(x=c(xseq,rev(xseq)),  ## overlay 95
             y=c(yhat[,"lwr"],rev(yhat[,"upr"])),
             border=FALSE,
             col=gray(.85))
     abline(ols,lwd=2)           ## overlay ols
     points(x[-22],y[-22],pch=1) ## data
     points(x[22],y[22],pch=16)  ## disputed data point

     text(x[22],y[22],
          "Disputed\nElection",
          cex=.75,
          adj=1.25)
     axis(1)
     axis(2)

