0

我一直在尝试从使用和mlogit运行的模型中提取我的摘要统计信息。Zeligtexregstargazermemisc

texreg向我抛出以下错误:

texreg(MLogitRes3)
Error in (function (classes, fdef, mtable)  : unable to find an     
inherited method for function ‘extract’ for signature ‘"vglm"’

stargazer向我抛出以下错误:

stargazer(MLogitRes3)
Error in objects[[i]]$zelig.call : 
$ operator not defined for this S4 class

memisc(使用该mtable函数)向我抛出了最后一个错误:

mtable(MLogitRes3)
Error in UseMethod("getSummary") : 
no applicable method for 'getSummary' applied to an object of class
"c('vglm',  'vlm', 'vlmsmall')"

这些包都不支持mlogit选择模型zelig吗?我是否可以选择将我的汇总统计信息导出到其他地方的 LaTex 中可用的表格中?

4

1 回答 1

1

您最近是否尝试过重现此问题?我刚刚检查了代码texreg::extract.zelig,它似乎有一个方法mlogit

function (model, include.aic = TRUE, include.bic = TRUE, include.loglik = TRUE, 
    include.deviance = TRUE, include.nobs = TRUE, include.rsquared = TRUE, 
    include.adjrs = TRUE, include.fstatistic = TRUE, ...) 
    ...
    else if ("mlogit" %in% class(model)) {
        coefficient.names <- rownames(s@coef3)
        coefficients <- s@coef3[, 1]
        standard.errors <- s@coef3[, 2]
        zval <- s@coef3[, 3]
        significance <- 2 * pnorm(abs(zval), lower.tail = FALSE)
        gof <- numeric()
        gof.names <- character()
        gof.decimal <- logical()
        if (include.loglik == TRUE) {
            lik <- logLik(model)[1]
            gof <- c(gof, lik)
            gof.names <- c(gof.names, "Log Likelihood")
            gof.decimal <- c(gof.decimal, TRUE)
        }
        if (include.deviance == TRUE) {
            dev <- deviance(s)
            if (!is.null(dev)) {
                gof <- c(gof, dev)
                gof.names <- c(gof.names, "Deviance")
                gof.decimal <- c(gof.decimal, TRUE)
            }
        }
        if (include.nobs == TRUE) {
            n <- nrow(model$data)
            gof <- c(gof, n)
            gof.names <- c(gof.names, "Num. obs.")
            gof.decimal <- c(gof.decimal, FALSE)
        }
        tr <- createTexreg(coef.names = coefficient.names, coef = coefficients, 
            se = standard.errors, pvalues = significance, gof.names = gof.names, 
            gof = gof, gof.decimal = gof.decimal)
        return(tr)
    }
    ...
}

无论如何,如果您仍然遇到问题,您可能需要阅读文章的第 6 节,texreg它为您提供有关如何为任何模型定义自己的extract方法的说明,和/或编写包作者 (Philip Leifeld) 以获得支持.

于 2015-07-31T23:22:12.133 回答