Questions tagged [plm]
The `plm` package for R provides functions for linear models for panel data.
135
questions
0
votes
0
answers
18
views
Plotting model output (PLM command for panel data regression) in R - how can I adjust the legend? [closed]
I plot my fixed effects model output and I want to adjust the legend in the plot because it doesn't show the group colors.
My code is as follows:
...
1
vote
0
answers
38
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 ...
0
votes
0
answers
24
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 ...
0
votes
0
answers
54
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 ...
0
votes
0
answers
50
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:
...
0
votes
0
answers
51
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 ...
0
votes
0
answers
54
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 ...
0
votes
0
answers
20
views
Estimation of panel data
I am estimating the effect of certain bank characteristics on the bank lending in monetary policy in the euro area. Therefore I am looking at different bank characteristics (size, liquidity and ...
1
vote
1
answer
121
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 ...
1
vote
0
answers
73
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 ...
0
votes
0
answers
52
views
How do I estimate the effect of a time shock in panel data?
So I have data on various countries, at various time points and there are 3 "shocks" that occur. I am interested in estimating the effect of the shocks. There are no other variables I am ...
1
vote
1
answer
688
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) ...
0
votes
1
answer
53
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 ...
8
votes
3
answers
970
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 ...
0
votes
1
answer
1k
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 <...
1
vote
1
answer
375
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 ...
0
votes
0
answers
376
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 ...
0
votes
1
answer
270
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/...
1
vote
0
answers
220
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 ...
0
votes
1
answer
339
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:
...
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 ...
0
votes
0
answers
160
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:
...
1
vote
1
answer
588
views
Why do fixed effect and dummy variable models differ?
Year as a dummy ( 1995 is the omitted year):
...
0
votes
1
answer
363
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 ...
0
votes
0
answers
115
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 ...
0
votes
0
answers
382
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 ...
0
votes
1
answer
577
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 ...
0
votes
0
answers
444
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")...
3
votes
1
answer
3k
views
Finding intercept term in fixed effects model [closed]
I am using the plm() function in R with a fixed effects model:
...
0
votes
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 ...
0
votes
1
answer
288
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 (...
1
vote
0
answers
138
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 ...
1
vote
0
answers
737
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). ...
1
vote
0
answers
85
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 ...
2
votes
2
answers
249
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 ...
1
vote
1
answer
1k
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 ...
0
votes
0
answers
127
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 ...
1
vote
0
answers
375
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 ...
0
votes
1
answer
514
views
Aliased coefficients in panelgranger with just one variable
I'm running the pgrangertest package from plm, and getting the following error:
...
2
votes
2
answers
7k
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 ...
0
votes
1
answer
874
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:
...
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 ...
2
votes
0
answers
216
views
What are the standard panel data model selections and steps?
I have got a panel data in R
...
2
votes
1
answer
3k
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$....
0
votes
0
answers
430
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 (...
4
votes
0
answers
2k
views
R plm cluster robust standard errors with multiple imputations
I am looking for a way to implement (country) clustered standard errors on a panel regression with individual fixed effects. That is, in plm() I want to define some ...
2
votes
3
answers
936
views
When to use instrumental variables in a panel regression R
I'm doing panel regression analysis using plm package.
I would like to know if there is a way to understand when it's necessary to use instrumental variables. Are ...
2
votes
0
answers
318
views
Dealing with plm for panel regression models [closed]
I'm dealing with panel data to study how macroeconomics indicators influence life insurance market with R-studio, but I'm not very familiar with panel regression, in particular with diagnostic tests ...
5
votes
1
answer
2k
views
Random Effects Results in R (plm) Cannot Replicate Results in Stata
I have been working on migrating a current project from Stata to R, where I have encountered difficulties with differing results of random effects regressions.
I have panel data from an experiment ...
1
vote
0
answers
168
views
Robustness checks for fixed effects model
So I'm estimating a fixed effects model using plm that looks at the effects of immigrants on house prices in different districts over several years. And I was ...