it looks to me that the first line is incorrect
vars_to_impute <- gundata[c("progun",
should be
vars_to_impute <- gundata[,c("progun",
alternatively, you can use subset() command.
Kosuke
On Fri, 23 May 2008, Donald Braman wrote:
I'm trying to use Zelig and Amelia. I've
tried it a few different
ways, but can't seem to get it right. Here's what I've tried:
## first I impute the missing data, which goes just splendidly
vars_to_impute <- gundata[c("progun", "egalitarianism",
"individualism",
"crfear", "victim", "female", "black",
"white",
"income", "ruralkid", "ruralnow",
"protestant", "jewish", "iss", "democrat",
"cons")]
imputed <- amelia(data=vars_to_impute)
## Then I tried this
z.out <- zelig(progun ~ egalitarianism + individualism ,
model = "ls",
data = imputed)
## but I just get this error:
## Error in data.frame(m = 5, idvars = NULL, logs = NULL, ts = NULL,
cs = NULL, :
## arguments imply differing number of rows: 1, 0, 13, 8, 16, 21
## I've also tried this
inmi1 <- read.csv("outdata1.csv")
inmi2 <- read.csv("outdata2.csv")
inmi3 <- read.csv("outdata3.csv")
inmi4 <- read.csv("outdata4.csv")
inmi5 <- read.csv("outdata5.csv")
z.out <- zelig(progun ~ egalitarianism + individualism ,
model = "ls",
data = mi(immi1, immi2, immi3, immi4, immi5))
## which produces this error:
## Error in `[.data.frame`(d, , all.vars(as.expression(formula))) :
## undefined columns selected
## I'm sure it's a simple error on my part, I just can't figure out
what it might be.
Don
-
Zelig Mailing List, served by Harvard-MIT Data Center
Send messages: zelig(a)lists.gking.harvard.edu
[un]subscribe Options:
http://lists.gking.harvard.edu/?info=zelig
Zelig program information:
http://gking.harvard.edu/zelig/