plm

Merge plm fitted values to dataset

泪湿孤枕 提交于 2019-12-02 11:58:33
问题 I'm working with a fixed effects regression model using plm. The model looks like this: FE.model <-plm(fml, data = data.reg2, index=c('Site.ID','date.hour'), # cross section ID and time series ID model='within', #coefficients are fixed effect='individual') summary(FE.model) "fml" is a formula I defined previously. I have many independent variables, so this made it more efficient. What I want to do is get my fitted values (my yhats) and join them to my base dataset; data.reg2 I was able to get

Fixed Effects Regression with Interaction Term Causes Error

纵饮孤独 提交于 2019-12-01 17:34:26
I am trying to estimate a panel dataset with an interaction term for geographical areas (LoadArea, DischargeArea) which signifies a route. Using the fixed effects specification, it does not like the interaction term (LoadArea * DischargeArea) and produces the following error when you summarize the regression: mult_fe<-plm(log(DayRate)~LoadArea *DischargeArea + factor(Laycan.Day.Diff) + CapUtil + Age + I(Age^2) + WFRDWT + lag_BDTI, data=mult_reg1,model="within"); summary(mult_fe) Error in crossprod(t(X), beta) : non-conformable arguments This works fine in a normal OLS regression replacing plm

Fixed Effects Regression with Interaction Term Causes Error

五迷三道 提交于 2019-12-01 17:27:36
问题 I am trying to estimate a panel dataset with an interaction term for geographical areas (LoadArea, DischargeArea) which signifies a route. Using the fixed effects specification, it does not like the interaction term (LoadArea * DischargeArea) and produces the following error when you summarize the regression: mult_fe<-plm(log(DayRate)~LoadArea *DischargeArea + factor(Laycan.Day.Diff) + CapUtil + Age + I(Age^2) + WFRDWT + lag_BDTI, data=mult_reg1,model="within"); summary(mult_fe) Error in

Robust standard error estimation for the Hausman-Taylor estimator using plm() and vcovHC()

与世无争的帅哥 提交于 2019-12-01 08:19:14
问题 Suppose I compute the Hausman-Taylor estimator using the plm command with the option: model= "ht" . Using the result I like to obtain a robust variance-covariance matrix to make inference fully robust. For this purpose the vcovHC() command (part of the plm package) is used. Here is a minimal example: data("Wages", package = "plm") ht <- plm(lwage ~ wks + south + smsa + married + exp + I(exp^2) + bluecol + ind + union + sex + black + ed | sex + black + bluecol + south + smsa + ind, data =

R packages effects & plm : “error in contrasts” when trying to plot marginal effects

*爱你&永不变心* 提交于 2019-11-30 09:28:45
问题 After reading this answer on error in contrasts and reviewing my data I am still stuck with a problem when trying to combine packages 'plm' and 'effects'. This might be impossible as John Fox does not discuss this possibility in his effects document (link is not allowed apparently - Google: "john fox effects package" if you want to have a look). So if it is indeed impossible please tell me. I am running a simple regression on a reduced data set library(plm) ; library(effects) shortdata<-plm

PLM学习笔记(1)- JT2Go简介

我只是一个虾纸丫 提交于 2019-11-29 23:33:51
JT2GO 是一款西门子公司出品的三维图形轻量化预览解决工具,包含精确3D测量、基本3D剖面、PMI显示和改进的选项过滤器等强大的功能。通过这款三维测量软件,你可以让OEM(原始设备制造商)、供应商、业务伙伴和客户等轻松方便的预览访问特定的三维产品数据,为双方的深入合作提供基础数据,做出更好的产品。 【功能特色】   1、图形通过勾选产品的展开树显示在project workspace的区域中,十分便捷   2、通过Align to alix按钮能够选择(如图)各个坐标系,从不同的方向查看产品。   3、3D standard views工具栏,包括了基本的3D缩放、全景、旋转、缩放和重定位。   4、该 三维测量软件 还能提供3D剖面,方便使用者对产品零件的内部结构进行浏览。   5、直接查看数字模型的产品制造信息(PMI),如尺寸、容差和其它制造数据等,   6、能够把JT2Go ActiveX 查看器嵌入网页中,便于传播。 来源: https://www.cnblogs.com/61007257Steven/p/11539560.html

R packages effects & plm : “error in contrasts” when trying to plot marginal effects

孤街醉人 提交于 2019-11-29 15:47:42
After reading this answer on error in contrasts and reviewing my data I am still stuck with a problem when trying to combine packages 'plm' and 'effects'. This might be impossible as John Fox does not discuss this possibility in his effects document (link is not allowed apparently - Google: "john fox effects package" if you want to have a look). So if it is indeed impossible please tell me. I am running a simple regression on a reduced data set library(plm) ; library(effects) shortdata<-plm.data(shortdata,index=c("ID","Year")) MESS<-plm(paci_to_t ~ paco_to_t + cddom + cddom2,data=shortdata

Double clustered standard errors for panel data

帅比萌擦擦* 提交于 2019-11-28 07:48:34
I have a panel data set in R (time and cross section) and would like to compute standard errors that are clustered by two dimensions, because my residuals are correlated both ways. Googling around I found http://thetarzan.wordpress.com/2011/06/11/clustered-standard-errors-in-r/ which provides a function to do this. It seems a bit ad-hoc so I wanted to know if there is a package that has been tested and does this? I know sandwich does HAC standard errors, but it doesn't do double clustering (i.e. along two dimensions). Frank Harrell's package rms (which used to be named Design ) has a function

Is there a predict function for PLM in R?

ぃ、小莉子 提交于 2019-11-28 07:40:31
I have a small N large T panel which I am estimating via plm (panel linear regression model), with fixed effects. Is there any way to get predicted values for a new dataset? (I want to estimate parameters on a subset of my sample, and then use these to calculate model-implied values for the whole sample). Thanks! There are (at least) two methods in the package to produce estimates from plm objects: -- fixef.plm: Extract the Fixed Effects -- pmodel.response: A function to extract the model.response It appears to me that the author(s) are not interested in providing estimates for the "random

Clustered standard errors in R using plm (with fixed effects)

丶灬走出姿态 提交于 2019-11-27 18:46:48
问题 I'm trying to run a regression in R's plm package with fixed effects and model = 'within' , while having clustered standard errors. Using the Cigar dataset from plm , I'm running: require(plm) require(lmtest) data(Cigar) model <- plm(price ~ sales + factor(state), model = 'within', data = Cigar) coeftest(model, vcovHC(model, type = 'HC0', cluster = 'group')) Estimate Std. Error t value Pr(>|t|) sales -1.21956 0.21136 -5.7701 9.84e-09 This is (slightly) different than what I'd get by using