Skip to main content

Questions tagged [plm]

The `plm` package for R provides functions for linear models for panel data.

Filter by
Sorted by
Tagged with
0 votes
0 answers
36 views
+50

How to get KP F-stat in IV regression in R?

I am running an IV regression with fixed effects and clustered standard errors similar to the one below and would like to compute the Kleibergen-Paap (rank) F-statistic for weak identification. Is ...
dufei's user avatar
  • 51
0 votes
0 answers
16 views

Tobit estimation on panel data in combination with an IV approach in R?

I have panel data (country by year) and my dependent variable is left-censored (many countries have zero values, other countries have very large numbers). So, I think that I should implement a Tobit ...
TFT's user avatar
  • 345
0 votes
0 answers
22 views

How to implement an Anderson-Rubin test and calculate confidence intervals for an iv model set up with plm in r?

I have run an IV model using the plm-package in r. The underlying data is panel data. My instrument is "weak", i.e. the F-statistic lies below 10. How can I implement an Anderson-Rubin test ...
TFT's user avatar
  • 345
0 votes
1 answer
48 views

Indicator variables/treatment variables as an independent variable?

Can a dummy variable or treatment variable be an independent variable? My independent variable take the value 1 if a flood occurs in a specific country in a specific year and 0 if no flood happens. ...
zeinab hassano's user avatar
0 votes
0 answers
22 views

Unable to get heteroskedasticity-robust standard errors for PLM "between" model

I am presently running a regression on a balanced panel dataset, where I observe +1000 individuals over a T=10 time period. Given that individual specific independent variables remain constant over ...
Mr42's user avatar
  • 1
0 votes
1 answer
51 views

FD estimator: manual first differencing versus plm

I am working on a first-difference (FD) estimator for panel data (only two time periods). I calculated manually the first difference of each variable (dependent and two regressors) and then run an OLS ...
Katharina K's user avatar
0 votes
1 answer
39 views

Interpretation of interaction term coefficient in fixed effects estimation

I have balanced panel data for 14 industries and 21 years. The data consists of several variables with annual observations. Based on theoretical reasoning and visual data inspection I assume that ...
MaMö's user avatar
  • 3
1 vote
0 answers
93 views

How to run fixed-effects model on survey data in R?

I have two periods of panel data and I am trying to see if coefficients change over time. I would like to control for individual-level heterogeneity, but not sure how to do it with a complex design ...
pawpaw's user avatar
  • 23
1 vote
0 answers
39 views

Estimating treatment effect using panel data and absorbing binary treatment

I have a panel dataset of a large N and T = 24. I want to estimate the effect of a treatment (in this case, taking on a certain type of credit product) on Y which is an individuals credit score. I ...
eobrien's user avatar
  • 11
0 votes
0 answers
35 views

Matched panel data regression in R: clustering on three dimensions (firm_id, year, matching value) with plm package

I'm new to working with panel data in general. While I work with R my coauthors work with Stata. So naturally, I'm running into problems that they can't relate to but I also can't fully explain them ...
Ahrnet's user avatar
  • 1
0 votes
1 answer
164 views

Autocorrelation robust errors with plm and vcovHC

I have a panel dataset where I suspect a serial correlation. I found the vcovHC function in plm package which should solve both ...
aleschory's user avatar
0 votes
0 answers
96 views

plm function dropping control variables only when not included with "ds$" before them

I noticed some interesting behaviour of the plm function (from package plm) in R today: When running models such as: ...
strugglingonthesis's user avatar
0 votes
0 answers
80 views

Difference-in-differences regression in R: validity, assumptions, and correct usage

I am currently writing one of my first empirical papers. As a side note, the topic is the effect of a CEO change on financial performance. Conceptually, I decided on the DiD approach, as I have a ...
strugglingonthesis's user avatar
0 votes
0 answers
68 views

Cross-sectional dependence tests returning NA unbalanced panel

I'm analysing slightly unbalanced panel data in r (n = 136, T = 9-213, N = 24894) and planning on using fixed or random effects (Hausman test indicates random effects, but high likelihood of omitted ...
slimdaddio's user avatar
1 vote
1 answer
159 views

Generalized Difference-In-Difference with join in and drop outs across span of time periods

I have some 23 months of longitudinal data for around 22,000 users. Approximately 2,000 of those users received an intervention during that period - with the intervention occurring during any one of ...
first_analytics_50's user avatar
1 vote
0 answers
86 views

Heteroscedasticity and Serial Correlation in FGLS model

I am currently working with panel data. My fixed effects model showed signs for serial correlation, cross sectional dependence and heteroscedasticity. Therefore, I continued with the FGLS method to ...
izzy's user avatar
  • 11
1 vote
1 answer
1k views

R plm fixed effect model where the index and fixed effects variables are not the same

I used the plm() function for a 2-way fixed effect model with zip_code and month (yy-mm) ...
user14845313's user avatar
0 votes
1 answer
72 views

Rescaling in within transformation - Fixed effects model

I have been studying fixed effects models recently and I am stuck at within transformation. According to my understanding the dependent and independent variables are demeaned wrt clusters and ...
Ajeeth kumar's user avatar
8 votes
3 answers
2k views

Can robust standard errors be less than those from normal OLS?

I'm reading about Robust Standard Error Estimators for Panel Models from the developer of plm R package (Millo, 2017: 21). But my question is not about software. In ...
garej's user avatar
  • 359
1 vote
1 answer
2k views

Forecasting with panel data/ time series

I have three questions for you regarding the prediction of panel data. There is a function predict.plm() in the plm package for <...
ranicki's user avatar
  • 11
1 vote
1 answer
481 views

Identical OLS and Random Effect Model; Why is my theta/individual effect variance zero?

I have a panel data set with companies and some variables expressed as changes year-to-year from 2017-2018 (2018) to 2020-2021 (2021). I am trying to estimate a regression estimating the effect of all ...
Jonas Esterer's user avatar
0 votes
0 answers
539 views

R: Heteroskedasticity and Autocorrelation Consistent Covariance Matrix Estimator for panel linear model with fixed effects

Is there a way for generating Heteroskedasticity- and autocorrelation-consistent (HAC) standard errors for panel linear model with two fixed effects? I came across ...
Shunrei's user avatar
  • 31
0 votes
1 answer
332 views

How to perform a random-effects model to include more than one category?

Sample Panel Data Year Firm_ID Region Industry ROE ROA Tobin_Q ESG Leverage Age Size 2012 1 Asia/Pacific Rim Oil_and_Gas_Refining_and_Marketing 12.19 6.22 1.17 51.24 1.45 1.58 6.51 2013 1 Asia/...
user avatar
1 vote
0 answers
287 views

Robust standard errors for poisson/negbin panel data estimators

I am trying to calculate robust and clustered standard errors for Poisson and Negative Binomial panel data estimators. I am using 'pglm' package. Ideally, I would be able to use the ...
YouLocalRUser's user avatar
0 votes
1 answer
430 views

Is the within estimator from plm() estimated by Ordinary Least Squares (OLS)?

I have a panel data set with `N = 17 Spanish regions and T = 32 years. I performed some models like this one with the plm() function and the within estimator for individual fixed effects: ...
user avatar
5 votes
1 answer
4k views

Is it ok to run a plm fixed effect model and add a factor dummy variable in R?

Is it ok to run a "plm" fixed effect model and add a factor dummy variable in R as below? The three factors "Time", "Firm” and "Country" are all separate indices ...
Eric's user avatar
  • 506
0 votes
0 answers
173 views

fixed effect model (plm) - looking at age effects

I'm examining the link between age and an outcome in an unbalanced panel data (each individual responded to the survey 1 to 8 times) I'm estimating the following fixed effects model: ...
llbia's user avatar
  • 361
1 vote
1 answer
731 views

Why do fixed effect and dummy variable models differ?

Year as a dummy ( 1995 is the omitted year): ...
user17073706's user avatar
0 votes
1 answer
436 views

What tests effectively compare a random effects model and a fixed effects model in R?

I am looking for a way to compare two models (I am not very good at R or statistics). The only difference between the two is that one has fixed effects and the other has random effects. Let me know ...
user17073706's user avatar
0 votes
0 answers
117 views

Panel dataset with not consistent categorical variables across time - mapping

I am looking for any resources (journals papers, books, ...) which are connected with handling not consistent categorical variables across time in a panel dataset. Might you already hear about this ...
polkas's user avatar
  • 93
0 votes
0 answers
474 views

Data structure issue with plm: multiple observations with the same year-country pair

I am trying to run fixed effects and random effects regressions on data which is not pure panel data but rather independent cross-sections over several years. In addition, the yearly cross-sections ...
Moz's user avatar
  • 1
0 votes
1 answer
682 views

Understanding fixef() output of fixed effects coefficients

I have a panel data set with several ID's and each has a certain number of year observations. When I fit a fixed effects ...
codemachino's user avatar
0 votes
0 answers
487 views

Panel Data Regression, ADF Stationarity Test in R

I am conducting a fixed effects regression with balanced quarterly paneldata. plm(MOD.WITHIN, data=pdata, model = "within", effect= "individual")...
Leeo4123's user avatar
4 votes
1 answer
4k views

Finding intercept term in fixed effects model [closed]

I am using the plm() function in R with a fixed effects model: ...
codemachino's user avatar
1 vote
1 answer
2k views

Fixed effects model with dummy variables [closed]

I have to set up a regression analysis of panel data with a dummy variable (1 or 0) and fixed effects (for example time). Could someone help me how to do this in R? For now, I have set the dataset as ...
RNoob's user avatar
  • 13
0 votes
1 answer
349 views

Panel regression without predictors in R

I want to run a plm regression model without predictors (i.e. a regression model on the intercept). When I run a fixed effects model (...
codemachino's user avatar
1 vote
0 answers
159 views

Can't seem to replicate the Hausman test statistic without the phtest() function in R

I am trying to replicate the results of a Hausman test (random vs. fixed effects) in R without the function phtest. This works just fine with the help of the ...
Econ.stats's user avatar
1 vote
0 answers
878 views

In R, Fixed effects regression model drops time invariant variables, is random effects model equally good instead?

I have unbalanced panel data and want to fit a regression model with the degree of internationalization of a firm as dependent variable, measured in the ratio to foreign sales to total sales (fsts). ...
Rebekka's user avatar
  • 11
1 vote
0 answers
86 views

Retrieve random effects from an instrumented RE model

I am writing my term paper and I feel a demand to retrieve the individual effects from a Random Effects Instrumented Model (due to the usage of lags of regressors as the instruments, the panel is ...
Kornôg's user avatar
  • 11
2 votes
2 answers
267 views

Baltagi Table 8.1 Replication with plm

I saw this previous post from 2017 that talks about the same table but only focuses on OLS. I'm also working on replicating Table 8.1 in Baltagi's Economic Analysis of Panel data book. I can ...
Tony's user avatar
  • 23
1 vote
1 answer
2k views

R: difference in interpreting estimates of plm and LSDV model?

What is the difference in the estimates of plm and least squares dummy variable (LSDV) models? And how does the interpretation of the variables differ in general? Imagine the following ...
mag123's user avatar
  • 13
0 votes
0 answers
147 views

R: Panel unit root test with unbalanced data due to late entry into the sample

I would like to conduct a panel unit root test on the price constituents of the Dow Jones Industrial Index, which is composed of 30 stocks. The index spans 20 years, and stocks drop out of the index ...
finstats's user avatar
  • 293
1 vote
0 answers
418 views

Interpreting results of panel granger test

I ran the Panel Granger Causality test from the plm package and I'm unsure how to interpret the results. I don't know what "Ztilde" represents, and I'm not sure if the p-value represents the ...
Achintya Agarwal's user avatar
0 votes
1 answer
594 views

Aliased coefficients in panelgranger with just one variable

I'm running the pgrangertest package from plm, and getting the following error: ...
Achintya Agarwal's user avatar
2 votes
2 answers
8k views

plm "empty model" error - how to correct panel data?

After days of searching for an answer to my problem, reading guide documents, questions and answers here and elsewhere, I decided to ask this community. I am new to R (and R Studio), coming from ...
PPBarbos's user avatar
0 votes
1 answer
1k views

plm function in R: Order of input for index changes results when model = within?

I am only slightly familiar with the plm() function in R, and I get this odd phenomenon. When my input is this: ...
laurenstrie's user avatar
0 votes
0 answers
20 views

How to choose the within factor in Fixed effect model

I am doing a fixed effect model to research on support’s effect on reducing number of injured employees. I have a dataset on company level from 2012-2020: year average age total salary total number ...
Ltng's user avatar
  • 21
2 votes
0 answers
234 views

What are the standard panel data model selections and steps?

I have got a panel data in R ...
Ltng's user avatar
  • 21
3 votes
1 answer
4k views

How to interpret pFtest?

Let's consider documentation of pFtest : https://www.rdocumentation.org/packages/plm/versions/2.2-5/topics/pFtest. I don't know where can I find desciption of this test - where can I find $H_0$, $H_1$....
John's user avatar
  • 532
0 votes
0 answers
443 views

Panel Data in R - Can I implement a plm regression with categorical data?

I am working (In R) on a panel modelling of an econometric problem. I have : one dependent variable : Y with values in real positive numbers two explanatory variables : VAR_1 (real positive), VAR_2 (...
Raphael's user avatar