-------- Original Message --------
Subject: as.factor in normal.bayes
Date: Thu, 10 Nov 2005 14:28:54 -0500
From: ying lu <ylu(a)iq.harvard.edu>
Reply-To: ylu(a)iq.harvard.edu
To: aleman(a)fordham.edu, zelig(a)mail-1.hmdc.harvard.edu
Hi Jose,
To use 'as.factor' option in normal.bayes, pls refer to the following
example:
z.out2<-zelig(unem~gdp+trade+as.factor(year)+as.factor(country),
model="normal.bayes", data=macro)
summary(z.out2)
If you have any questions about as.factors( ), pls refer to the R help file.
Ying
-------- Original Message --------
Subject: Re: question to zelig developers (fwd)
Date: Wed, 9 Nov 2005 11:43:57 -0500 (EST)
From: Kosuke Imai <kimai(a)Princeton.Edu>
To: Ying Lu <ylu(a)iq.harvard.edu>
CC: Olivia Lau <olau(a)fas.harvard.edu>
Ying,
Is it true that "as.factor" does work in nomal.bayes? If it does, can
you send a response to zelig email list with cc to Jose?
Thanks,
Kosuke
---------- Forwarded message ----------
Date: Wed, 09 Nov 2005 11:39:28 -0500
From: aleman(a)fordham.edu
To: Kosuke Imai <kimai(a)Princeton.EDU>
Subject: Re: question to zelig developers
as.factor does not seem to work. I'll see what this means for my model.
J
Kosuke Imai <kimai(a)Princeton.Edu>
11/08/2005 06:41 PM
To
aleman(a)fordham.edu
cc
Subject
Re: question to zelig developers
good. you don't need stata.data$ thing. just enter the variable name.
Maybe, then as.factor will work.
K
On Tue, 8 Nov 2005 aleman(a)fordham.edu wrote:
Hi Kosuke,
Good seeing you today. You are right, the script works, but only if I
avoid
as.factor() variables like country or
year dummies. That's when I get the message
Error in eval(expr, envir, enclos) : NA/NaN/Inf in foreign function call
(arg 17)
I guess a way to get around this would be to try to change priors and
estimate
then directly. I still wonder
though why it won't let me use as.factor ()
variables.
Jose
Call: zelig(formula = stata.data$utip ~ stata.data$wcoord +
stata.data$labmgmt +
stata.data$tnchs + stata.data$tnclc +
stata.data$govtints +
stata.data$wagecoor + stata.data$sstran + stata.data$netu +
stata.data$cg + stata.data$openk + stata.data$capital +
stata.data$egrowth,
model = "normal.bayes", data =
stata.data)
Iterations = 1001:11000
Thinning interval = 1
Number of chains = 1
Sample size per chain = 10000
Mean, standard deviation, and quantiles for marginal posterior
distributions.
Mean SD 2.5% 50% 97.5%
(Intercept) 34.374 0.837 32.753 34.367 36.026
stata.data$wcoord -0.198 0.129 -0.452 -0.197 0.050
stata.data$labmgmt 1.809 0.584 0.656 1.809 2.950
stata.data$tnchs -5.468 0.677 -6.801 -5.467 -4.125
stata.data$tnclc -0.911 0.932 -2.732 -0.908 0.912
stata.data$govtints -0.129 0.452 -1.021 -0.134 0.754
stata.data$wagecoor -0.223 0.403 -1.013 -0.226 0.578
stata.data$sstran -0.127 0.039 -0.204 -0.127 -0.050
stata.data$netu 0.000 0.000 0.000 0.000 0.000
stata.data$cg -0.035 0.019 -0.073 -0.035 0.003
stata.data$openk 0.056 0.007 0.042 0.056 0.069
stata.data$capital 0.481 0.212 0.067 0.484 0.891
stata.data$egrowth 0.049 0.032 -0.014 0.049 0.110
sigma2 2.692 0.233 2.276 2.680 3.192