在R摘要中获取变量的子集 [英] Getting a subset of variables in R summary

查看:52
本文介绍了在R摘要中获取变量的子集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 summary时 函数在R中,我可以在那里传递一个选项以仅显示变量的子集吗?

When using the summary function in R, is there an option I can pass in there to present only a subset of the variables?

在我的示例中,我进行了面板回归,我有几个解释变量,并且有许多虚拟变量,这些变量的系数我不想显示.我想有一种简单的方法可以做到这一点,但是在功能文档中找不到.谢谢

In my example, I ran a panel regression I have several explanatory variables, and have many dummy variables whose coefficients I do not want to present. I suppose there is a simple way to do this, but couldn't find it in the function documentation. Thanks

推荐答案

它在文档中,但是您必须为 summary.plm print 方法>.参数是 subset .如以下示例所示使用它:

It is in the documentation, but you have to look for the associacted print method for summary.plm. The argument is subset. Use it as in the following example:

library(plm)
data("Grunfeld", package = "plm")
mod <- plm(inv ~ value + capital, data = Grunfeld)
print(summary(mod), subset = c("capital"))

这篇关于在R摘要中获取变量的子集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆