My partner and I are both running the most recent version of R (2.8.1), but
Lauren is running it on a PC and I am running it on a Mac.
She was able to download the newest version of Amelia on her PC (1.2-1 is
how it appears in the url that appears upon download) by using this code:
install.packages("Amelia",repos="http://gking.harvard.edu")
That code failed on my Mac, with this result:
trying URL '
Error in download.file(url, destfile, method, mode = "wb", ...) :
cannot open URL '
In addition: Warning message:
In download.file(url, destfile, method, mode = "wb", ...) :
cannot open: HTTP status was '404 Not Found'
Warning in download.packages(p0, destdir = tmpd, available = available, :
download of package 'Amelia' failed
I then downloaded Amelia with this code:
install.packages("Amelia")
...which appears to have given me an older version of Amelia, 1.1-33 (again,
based on the url appears when I run this installation).
When she runs Amelia, she uses amelia(x=data...), and it works. That doesn't
work on my Mac. When I run Amelia, I use amelia(data=...) -- which is the
way one is instructed to do it in the Amelia II manual -- and it works for
me.
The question, then, is how I can install the more recent version of Amelia
on my Mac if
install.packages("Amelia",repos="http://gking.harvard.edu")
isn't
working.
any ideas?...
On Sun, Apr 26, 2009 at 4:36 PM, Gary King <king at harvard.edu> wrote:
yes, the Amelia GUI, but also please make sure you
have the current
version of Amelia installed. There were some changes recently that might
account for some of these issues.
Gary
---
http://gking.harvard.edu
On 4/26/2009 3:30 PM, Brandon Stewart wrote:
Sam,
The argument for the dataframe is x= dataset. So if you change your code to:
amelia(x=data1....)
it should work. Why your code works on the older version I have no idea.
Also- I am sure one of the TAs will get back to you guys, but I highly
recommend the Amelia GUI. It does really nice error checking and
helps to avoid these syntax errors by using an easy menu. Just load
the package and type AmeliaView() and it will pop up.
Brandon
On Sun, Apr 26, 2009 at 3:25 PM, Sam Barrows <sbarrows at fas.harvard.edu>
<sbarrows at fas.harvard.edu> wrote:
Dear Professor King, Miya and Patrick
We are having a similar problem. The following code runs with no problems on
one of our laptops (a mac with version 2.7.0):
data.matrix1 <- cbind(starting$gvtcare,
starting$pronhci,starting$cutwelfare, starting$cutmedicaid, starting$gvtdo,
starting$jobloss, starting$jobcomm, starting$eginsec, starting$demid,
starting$repid, starting$hhunion, starting$female, starting$nonwhite,
starting$income, starting$educ, starting$educinc, starting$age,
starting$hhlayoffs, starting$ncentral, starting$south, starting$west,
starting$skilled, starting$unskilled, starting$liberal,
starting$conservative, starting$weight)
colnames(data.matrix1) <- c("gvtcare",
"pronhci","cutwelfare","cutmedicaid",
"gvtdo","jobloss", "jobcomm",
"eginsec","demid", "repid",
"hhunion","female", "nonwhite","income",
"educ", "educinc","age",
"hhlayoffs","ncentral","south","west","skilled","unskilled","liberal","conservative","weights")
data1 <- as.data.frame(data.matrix1)
head(data1)
amelia1 <- amelia(data=data1,m=5,p2s=1,
noms=c("gvtcare","pronhci",
"cutwelfare", "cutmedicaid", "gvtdo",
"demid","repid","hhunion","female","nonwhite","educinc",
"ncentral",
"south", "west", "skilled", "unskilled",
"liberal", "conservative"),
ords=c("jobloss",
"jobcomm","income","educ","age"))
But on the other (a pc with version 2.8.1) we get following error message
after the final line of the above code:
Error in amelia(data = data1, m = 5, p2s = 1, noms = c("gvtcare",
"pronhci", :
argument "x" is missing, with no default
Many thanks
Sam
On Sat, Apr 25, 2009 at 8:46 AM, charlotte cavaille<charlotte.cavaille at
gmail.com> <charlotte.cavaille at gmail.com> wrote:
Dear Professor King, Miya and Patrick
Just wanted to mention the following thing that happen to me: this piece
of R code using Amelia only runs on one of the HMDC computers, I have tried
4 other computers and get an error message about unused
arguments...(concerning that variable with NAs)
I will stick to the working computer hoping that it is because it has the
right Amelia package that it runs ( and not because there is something wrong
that, for weird reasons, still goes our way!)
Thought i would mention it just in case anyone had the same issue...really
weird!
model.1.new <- scrugg.f[, c("uercovch", "laguercov",
"lagleftc",
"lagtradeopen", "lagopenn",
"laguerate", "laggrow", "hrsveto", "siaroff",
"ggdeflag", "bbb",
"blaguercov",
"blagleftc", "blagtradeopen", "blagopenn",
"blaguerate", "blaggrow",
"bhrsveto",
"bsiaroff", "bggdef", "dum1", "dum2",
"dum3", "dum4", "dum5", "dum6",
"dum7", "dum8",
"dum10", "dum12", "dum13", "dum14",
"dum18", "dum19", "dum20", "dum21",
"counter", "year")]
## use amelia to impute missing data
model.1.new.am.list <- amelia(x=model.1.new, m=5, idvars=c("dum1",
"dum2",
"dum3", "dum4",
"dum5", "dum6", "dum7", "dum8",
"dum10", "dum12", "dum13", "dum14",
"dum18", "dum19",
"dum20", "dum21"), ts="year", cs="counter",
polytime=3)$imputations
best regards
Charlotte
_______________________________________________
gov2001-l mailing listgov2001-l at
mailman.fas.harvard.eduhttp://mailman.fas.harvard.edu/mailman/listinfo/gov2…
_______________________________________________
gov2001-l mailing listgov2001-l at
mailman.fas.harvard.eduhttp://mailman.fas.harvard.edu/mailman/listinfo/gov2…
_______________________________________________
gov2001-l mailing listgov2001-l at
mailman.fas.harvard.eduhttp://mailman.fas.harvard.edu/mailman/listinfo/gov2…
_______________________________________________
gov2001-l mailing list
gov2001-l at
mailman.fas.harvard.edu
http://mailman.fas.harvard.edu/mailman/listinfo/gov2001-l