1
$\begingroup$

I tried to get the estimated coefficients from the relogit model of the Zelig package, but R returns NULL in the console when I run the script. Let's see the following example taken from http://ftp.uni-bayreuth.de/math/statlib/R/CRAN/doc/vignettes/Zelig/relogit.pdf :

library(Zelig)

data(mid) 

z.out1 <- zelig(conflict ~ major + contig + power + maxdem + mindem + years, 
            data = mid, model = "relogit", tau = 1042/303772) 
summary(z.out1) 

z.out1$coefficients

I got the following output:

    Call:  relogit(formula = form, bias.correct = bias.correct, case.control = case.control, 
    tau = tau, data = data)

Coefficients:
             Estimate     Std. Error   z value      Pr(>|z|)   
(Intercept)   -7.508e+00    1.793e-01   -4.188e+01   1.535e-304
major          2.432e+00    1.572e-01    1.547e+01    4.556e-52
contig         4.108e+00    1.573e-01    2.612e+01   3.852e-136
power          1.054e+00    2.168e-01    4.861e+00    1.228e-06
maxdem         4.804e-02    1.004e-02    4.783e+00    1.805e-06
mindem        -6.413e-02    1.277e-02   -5.020e+00    5.444e-07
years         -6.293e-02    5.692e-03   -1.106e+01    6.687e-28

Degrees of Freedom: 3125 Total (i.e. Null);  3119 Residual
Null Deviance:      3979 
Residual Deviance: 1869     AIC: 1883

Prior correction performed with tau = 0.003430204 
Rare events bias correction performed
> z.out1$coefficients
NULL

Then I tried to run the following script from the same model, following http://docs.zeligproject.org/en/latest/zelig-relogit.html :

z.out1$getcoef

but I got the same NULL answer from the console. How I can get the coefficient values vector?

$\endgroup$
1
$\begingroup$

It should be z.out1$getcoef(), getcoef() is a function call. It will return a list, the coefficient vector is thus z.out1$getcoef()[[1]].

The normal way, i.e. coef(summary(MODEL)) as we will do for glm etc, doesn't work for Zelig.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.