Hi-
It it possible to account for repeated, seasonal (i.e., monthly) spikes in
Amelia? It seems that the polytime or splinetime arguments can capture
moderate seasonal variability, but less adept at major spikes in, for
example, heating use in December and January. So far I've tried: 1)
increasing the order of splinetime to make it more flexible, 2) including
month as a nominal variable, and 3) including the value from the same month
in the previous and next year as additional columns in each row. All of
these help, but only to a minor degree.
Thanks for any ideas or guidance.
Mike
Dear all,
I have a couple of follow-up questions concerning the treatment of (obviously) collinear variables in Amelia II. Consider a dummy variable with missing values (y), an indicator variable indicating the missingness of y (also a dummy, say, i), and another indicator indicating the missingness of y but with reversed coding to i, say j. So whenever y is missing i=0 and j=1, when not, i=1 and j=0.
A dataset with such a setting (and many other variables) has been successfully imputed with Amelia (m=21). Chain lengths vary from about 240 to 275, convergence has been reported "normal"; with empri = .03*nrow(data) (where "data" is the raw data set).
From the various Amelia II discussion list responses I've seen (and responses I've got from there since asking about this), I am surprised that we did not get errors (singularity or similar). Given that we were successful with the imputation, my questions are:
(1) are the results "reliable"?
(2) Do we need to be concerned about the quality of the imputation?
Regards,
--------------------------------------------
Dr. Alex Sutherland
Social Sciences' Research Methods Centre / Institute of Criminology,
University of Cambridge
as2140(a)cam.ac.uk
http://www.crim.cam.ac.uk/people/academic_research/alex_sutherland/
Dear Amelia-users,
A newbie question: Does Amelia automatically detect and ignore identical
variables with different names (i.e. perfectly collinear variables) or will
this cause singularity/collinearity problems ending with an error message?
E.g. if one has a variable 'ethnicity' where 1==Non-white and 0=White and
another variable 'White' where 1==White 0==Non-White, would one be ignored
or would the imputation always fall over? From reading other messages (e.g.
https://lists.gking.harvard.edu/pipermail/amelia/2012-May/000869.html) the
suggestion is that one of these would need to be dropped manually or an
error message would appear (as long as the variables mapped onto one another
perfectly as per Matt Blackwell's response).
Thanks for any assistance, and apologies if this seems ridiculously
straightforward/obvious!
Dr. Alex Sutherland
Research Methods Associate,
Social Sciences' Research Methods Centre (SSRMC)
http://www.ssrmc.group.cam.ac.uk/
Office 3.12
Institute of Criminology,
University of Cambridge,
Sidgwick Site
CB3 9DA
Tel: +44 (0)1223 746519
as2140(a)cam.ac.uk
http://www.crim.cam.ac.uk/people/academic_research/alex_sutherland/
Dear Amelia community,
I am a new Amelia user and I have been trying to use Amelia but could not
understand how to run Amelia on a data from a study that has a within
subject and a between subject variable. Below I will try to explain my
situation with a hypothetical experiment and data.
Experiment: Let's assume I am interested to see the reaction time of
subjects to some stimulus (say they have to identify the heaviest of the
objects been placed on their left
and right hands) under either a neutral or a happy setting (I the later
case the subjects are provided with their choice of drinks and a snack).
Added to this, each subject is tested with a range of weights. And I am
interested to see if the subjects with the "happy" atmosphere can perform
well than the "neutral" ones.
Here is the R code that makes the data for the above experiment:
# =====================================================
# Create a dataframe to contain the subject name and the repeated measures
factor Stimulus intensity
mydata=data.frame(SubjectName=sort(rep(paste("Subject",1:8,sep="_"),8)),StimIntensity=(rep(seq(100,800,by=100))));
# Add the between subjects variable Group
mydata =
cbind(mydata,Group=sort(rep(c("Neutral","Happy"),32),decreasing=T));
# Creates the Response time values for first group : "Neutral"
i=0;k=0;while (i < 4)
{a[((i*8)+1):((i*8)+8)]=sort(rnorm(mean=10+(i*10):20+(i*10),1,n=8)); i =
i+1;};
# Creates the Response time values for the second group : "Happy"
i=0;b=0;while (i < 4)
{b[((i*8)+1):((i*8)+8)]=sort(rnorm(mean=10+(i*10):20+(i*10),1,n=8))*c(1,1,1,1,1,1.5,1.75,2);
i = i+1;};
# Add the data to the RT column in mydata dataframe
mydata=cbind(mydata,"RT"=c(a,b));
# Creates a second dataframe with missing data (n=15)
mydataMissing = mydata;
mydataMissing[runif(n=15,min=1,max=64),"RT"] = NA;
# =====================================================
As you can see I have also made an additional data fame that has the
missing data. The question is how do I run Amelia in this case.
Any help would be appreciated.
I guess the cross section variable would be "Group" and the time series
variable = "StimIntensity" but when I just provide only these it produces
the error below.
"amelia starting
Amelia Error Code: 61
There is only 1 column of data after removing the ts, cs and idvars. Cannot
impute without adding polytime."
Thanks in advance
Best
-Anup