R package primarily concerned with panel data. Package contains a set of estimators and tests for panel data.
Questions tagged [plm]
510 questions
1
vote
0 answers
How to I do a plm regression for categorical regression (panel data)?
I'm wondering if I can use categorical dependent variables in a panel data regression?
Currently I'm using plm for continuous or clogit for binary dependent variables, e.g.
model_income <- plm(income ~ education + age + children, data = incomedata,…

GreenPirate
- 37
- 8
1
vote
0 answers
plm panel regression error with duplicate id/time observations
I need to run a regression on a panel data. My data looks at prices of hotel room plans for two distinct observation points (a high season date and low season date).
I have this data (fyi this is a simplified data for the question, my actual…

ink.paper.pen
- 11
- 3
1
vote
1 answer
Panel data with multiindex
I would like to ask how to work with a panel data, or how to tranfort dataset so it can be then modeled as panel data, when it has multiindex?
library(tibble)
library(plm)
library(fastDummies)
dataset <- tribble(
~country, ~year, ~sex, ~age,…

Petr
- 1,606
- 2
- 14
- 39
1
vote
1 answer
how to include industry fixed effects in a panel linear model (plm) based on industry codes in R
Period:
2005 until 2011
Independent variable (is constant over the whole period):
famfirm05 = dummy (equals 1 if family owns >= 5% of the company)
Dependent variable:
Return on assets
Industry fixed effects:
Based on industry codes sic
gvkey =…

Yaron Nolan
- 153
- 1
- 1
- 8
1
vote
0 answers
Error : replacement has x rows, data has y
I am running this R script from Java (I am using Renjin):
getCoefficients <- function(x, y, Regions) {
nbRegions <- length(Regions)
lengthY <- length(y)
colRegions <- NULL
from <- 1
to <- lengthY / nbRegions
for (i in 1:nbRegions) {
…

AMAY
- 67
- 1
- 7
1
vote
1 answer
undefined columns selected in plm() function
I had a weird problem in plm() function. Below is the code:
library(data.table)
library(tidyverse)
library(plm)
#Data Generation
n <- 500
set.seed(75080)
z <- rnorm(n)
w <- rnorm(n)
x <- 5*z + 50
y <- -100*z+ 1100 + 50*w
y <-…

Steve
- 183
- 1
- 2
- 10
1
vote
1 answer
How to calculate robust standard errors in stargazer for plm (pooling) model in R?
I have several regression models using plm and pooling. My data is a pooled cross sectional / time series data, with data on bond issuances. The data consists of observations of around 2000 bond issuances, with around 25 bond-descriptive variables.…

kakaka
- 21
- 1
- 3
1
vote
1 answer
Estimating within-between model specification using plm
Is it possible to include one time-invariant variable in a two-way fixed effects model in plm?
Model set up:
`m3 <- plm(habi5 ~ habi1 + habi3 + econ1 + gov1 + gov2 + gov3 + gov4 + soci1 + soci3 + soci4,
data = merge3,
…

Hamson
- 13
- 1
- 7
1
vote
0 answers
plm() with maximum likelihood estimation?
I would like to estimate a panel data model with instrumental variables using maximum likelihood estimation. Is this possible in R?
With the plm() function from the plm package, I can instrument for endogenous variables in a panel data model with…

Tim Welsh
- 15
- 3
1
vote
1 answer
Why does plm::pvcm's summary function give quantiles of coefficients for model = "within"?
I am estimating a variable coefficient model with time effect via function pvcm from package plm. I am using a within estimator. Unfortunately, I have difficulties with using the summary command. It does not provide me usual output with standard…

Olena
- 11
- 2
1
vote
1 answer
Removing a custom (second) class from a dataset/variable
I have been using a class from the hmisc package called haven_labelled (or sometimes just labelled). It purpose is to import the column labels from a Stata .dta dataset. When trying to use plm on a dataframe I got the error:
Error in…

Tom
- 2,173
- 1
- 17
- 44
1
vote
1 answer
What is the best way in R to plot predicted values and compare interaction terms in a random effects plm model?
I have a plm random effects model that includes an interaction between a continuous and a categorical variable (for illustrative purposes, let's say the categorical variable is strong religiosity and the continuous is contribution to charity).
Here…

user3385922
- 179
- 1
- 1
- 9
1
vote
3 answers
Fama Macbeth Regression in R pmg
In the past few days I have been trying to find how to do Fama Macbeth regressions in R. It is advised to use the plm package with pmg, however every attempt I do returns me that I have an insufficient number of time periods.
My Dataset consists of…

Bart
- 317
- 4
- 18
1
vote
0 answers
Estimate robust standard errors for a Hausman-Taylor regression using plm()
I can estimate robust standard errors for a FE model using plm(), but not for a Hausman-Taylor (HT). I need the HT estimator to include in my model some time invariant variables, which reflect initial conditions. See below an example using the Cigar…

et_
- 179
- 8
1
vote
0 answers
Unable to download rstudio addin (plm)
Basically I would like to download this addin but every time I get the same error message.
install.packages("plm") also installing the dependency ‘Rdpack’
There are binary versions available but the source versions are later:
binary…

Ahmed Badran
- 11
- 1