Had problems installing some of the component packages on the latest version of R on Mac. Uninstalled and reinstalled the same version of R (2.15.2) and no problems.
> Hi Sara,
>
> Great -- I'm glad you worked it out. Would you mind sending an e-mail to the list saying how you solved the problem, just in case any others run into that problem too?
>
> As for saving, you can use the save() command in R to save any R objects, for example, dbuf is a list-type in R and save will save that list type as is. Then to reload it into R, you use the load() command.
>
> Let me know if you have any more questions -- I'm happy to help!
>
> Best,
> Molly
>
> On Wed, Nov 7, 2012 at 2:42 PM, Sara Butler <sbutler21(a)ucla.edu> wrote:
> Molly - Thank you so much for your fast response! I actually just figured it out. It worked after I uninstalled and reinstalled the current version of R (I had to do the same thing to get the ARM library to work a few weeks ago).
>
> A quick question - I have several large datasets that take about an hour or two to produce results. Is there a command that will save "dbuf" so I don't have to wait so long after I run it once? I read in the .pdf accompanying file that we should save it for that reason but it seems that it only saves the output, not the actual data buffer that I can easily recall at another date.
>
> I am brand new to R (switching from eZI in Stata) so I apologize for what may be simple fixes.
>
> I appreciate your help!
>
> Sara
>
>
> On Nov 7, 2012, at 10:57 AM, Molly Roberts wrote:
>
>> Hi Sara,
>>
>> It looks like tmvtnorm, ucminf, cubature and foreach are not properly installing. When you library(tmvtnorm) what happens?
>>
>> Best,
>> Molly
>>
>> On Wed, Nov 7, 2012 at 9:07 AM, Sara Butler <sbutler21(a)ucla.edu> wrote:
>> Hi there. I have tried many times and different methods to get EI to successfully install in R on Mac. I've downloaded various versions of R and installed the required packages but keep getting errors. The latest error I've received is after I run the following:
>>
>>
>> install.packages("mvtnorm")
>> install.packages("msm")
>> install.packages("tmvtnorm")
>> install.packages("ellipse")
>> install.packages("plotrix")
>> install.packages("MASS")
>> install.packages("ucminf")
>> install.packages("cubature")
>> install.packages("mnormt")
>> install.packages("foreach")
>> install.packages("eiPack")
>> install.packages("ei", type="source", repos="http://r.iq.harvard.edu")
>>
>>
>> The downloaded packages are in
>> /private/var/folders/84/0x595yrd1yb_4yks1n6gtz5w0000gn/T/RtmpGcgNhS/downloaded_packages
>> Warning messages:
>> 1: dependencies ‘tmvtnorm’, ‘ucminf’, ‘cubature’, ‘foreach’ are not available in: install.packages("ei", type = "source", repos = "http://r.iq.harvard.edu")
>> 2: installation of package 'ei' had non-zero exit status in: install.packages("ei", type = "source", repos = "http://r.iq.harvard.edu")
>> ** Removing '/Library/Frameworks/R.framework/Resources/library/ei'
>> Loading required package: msm
>> Warning: package 'msm' was built under R version 2.5.1
>> Error in dyn.load(x, as.logical(local), as.logical(now)) :
>> unable to load shared library '/Library/Frameworks/R.framework/Resources/library/msm/libs/i386/msm.so':
>> dlopen(/Library/Frameworks/R.framework/Resources/library/msm/libs/i386/msm.so, 6): Library not loaded: /Library/Frameworks/R.framework/Versions/2.5/Resources/lib/libRlapack.dylib
>> Referenced from: /Library/Frameworks/R.framework/Resources/library/msm/libs/i386/msm.so
>> Reason: Incompatible library version: msm.so requires version 2.5.0 or later, but libRlapack.dylib provides version 0.0.0
>> Error: package 'msm' could not be loaded
>> Execution halted
>> ERROR: lazy loading failed for package 'ei'
>>
>> Thanks!
>>
>>
>> -
>> ---
>> EI mailing list served by HUIT
>> Subscribe/Unsubscribe: http://lists.gking.harvard.edu/mailman/listinfo/ei
>> More info on ei and eiR: http://GKing.Harvard.edu/eiR
>> EI mailing list
>> EI(a)lists.gking.harvard.edu
>>
>> To unsubscribe from this list or get other information:
>>
>> https://lists.gking.harvard.edu/mailman/listinfo/ei
>>
>
>
Hi there. I have tried many times and different methods to get EI to successfully install in R on Mac. I've downloaded various versions of R and installed the required packages but keep getting errors. The latest error I've received is after I run the following:
install.packages("mvtnorm")
install.packages("msm")
install.packages("tmvtnorm")
install.packages("ellipse")
install.packages("plotrix")
install.packages("MASS")
install.packages("ucminf")
install.packages("cubature")
install.packages("mnormt")
install.packages("foreach")
install.packages("eiPack")
install.packages("ei", type="source", repos="http://r.iq.harvard.edu")
The downloaded packages are in
/private/var/folders/84/0x595yrd1yb_4yks1n6gtz5w0000gn/T/RtmpGcgNhS/downloaded_packages
Warning messages:
1: dependencies ‘tmvtnorm’, ‘ucminf’, ‘cubature’, ‘foreach’ are not available in: install.packages("ei", type = "source", repos = "http://r.iq.harvard.edu")
2: installation of package 'ei' had non-zero exit status in: install.packages("ei", type = "source", repos = "http://r.iq.harvard.edu")
** Removing '/Library/Frameworks/R.framework/Resources/library/ei'
Loading required package: msm
Warning: package 'msm' was built under R version 2.5.1
Error in dyn.load(x, as.logical(local), as.logical(now)) :
unable to load shared library '/Library/Frameworks/R.framework/Resources/library/msm/libs/i386/msm.so':
dlopen(/Library/Frameworks/R.framework/Resources/library/msm/libs/i386/msm.so, 6): Library not loaded: /Library/Frameworks/R.framework/Versions/2.5/Resources/lib/libRlapack.dylib
Referenced from: /Library/Frameworks/R.framework/Resources/library/msm/libs/i386/msm.so
Reason: Incompatible library version: msm.so requires version 2.5.0 or later, but libRlapack.dylib provides version 0.0.0
Error: package 'msm' could not be loaded
Execution halted
ERROR: lazy loading failed for package 'ei'
Thanks!
Good Morning:
I'm a regular user of EzI to analyze voting patterns but not a computer
savy person.
The problem: after loading the program on a new computer, the
application windows just flash open and closed. BTW, the operating
system is VISTA.
If you could provide some insight into what may be the problem, it would
be greatly appreciated.
Thanks, Dr. B.
Gary King,
Several years ago I did some research on Italian party vote using EZI. I am thinking of updating that research.
Is there a newer version of EZI available? I notice the version on you website is dated 2003.
Previously I used the Windows version. Does the current version work with Windows 7?
Spencer Wellhofer
Professor
University of Denver
I have been trying to install the package and I keep getting this error:
> install.packages("ei",repos="http://r.iq.harvard.edu")
Installing package(s) into ‘C:\......’
(as ‘lib’ is unspecified)
Warning message:
In getDependencies(pkgs, dependencies, available, lib) :
package ‘ei’ is not available
installation of package 'ei_1.1.tar_.gz' had non-zero exit status
if I try to do a local install I get this message
> install.packages("ei_1.1.tar_.gz", type="source", repos = NULL)
Installing package(s) into ‘C.....’
(as ‘lib’ is unspecified)
ERROR: dependencies 'msm', 'tmvtnorm', 'ellipse', 'plotrix', 'ucminf',
'cubature', 'mnormt', 'foreach', 'eiPack' are not available for package 'ei'
* removing 'C:/..../ei'
Warning messages:
1: running command 'C:\PROGRA~1\R\R-212~1.2/bin/i386/R CMD INSTALL -l
"C:...." "ei_1.1.tar_.gz"' had status 1
2: In install.packages("ei_1.1.tar_.gz", type = "source", repos = NULL) :
installation of package 'ei_1.1.tar_.gz' had non-zero exit status
>
Please advise...
To whom it may concern,
I am trying estimate the percentage of Mormons in Utah who voted republican
across time in gubernatorial, senatorial, presidential, and attorney
general elections. I have data sets for nearly every election dating back
to 1960. These data sets report the proportion of Mormons out of the total
population at the county level for every county in Utah. The data sets also
report the proportion of voters who voted republican at the same county
level and the total number of voters in each county. For the majority of
the data sets, the "ei" program has worked fine. However, for two of the
data sets, the "ei" program reports an error message that I haven't figured
out. The error message appears after the "dbuf<-ei()" command. Here is the
exact text (the first three lines appear just before the error message):
[1] "Running 2x2 ei"
Maximizing likelihood
Importance Sampling..
Error in if (any(lower > upper)) stop("lower>upper integration limits") :
missing value where TRUE/FALSE needed
To further clarify my problem, I've attached a data set for which "ei"
worked fine--"2000Attgen.csv"--and a data set for which "ei" reported the
above error message--"2004Attgen.csv". You can upload these files into R
and then run the commands in the attached "Commands.R" script file. The
"Printout from commands.R" script file presents the printout I see when I
run the same commands I've attached.
My questions are: What exactly is the error message telling me? And how do
I fix the error?
Thank you in advance for your assistance. Please feel free to respond to
this e-mail address if you have further questions.
Regards,
Brian Reed
Research Fellow
Center for the Study of Elections and Democracy (CSED)
Brigham Young University
Hello,
I tried to run a quite basic 2x2 ei in R. My code looked like this :
dbuf <- ei(Sarko ~ LePen, total="Inscrits", data=data)
and I got this error :
Erreur dans .subset2(x, i, exact = exact) : type 'list' d'indice incorrect
(I couldn't find the translation in English of this error, which seems
rather rare)
Do you have any idea of where this comes from ? What could I do to
make it work ?
Thank you,
--
Joël Gombin
Doctorant en science politique / PhD candidate in political science
CURAPP - Université de Picardie Jules Verne
94, rue Gabriel de
Mortillet<http://maps.google.fr/maps?q=94,+rue+Gabriel+de+Mortillet+80090+Amiens&hl=e…>
80090 Amiens<http://maps.google.fr/maps?q=94,+rue+Gabriel+de+Mortillet+80090+Amiens&hl=e…>
Tel : +33 (0)6 61 55 22 41
www.joelgombin.fr
Hi folks:
I am trying to use EiRxC to estimate votes by race for 7 candidates. (412 precincts, 7 variables of vote counts for candidates, proportion asian turnout, and proportion asian noturnout) I also intend to run estimates for black, latino, and white voters.
But, I keep encountering a frustrating error message that tells me my data are neither counts nor proportions. This is frustrating because its just not true. I have attempted to load my data into R in various formats: stata .dta, .csv, .spss, and .dbf. I have attempted to run RxC models with data that are all count data, with data that are all proportions, and with a mixture. The error message occurs, regardless. I am using the most recent versions of the EiR package on a Mac.
Here is the weird part: I have been able to do one successful run using the ei.MD.bayes function, but only with a vastly reduced version of my data. If I only input the first 10 observations, I am able to complete a semi-successful run. This works using either the eiR coding dbuf = ei(formula, data=) and with the eiPack example code dbuf <- ei.MD.bayes(formula, data=).
I have had successful runs with the ei 2x2 functions with my data, and I have also been able to successfully run the eiRxC example code using the RxCdata.
I appreciate any help you can give me.
Best,
Jason McDaniel
Assistant Professor
Political Science Dept.
San Francisco State University
Here is the code that I am running:
> sfvotes.csv <- read.table("sfvotes.csv", sep=",", header=TRUE)
> View(sfvotes.csv)
> formula <- cbind(onelee, oneava, oneherr, onechiu, oneyee, oneada, oneduft) ~ cbind(tasian, nta)
> dbuf.a1 <- ei.MD.bayes(formula, total="nv1", data=sfvotes.csv)
Error in BayesMDei(formula, data, total = total, lambda1 = lambda1, lambda2 = lambda2, :
row marginals are neither counts nor proportions - please
respecify data
The semi-successful limited run below:
> sfs.csv <- read.table("sfvotes.csv", sep=",", header=TRUE)
> View(sfs.csv)
> formula <- cbind(onelee, oneava, oneherr, onechiu, oneyee, oneada, oneduft) ~ cbind(tasian, nta)
> dbuf <- ei.MD.bayes(formula, total="nv1", data=sfs.csv)
In BayesMDei(formula, data, total = total, lambda1 = lambda1, lambda2 = lambda2, :
row margnials are proportions - multiplying by unit size
> summary(dbuf)
Formula: formula
Total sims: 2000
Burnin discarded: 1000
Sims saved: 1000
Acceptance ratios for Beta (averaged over units):
onelee oneava oneherr onechiu oneyee oneada
tasian 0.309 0.304 0.297 0.276 0.298 0.282
ntasian 0.210 0.197 0.193 0.187 0.205 0.166
Acceptance ratios for alpha:
columns
rows onelee oneava oneherr onechiu oneyee oneada oneduft
tasian 0.895 0.853 0.828 0.754 0.783 0.777 0.635
ntasian 0.916 0.871 0.754 0.691 0.839 0.632 0.615
Draws for Alpha:
Mean Std. Error 2.5% 97.5%
tasian.onelee 5.766 0.943 4.361 8.080
ntasian.onelee 6.282 1.196 4.275 9.253
tasian.oneava 2.995 0.618 1.730 4.218
ntasian.oneava 3.763 0.695 2.561 5.218
tasian.oneherr 2.735 0.648 1.797 4.097
ntasian.oneherr 1.204 0.389 0.625 2.055
tasian.onechiu 1.784 0.681 0.720 3.014
ntasian.onechiu 1.071 0.376 0.513 1.916
tasian.oneyee 2.181 0.887 0.983 4.101
ntasian.oneyee 2.572 0.557 1.677 3.798
tasian.oneada 2.425 0.506 1.566 3.429
ntasian.oneada 0.617 0.187 0.280 1.010
tasian.oneduft 0.928 0.404 0.347 1.847
ntasian.oneduft 0.804 0.298 0.319 1.456
Aggregate cell counts (summed over units):
Mean Std. Error 2.5% 97.5%
tasian.onelee 688.8 46.4 597.3 783.9
ntasian.onelee 1552.1 49.5 1446.3 1627.5
tasian.oneava 367.3 28.2 309.0 411.5
ntasian.oneava 937.9 25.7 893.2 995.4
tasian.oneherr 329.8 36.4 258.8 393.0
ntasian.oneherr 211.4 39.3 142.7 284.7
tasian.onechiu 175.6 49.1 97.6 245.6
ntasian.onechiu 160.1 52.5 82.6 243.5
tasian.oneyee 252.1 64.5 170.1 381.7
ntasian.oneyee 512.9 68.2 387.7 614.8
tasian.oneada 263.3 28.5 201.1 319.6
ntasian.oneada 76.0 26.7 32.7 143.5
tasian.oneduft 73.8 30.6 20.4 137.9
ntasian.oneduft 93.9 31.3 33.0 152.8
Please excuse if this is a newbie question - I am just starting the transition from Stata to R for more compelx estimation...
I installed R and Zelig on OSX (10.6.8), installing each of the component packages individually as recommended in the Zelig installation guide. Everything appeared to go OK. Then I installed eiPack, again without incident. Then I went to install ei, and I received the following:
Warning: dependencies ‘msm’, ‘tmvtnorm’, ‘ellipse’, ‘plotrix’, ‘ucminf’, ‘cubature’, ‘mnormt’, ‘foreach’ are not available
The installation ended with a non-zero exit status.
What should I do?
-Rob
Hi ei users,
We've just released a new version of ei. This new version wraps both ei 2x2
and eiRxC into one function. It also includes a new way of visualizing
model dependence in eiRxC data with a new function called tomogRxC.
Because it incorporates all these new features, the code for using eiR has
changed slightly. Please take a look at the new
documentation<http://gking.harvard.edu/gking/files/ei.pdf> to
get acquainted with this new code. You can download the new version using
the command install.packages("ei", repos="http://r.iq.harvard.edu",
type="source"). The new version relies on eiPack, so make sure that is
also installed. As always, the old version is still available at
http://gking.harvard.edu/eiR if you wish to continue using that. Please
let us know if you have any questions or suggestions!
Best,
Gary and Molly