Questions tagged [plm]

R package primarily concerned with panel data. Package contains a set of estimators and tests for panel data.

510 questions
0
votes
0 answers

R error in using HT approach

I am using trade data, and studying the export model. I want to use HT method, but it gives me this error. I have read across but I can't seem to fix it. R <- pht(pdata$LnExport ~ pdata$LnGDP_L + pdata$capp + pdata$NRr + pdata$Index2 + pdata$EFI +…
0
votes
0 answers

R plm package and index column mistakenly as a factor, rows sorting

I've a Panel Dataset structured as follows: DS_CODE YEAR COUNTRY ... ... 671405 1997 AT 671405 1998 AT 671405 1999 AT 30885R 1997 AT 30885R 1998 AT 30885R 1999 AT ... …
Dan
  • 21
  • 4
0
votes
2 answers

Performing VIF Test in R

I started using R studio a few days ago and I am struggling a bit to compute a VIF. Here is the situation: I have a panel data and ran Fixed effect and Random effect regressions. I have one Dependent Variable (New_biz_density) and 2 Independent…
0
votes
0 answers

Multicollinearity in a two ways fixed effect regression

I have a df based on a national survey conducted every two years; the time period is 2010-14 and I filtered the df in order to have only person that appears al least two times. In this way I have a panel df but unbalanced. I run a regression to…
Laura R.
  • 99
  • 1
  • 10
0
votes
1 answer

Waldtest in R to get adjust F statistic with plm and result shown with stargazer?

I am working with an unbalanced short panel. Raw data: bankFull.xlsx What I actually want is only get the regression results with two side fixed effects and robust S.E reported, which is very easy in Stata. I followed online tutorial but ran into…
0
votes
2 answers

Panel Data Regression on Biglm in R - Non Linear Model

I have following data set which is panel data. Total data is about 78 millions rowcount. I have few more columns of data which I have skipped here. date stockName PRC VOLUME 2 2016-06-01 09:30:53 ABCD IS Equity 14.25 13957 3…
Zico
  • 185
  • 12
0
votes
1 answer

lmtest::bptest tests OLS residuals, also for FE as input

I want to test a fixed effects regression for heteroscedasticity with lmtest::bptest. The test results I get from bptest are identical for a fixed effects regression and OLS. It seems as if bptestautomatically extracts the formula from the input…
KenHBS
  • 6,756
  • 6
  • 37
  • 52
0
votes
1 answer

Problems with plm, duplicate time id's error

I am running a fixed effects regression and am getting the following error: fixed_effects <- plm(GNI ~ lag(GNI) + imposition + ExpImp + democ, data = sanctions_data6, index = c("country", "sanctions_period"), model = "within", effect =…
jo.magi
  • 29
  • 1
  • 7
0
votes
0 answers

plm cross-validation runtime-error

I am trying to cross-validate a panel data analysis, but I am having trouble with the prediction function. The code below is a section of the CV function where the problem occurs. When I try to run this part of the function I get the error message…
Herzriesig
  • 131
  • 6
0
votes
1 answer

Replicating Stata's xtlogit regression for panel data in R

I am trying to replicate a Stata xtlogit re regression that is run on panel data in R. By panel data I mean that I have multiple observations for different individuals (person_id) in different years (year_id). My dependent variable (DV) is binary. I…
Phil
  • 954
  • 1
  • 8
  • 22
0
votes
0 answers

R plm package - error when trying to fit a random effect

When I try to fit the following random effect on a panel…
José
  • 921
  • 14
  • 21
0
votes
1 answer

Coerce fixef to data frame in R (PLM package)

I'd like to get the fixed effects from a fixed effects panel data regression as a data frame. Something like this: data("Produc", package = "plm") zz <- plm(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp, data = Produc, index =…
John Chrysostom
  • 3,973
  • 1
  • 34
  • 50
0
votes
1 answer

Substitute strings into {plm} model

This tutorial shows how to substitute strings into an lm model call. I want to do the same thing but using plm for panel regression. The goal is to make a grid of parameter combinations and then run several regressions with one apply call,…
jeff
  • 3
  • 3
0
votes
1 answer

R: Diagnostic Tests on Panel Regression

I have the following data that I am running panel regression on. I would like to test for unit root using plm's purtest: date years_exp cid cfcontrol leg_totalbills state amtsumlag_1 amtsumfwd_1 billsumfwd_1 billsum amtsum …
Collective Action
  • 7,607
  • 15
  • 45
  • 60
0
votes
2 answers

How to get individual coefficients and residuals in panel data using fixed effects

I have a panel data including income for individuals over years, and I am interested in the income trends of individuals, i.e individual coefficients for income over years, and residuals for each individual for each year (the unexpected changes in…
Aslı Gürer
  • 39
  • 1
  • 9