Dave,
That's reasonable. Do your prirors matrices have the same dimensions as
the data itself? If you have the lines of code that generated the priors,
that could be useful in tracking down the bug.
Thanks,
matt.
On Wed, 25 Oct 2006, Dave Armstrong wrote:
I just set them to the ranges of the observed
variables. I didn't want the
imputed values to lie very far outside the observed range.
-----Original Message-----
From: Matthew Blackwell [mailto:blackwel@fas.harvard.edu]
Sent: Wednesday, October 25, 2006 1:44 PM
To: david.armstrong(a)politics.ox.ac.uk
Cc: amelia(a)lists.gking.harvard.edu
Subject: Re: [amelia] Amelia Error
Hello Dave,
The reason you are getting errors on 'mu.priors' and not the ranges is
that the ranges are simply converted to a normal distribution with a mean
and standard deviation that match the ranges given. So, my guess is that
something strange is happening with your range priors settings.
Would you mind telling us what your settings for mins, maxs and conf are?
Thanks,
matt.
On Wed, 25 Oct 2006, Gary King wrote:
here's a message that just arrived. are
you on the listserv?
can you respond?
thanks,
Gary
---------- Forwarded message ----------
Date: Wed, 25 Oct 2006 11:48:17 +0100
From: Dave Armstrong <david.armstrong(a)politics.ox.ac.uk>
To: <amelia(a)lists.gking.harvard.edu>
Subject: [amelia] Amelia Error
Dear Amelia Users,
This may be a problem with my understanding of how Amelia is supposed to
work, but I've encountered the following problem. I give Amelia the
following command:
amelia.out <- amelia(smalldat, cs=1, ts=2, polytime=3, lags=1, leads=1,
intercs=F, incheck=F, mins=mins, maxs=maxs, conf=conf, means=NULL,
sds=NULL,
logs=c(5,6,7,8),
sqrts=c(9,10,11,12,13,14,15,16),
noms=c(17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32))
and I get the following error:
Error in mu.priors - (ones %*% meanx) : non-conformable arrays
using traceback() I tracked it down to the scalecenter subcommand. Since
I've not provided any means and standard deviations for the priors, rather
I've provided
ranges, I assume that setting means and sds both to NULL will suggest that
mu.priors and sd.priors will also be NULL. If I comment out the
troublesome
piece of
the scalecenter command as below, source this command in and issue the
same
command as above to Amelia, it works fine.
scalecenter <- function (x, mu.priors = NULL, sd.priors = NULL)
{
AMn <- nrow(x)
ones <- matrix(1, AMn, 1)
meanx <- colMeans(x, na.rm = TRUE)
stdvx <- apply(x, 2, sd, na.rm = TRUE)
x.ztrans <- (x - (ones %*% meanx))/(ones %*% stdvx)
# if (!identical(mu.priors, NULL)) {
# mu.priors <- (mu.priors - (ones %*% meanx))/(ones %*%
# stdvx)
# sd.priors <- sd.priors/(ones %*% stdvx)
# }
return(list(x = x.ztrans, mu = meanx, sd = stdvx, mu.priors = NULL,
sd.priors = NULL))
}
Can you give me some advice as to what I'm doing wrong in the first step?
Thanks,
Dave.
Dave Armstrong
Department of Politics and International Relations
Manor Road
Oxford
OX1 3UQ
Phone: 08165 285956
E-mail: david.armstrong(a)politics.ox.ac.uk
Web:
http://users.ox.ac.uk/~polf0104
-
Amelia mailing list served by Harvard-MIT Data Center
[Un]Subscribe/View Archive: