To whom it may concern,
I am trying to estimate the proportion of evangelicals voting for the
Republican presidential candidate across several elections using county
level data and the RxC EI(R) package. However, I keep getting an error
message, and I haven't been able to resolve the issue. My data includes the
following variables:
1. the total number of voters in each county
2. the proportion voting for the Republican candidate in each county
3. the proportion of evangelicals in each county
4. the proportion of registered voters who turned out to vote in each county
The ei package works fine when I run the 2x2 analysis (i.e., when I exclude
the turnout proportion variable as a covariate). When I try to use the RxC
command, I get the following error message after the "dbuf<-ei()" command
is entered:
[1] "Running eiRxC"
Error in apply(DD[[2]], 1, sum) : dim(X) must have a positive length
Maybe I'm just overlooking something simple, but these are my questions:
What exactly is the error message telling me? And how do I fix the error?
If you need it, I've attached a portion of the data I use for the analysis,
along with my script for running the analysis. You can upload these files
into R and then run the analysis to see exactly what I am seeing. I've also
included the full syntax appearing in my console when I use the RxC
package. This is probably more information than you need, but I want to be
thorough.
Thank you in advance for your assistance. Please feel free to respond to
this e-mail address if you have further questions.
Regards,
Brian C. Reed
Research Fellow
Center for the Study of Elections and Democracy (CSED)
Brigham Young University