Dear Prof. Kosuke Imai,
Really appreciating your quick response and tips.
Any idea what could be causing the difference then between linux
server/windows pc (difference in intercept estimate of -3.73 vs +0.67) ?
Or is there something I'm overseeing?
I've attached all necessary information in case you would have time to
have a look.
Thanks in advance,
Tom
Kosuke Imai wrote:
Dear Tom,
This warning message does NOT affect your results. When you are making
*conditional* predictions, we are calculating quantities of interest for
each observation of the data (i.e., in-sample inference). Therefore, we
need to set fn = NULL within setx. This warning comes up if you forget
this, but setx() automatically assigns fn = NULL. For details, see
http://gking.harvard.edu/zelig/docs/_TT_setx_TT__Setting_E.html
Best,
Kosuke
P.S. When you use traceback(), you need to have "()" in order to get
meaningful messages.
---------------------------------------------------------
Kosuke Imai Office: Corwin Hall 041
Assistant Professor Phone: 609-258-6601
Department of Politics eFax: 973-556-1929
Princeton University Email: kimai(a)Princeton.Edu
Princeton, NJ 08544-1012
http://www.princeton.edu/~kimai
---------------------------------------------------------
On Thu, 23 Jun 2005, Tom Vanwalleghem wrote:
Dear all,
I'm using Zelig for rare events logistic regression. In the past, I've
run it with succes on a Linux server. However, now I would try to get it
to work on my laptop (Win XP), so I can already do some analysis during
fieldwork periods.
I however receive the following error message : "Warning message:
when cond = TRUE, fn is coerced to NULL in: setx.default(z.out1, data =
test1, cond = TRUE) " (see below for more details)
I would like to know if someone could point out what it means? And above
all: can it be solved? Or will I have to keep working on the server?
The consequence of this error message is apparently that the intercept
estimate is too high, so something must go wrong in the rare events
correction I suppose?
Regards,
Tom
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
z.out1<-zelig(depressies~archeodist + aspect1
+ aspect2 + aspect3 +
B_1 + B_2 + B_3 + B_4 + B_5 +
+ B_6 + B_7 + G_fb + G_zbr + G_zle + gully + roadgully + helling, data =
test1 ,
+ model = "relogit" , tau = 71/22788 , bias.correct = TRUE)
x.out1<-setx(z.out1, data=test1, cond=TRUE)
Warning message:
when cond = TRUE, fn is coerced to NULL in: setx.default(z.out1, data =
test1, cond = TRUE)
traceback
function (x = NULL)
{
if (is.null(x) && (exists(".Traceback", env = .GlobalEnv)))
x <- get(".Traceback", env = .GlobalEnv)
if (is.null(x) || length(x) == 0)
cat(gettext("No traceback available"), "\n")
else {
n <- length(x)
for (i in 1:n) {
label <- paste(n - i + 1, ": ", sep = "")
if ((m <- length(x[[i]])) > 1)
label <- c(label, rep(substr(" ", 1,
nchar(label, type = "w")), m - 1))
cat(paste(label, x[[i]], sep = ""), sep = "\n")
}
}
invisible()
}
<environment: namespace:base>
traceback
--
Dr. ir. Tom Vanwalleghem
Physical and Regional Geography
K.U.Leuven
Redingenstraat 16
B-3000 LEUVEN
BELGIUM
tel +32(0)16/32.64.14
fax +32(0)16/32.64.00
new email! tom.vanwalleghem(a)kuleuven.be
z.out1<-zelig(depressies~archeodist + aspect1 +
aspect2 + aspect3 + B_1 + B_2 + B_3 + B_4 + B_5 +
+ B_6 + B_7 + G_fb + G_zbr +
G_zle + gully + roadgully + helling, data = test1 ,
+ model = "relogit" , tau = 71/22788 , bias.correct = TRUE)
summary(z.out1)
Call: zelig(formula = depressies ~ archeodist + aspect1 + aspect2 + aspect3 + B_1 +
B_2 + B_3 + B_4 + B_5 + B_6 + B_7 + G_fb + G_zbr + G_zle + gully + roadgully +
helling, model = "relogit", data = test1, tau = 71/22788, bias.correct =
TRUE)
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 0.6715 0.6289 1.0677 0.2866
archeodist -1.2674 0.5087 -2.4916 0.0133
aspect1 -0.3278 0.5352 -0.6124 0.5408
aspect2 0.8988 0.4045 2.2223 0.0271
aspect3 -0.0967 0.4801 -0.2014 0.8405
B_1 -0.2294 0.5677 -0.4041 0.6865
B_2 -15.0894 808.0271 -0.0187 0.9851
B_3 0.8899 0.4247 2.0955 0.0371
B_4 0.0234 0.5695 0.0412 0.9672
B_5 -0.4487 0.6823 -0.6577 0.5113
B_6 -1.1223 0.7798 -1.4392 0.1513
B_7 -15.8236 1552.4077 -0.0102 0.9919
G_fb 3.3175 1.4523 2.2843 0.0232
G_zbr -0.4735 0.3663 -1.2926 0.1973
G_zle -0.8981 0.6614 -1.3580 0.1756
gully -1.6922 0.8754 -1.9330 0.0543
roadgully -1.5486 0.9249 -1.6744 0.0953
helling -0.0756 0.0405 -1.8677 0.0629
Intercepts with prior correction for:
tau = 0.0031
-3.73
Degrees of Freedom: 279 Total (i.e. Null); 262 Residual
Null Deviance: 283
Residual Deviance: 220 AIC: 256
Rare events bias correction performed.
z.out1<-zelig(depressies~archeodist + aspect1 +
aspect2 + aspect3 + B_1 + B_2 + B_3 + B_4 + B_5 +
+ B_6 + B_7 + G_fb + G_zbr +
G_zle + gully + roadgully + helling, data = test1 ,
model = "relogit" , tau = 71/22788 , bias.correct = TRUE)+
summary(z.out1)
Call: zelig(formula = depressies ~ archeodist + aspect1 + aspect2 + aspect3 + B_1 +
B_2 + B_3 + B_4 + B_5 + B_6 + B_7 + G_fb + G_zbr + G_zle + gully + roadgully +
helling, model = "relogit", data = test1, tau = 71/22788, bias.correct =
TRUE)
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -3.733e+00 6.289e-01 -5.935e+00 9.294e-09
archeodist -1.267e+00 5.087e-01 -2.492e+00 1.334e-02
aspect1 -3.278e-01 5.352e-01 -6.124e-01 5.408e-01
aspect2 8.988e-01 4.045e-01 2.222e+00 2.711e-02
aspect3 -9.672e-02 4.801e-01 -2.014e-01 8.405e-01
B_1 -2.294e-01 5.677e-01 -4.041e-01 6.865e-01
B_2 -1.509e+01 8.080e+02 -1.867e-02 9.851e-01
B_3 8.899e-01 4.247e-01 2.095e+00 3.709e-02
B_4 2.343e-02 5.695e-01 4.115e-02 9.672e-01
B_5 -4.487e-01 6.823e-01 -6.577e-01 5.113e-01
B_6 -1.122e+00 7.798e-01 -1.439e+00 1.513e-01
B_7 -1.582e+01 1.552e+03 -1.019e-02 9.919e-01
G_fb 3.317e+00 1.452e+00 2.284e+00 2.315e-02
G_zbr -4.735e-01 3.663e-01 -1.293e+00 1.973e-01
G_zle -8.981e-01 6.614e-01 -1.358e+00 1.756e-01
gully -1.692e+00 8.754e-01 -1.933e+00 5.431e-02
roadgully -1.549e+00 9.249e-01 -1.674e+00 9.525e-02
helling -7.563e-02 4.050e-02 -1.868e+00 6.292e-02
Degrees of Freedom: 279 Total (i.e. Null); 262 Residual
Null Deviance: 283
Residual Deviance: 219.9 AIC: 255.9
Prior correction is made with tau = 0.00312
Rare events bias correction was made.