【问题标题】:LaTex Summary Table Options for Zelig MLogit ResultsZelig MLogit 结果的 LaTex 汇总表选项
【发布时间】:2015-04-21 02:48:42
【问题描述】:

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

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')"

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

【问题讨论】:

    标签: r latex r-zelig texreg


    【解决方案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)
        }
        ...
    }
    

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-06-08
      • 1970-01-01
      • 1970-01-01
      • 2021-12-08
      • 2015-06-27
      • 2011-09-30
      相关资源
      最近更新 更多