Dear Zelig Folk,
For a few applications, I'd like to run a single simulation. I thought I
might do this by setting num=1, but if I set num to anything less than 8, I
get the following error:
> Error in qi.polr(object[[1]], simpar = simpar, x = as.matrix(x), x1 = if
> (!is.null(x1)) as.matrix(x1)) :
subscript out of bounds
Except when I set num to either 1 or 2, in which case I get the following
error:
Error in matrix(rnorm(p * n), n) : invalid 'ncol' value (too large or NA)
It's not all that important to what I'm doing, but I'm curious if anyone
knows why this happens or if there's anything that can be done about it.
Cheers, Don
Hi,
I'm trying to run matchit followed by zelig to calculate the ATT:
After running z.out <- zelig(@@@), I get the following error message:
Error in `[.data.frame`(d, , all.vars(as.expression(formula))) :
undefined columns selected
I'm not sure why I'm getting this error message--afterwards, I want to run:
x.out1 <- setx(z.out1, data = match.data(m.outf, "treat"), cond = TRUE)
s.out1 <- sim(z.out1, x = x.out1)
Any help at all would be most appreciated!
best,
Prashant
P.S. Specifically, I had run the following code:
ps <- glm(Tr ~ female + urban + father_edu + mother_edu + siblings +
hs_type_best + kuaiban + wangjie + sx_non_mil12 + I(age^2) + I(urban*age) +
I(urban*mother_edu) + I(urban*sx_non_mil12) + I(female*sx_non_mil12) +
I(urban*wangjie) + I(female*wangjie), family=binomial, data=my.data)
X = cbind(age, female, urban, father_edu, mother_edu, siblings,
hs_type_best, kuaiban, wangjie, sx_non_mil12, I(age^2), I(urban*age),
I(urban*mother_edu), I(urban*sx_non_mil12), I(female*sx_non_mil12),
I(urban*wangjie), I(female*wangjie), ps$fitted)
m.outf <- matchit(Tr ~ X, data = rdmatchAC.lk12.range10, method = "genetic",
ratio = 2, replace = TRUE, pop.size=1000, discard = "control")
z.out1 <- zelig(Y1 ~ Tr + X + gk_score, model = "ls", data =
match.data(m.outf, "control"))
x.out1 <- setx(z.out1, data = match.data(m.outf, "treat"), cond = TRUE)
s.out1 <- sim(z.out1, x = x.out1)
Dear! Trento, 31/08/09
My name is claudio grasso, Faculty of Sociology in Trento, Italy. If don't
mistake ZELIG utilized R in order to work. J (have) understaad how to open file
in R . J am interested in the Ecological Inference.
I have four parties At1, Bt1, Ct1, Dt1 in an election and the same parties in
the following election At2, Bt2, ct2,Dt2
wHICH ARE THE COMANDS SINTAX IN ORDER to oblain transition matrixbetwen two
elections? Thank yuo. Claudio Grasso
-
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/
Hi Brad,
Thanks for your email. In zelig, we do not support "subset" command,
but instead we have "by" command where the model will be fitted separately
to each subclass defined by it.
I hope this helps,
Kosuke
--
Department of Politics
Princeton University
http://imai.princeton.edu
On Tue, 25 Aug 2009, Brad Jones wrote:
> Hi Kosuke,
>
> Maybe you're not the one I should be writing to but I want to ask you
> and possibly alert you to a *possible* problem in Zelig. I am
> estimating a very simple logit model (n=1645 or so) using Zelig. The
> results I got seemed implausible based on some preliminary GAMs I
> estimated. I compared the Zelig estimates to Stata's -logit- cmd and
> found the estimates to be off anywhere from 100 to 900 percent.
> Thinking there was a data problem, I estimated the logit using glm
> (without a Zelig wrapper) and obtained results gotten from Stata's
> -logit- cmd.
>
> Has anyone else reported this anonomaly? I thought I *must* be missing
> something so I asked a colleague to insepct
> my code and he found no errors. If you have any insights here, I'd
> appreciate it!
>
> Sincerely,
>
> Brad Jones
> UC-Davis
>
-
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/
Dear Zelig Folk,
I have a problem that you may have dealt with: mediating effects. Here's a
very simple version of the problem:
We have mock jury data in which:
Verdict (V) ~ Factual Perception (FP) + Egalitarianism (E)
Simple, right? Except that E influences V both directly and indirectly
through an influence on FP. So we really have two equations:
V ~ FP + E and FP ~ E
Since both V & FP are dependent on E, I should be able to simulate a
distribution of FP with E set to X *and* a distribution of V with E set to X
and FP set to sim(FP[E=X]).
The way I'm trying to do this by simulating 1000 values for FP with E set to
X. Now I have FPsim[1...1000]. Now I want to simulate V by setting E to X
and FP set to FPsim[1...1000].
So my questions are: Is that reasonable way to estimate direct & indirect
effects in theory? How would you go about doing it in practice?
Don
Dear! Trento/7/08/09
My name is Claudio grasso. I'm a student in his final year of the Faculty of
Sociology in Trento, Italy. I need help respect to ZELIG in R. I' nake analysis
of the electoral transition with other software. When I have the prompt of R
which syntax I must write in order to load the data file and to produce
transition matriz? I have 4 parties, the same, at the time t1 e t2: P1t1, P2t1,
P3t1, P4t1 and P1T2, P2T2, P3T2, P4T2: I'have abread installed ZELIG in R
(ultimate version). Which syntax I must write in order to load the data file
and to abtain (to achieve, to extract) the this 16 transition coefficients?
Coult yuo anserwer me to suggest (to indicate) the syntax? Coult yuo write it,
so I can the data file (EXCEL and .TXT) and to abtain the transition matrix?
Best regards
Claudio Grasso
-
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/
Hello,
I am trying to combine multiple imputation and sample weights using
Amelia & Zelig's normal.survey model. Example code-snippet:
[[
x <- (dataframe, including weight-variable "weight")
a.out <- amelia(x, m=5, idvars=c("weight"))
a.mi <- mi(imp$imputations)
fit <- zelig(support ~ sex, model="normal.survey", data=a.mi, weights=~weight)
]]
Unfortunately, I get the error: "Error in svyglm.survey.design(formula
= support ~ sex, design = list(cluster = list( : all variables must
be in design= argument". It does return a fitted model after it prints
the error.
I can use svyglm() directly and imputationList() & MIcombine() from
the mitools package to analyze Amelia's imputed datasets, for the same
formula:
[[
a.mi <- imputationList(a.out$imputations)
d <- svydesign(id=~1, data=a.mi) #passing an ids=~1 parameter to
zelig() does not help
results <- with(d, svyglm(support ~ sex))
MIcombine(results)
]]
But the output is less complete than that of Zelig.
Am I doing something wrong, or is it not possible to use imputed
datasets from Amelia together with sample weights?
salutations,
Maarten
-
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/