2009/11/23 JOSE A ALEMAN <aleman(a)fordham.edu>:
> Hi Gregor,
>
> Thanks for your response. I think these are the plots you're talking about:
>
> qqmath(ranef(z.out, postVar = TRUE), strip = FALSE)
>
> The problem is that I have two random effects and R superimposes the plot
> for the second one on top of the plot for the first. How can I make it
> produce the two side by side so that I can also see the first plot?
>
Try with
par(mfrow=c(1, 2))
gg
-
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 all,
I have a set of questions as to how I can use Zelig with multiply imputed panel data.
Here's the general outline: I have a panel data set, with country-years as the unit of observation, with something like one third missingness, and so I want to use multiple imputation to deal with that problem (which I have done in Amelia II). Also, however, I would like to use panel data methods (random, fixed,between effects models) for the analysis; further, it would be nice to have access to some of the features in Zelig.
I've done some of the analysis before with a batch file, taking elements off the objects that the plm panel data package creates, and then using the combining rules and loops to get parameter estimates. But I've never been able to easily do things like estimate and simulate other quantities of interest.
It's not obvious to me how one would specify panel data methods (such as are implemented in the plm package) for use in Zelig. Specifically, I need to define and analyze fixed effects and between effects for countries. Since there is not a specifically panel data model/set of models in Zelig's included models, how can I use Zelig to do what I want?
Thanks for any help you can give.
Best,
-Nathan
----------
Nathan A. Paxton, Ph.D.
Dept. of Government, Harvard University
napaxton AT fas DOT harvard DOT edu
http://www.fas.harvard.edu/~napaxton
========================================================
Stand up for hope, faith, love
But while I'm getting over certainty
Stop helping God across the road like a little old lady.
—U2
========================================================
Dear Kosuke
Imai,
Thank you for
the quick confirmation of the message's receipt. Following your indication, I'm
addressing my question to all Zelig users with my thanks in advance for
helping me solve out the problem.
I have a special interest in the
"logit mixed" model and the issue related to which I would be grateful you could
give some feedback is the following: most of the variables in my data set are
categorical variables. The problem I have is that when I'm trying to calculate
interaction effects with the "sim" function and two categorical variables are
involved, I usually cannot do it. Moreover, if it works, it is only for some
levels of the categorical variables, not all of them.
The message I
get in my R prompt is as follows:
-------
Error in object@nlmodel$family$linkinv(eta) :
Argument eta must be a nonempty numeric
vector
------------
And I do not know how to interpret
it.
What I usually do is:
- Order the categorical
variables, for
example.
>age<-as.ordered(AGE)
>education<-as.orderd(EDUCATION)
>gender<-as.orderd(GENDER)
...
The dependent variable (Internet at home for example-Ihome) is
categorical, with two levels (Yes/no)
After estimating the
model:
>Res<-zelig(Ihome~age+education+gender+...+gender*education+gender*skills+...+tag(1|region),
data=dat,model="logit.mixed",na.action=na.exclude)
>Summary(Res)
Apart
from obtaining a global interaction effect between "gender and education" for
example (both of them individual level variables), I would like to calculate
the interactions for all the levels of these variables: gender (male, female,
ordered as: male<female); education (low secondary,
high secondary,
university; ordered as: low secondary<high
secondary<university) and I
do the following:
>x.ge<-setx(Res, gender="male", education="low
sec")
>s.ge<-sim(Res,x=x.ge)
Or
>x.ge1<-setx(Res,
gender="male", education="high
sec")
>s.ge1<-sim(Res,x=x.ge1)
...
But I always get the
error message:
Error in object@nlmodel$family$linkinv(eta) :
Argument eta must be a nonempty numeric
vector
I have to say that when a numerical and a categorical variable are
involved it works.
Many thanks in advance for your
help.
Sincerely yours,
Nela
Filimon
-
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 everyone
I am running a mixed effects logit on a multiple imputed dataset, as follows:
G1m <- zelig(fm.mixed, data=a.out$imputations, model="logit.mixed")
this runs, but summary(G1m) gives:
summary(G1m)
Error in x$coef : $ operator is invalid for atomic vectors
Poking around, I discover that the model "object[i]" in the method
"summary.MI" is not responding nicely to summary() when that is called
to give res[i]:
> summary(object[i])
Length Class Mode
[1,] 1 mer S4
> class(object[i])
[1] "list"
by contrast, running the same thing on a normal dataset gives a "mer"
object which responds nicely to summary():
> G1mtmp <- zelig(fm.mixed, data=ds, model="logit.mixed")
> summary(G1mtmp)
Generalized linear mixed model fit by the Laplace approximation
Formula: fm.mixed
Data: ds
AIC BIC logLik deviance
227 275 -103 205
[et cetera..........]
Is this just my setup, or can others reproduce this bug?
cheers,
David Hugh-Jones
Post-doctoral Researcher
Max Planck Institute of Economics, Jena
http://davidhughjones.googlepages.com
-
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 developers and users,
I want to find robust standard errors after fitting a model
So I checked out package Zelig
Here are the following commands
R >library(Zelig)
>data(coalition)
>z.out3 <- zelig(Surv(duration, ciep12) ~ polar + numst2 + crisis, model
= "weibull", data = coalition, cluster = "invest", robust = TRUE)
It gives the following error
Error in rowsum.default(resid(fit, "dfbeta"), cluster) :
'x' must be numeric
Please Help
Thanking You
Sayan Dasgupta
Dear Zelig developers,
I'm trying to fit a panel data model with random intercepts for countries
and years with the following syntax:
model <- zelig (y ~ x1 + x2 +....+Xn + tag(1 | country) + tag (1 | year),
model="ls.mixed", data=data)
Is there a way to plot the intercepts for the country and year?
Also, when I try to recover the intercepts typing,
> ranef(z.out)
the intercepts for the variable year are all 0. Is this normal?
$year
(Intercept)
1965 0
1966 0
1967 0
1968 0
1969 0
1970 0
1971 0
1972 0
1973 0
1974 0
1975 0
1976 0
1977 0
1978 0
1979 0
1980 0
1981 0
1982 0
1983 0
1984 0
1985 0
1986 0
1987 0
1988 0
1989 0
1990 0
1991 0
1992 0
1993 0
1994 0
$country
(Intercept)
1 -1.5937
2 1.7322
3 1.3499
4 0.1067
5 -1.3251
6 1.9233
7 -2.1994
8 -2.4623
10 1.6205
11 3.1561
12 -1.9093
14 2.0440
15 -1.1238
17 -2.2060
18 0.8868
Thanks,
Jose Aleman, Ph.D.
Assistant Professor
Political Science Department
Fordham University
-
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/