将plm模型概括为r中的方程

将plm模型概括为r中的方程

本文介绍了将plm模型概括为r中的方程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的论文中,我估计了不同的内。和汇集使用plm软件包的plm()建立模型。另外,我通过使用时滞修改了一些模型。所有模型都运行良好,我得到了结果。现在,我想通过显示模型方程来可视化模型。所以我的问题是:


有没有一种方法可以从模型中提取方程式?


在之前,我会以最基本的方式使用它任何计算都可以完成。...
,因为


对于我的模型,我使用面板数据集,而我的模型看起来更像这样(只是更多的控制变量)。


p>

model1<-plm(a〜b + c,模型=内部,数据)


谢谢

解决方案

首先,请尝试使用数据框示例制作可复制的示例,如果您使用外部软件包时,请务必注明。参见。


第二,假设它是软件包 plm 中的函数,则对象 model1 应该具有系数


等式如下:

  model1 $ coefficients [1] + model1 $ coefficients [2] * b + model1 $ coefficients [3] * c + model1 $ coefficients [4] * d 

此外,由于您要声明数据,因此可以将调用简化为:

  model1<-plm(a〜b + c + d,model = within,data)


In my thesis i estimated different "within" and "pooling" models using plm() of the plm package. Additionally, i modified some models by using a time lag. All the models work well and i got my results. Now i would like to visualize the models by showing their equation. So my question is:

Is there a way to extract the equation from the model?

I would need it in the most basic way, before any calculation is done....more or less like this because it is not about showing my results, but the math i use.

For my models i use a panel dataset and my models look more less like this (just more control variables).

model1 <- plm (a ~ b + c, model = "within", data)

Thank you

解决方案

First, please try to make a reproducible example with a sample of your dataframe, and if you are using an external package make sure to state it. See https://stackoverflow.com/help/how-to-ask.

Second, assuming it's the function from package plm as it seems, your object model1 should have the coefficients.

The equation would be something like:

model1$coefficients[1] + model1$coefficients[2] * b + model1$coefficients[3] * c + model1$coefficients[4] * d

Also, since you are stating the data, you could simplify your call as:

model1 <- plm (a ~ b + c + d, model = "within", data)

这篇关于将plm模型概括为r中的方程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 03:27