Questions tagged [panel-data]

A multidimensional dataset usually describing measurements over time for a specific cohort.

Panel data is a dataset that is focused, multivariate longitudinal data for a set of cross-sectional units such as a family or an individual. Many statistical analysis libraries require the data to be formatted in a certain manner.

854 questions
0
votes
1 answer

How to do panel data analysis in Bayesian model with pymc

everyone. I have a question on how to do panel data analysis in Bayesian model with pymc. The data is like: .......................................................... User Time x1 x2 x3 Y 1 1 1 …
Runner
  • 1
  • 2
0
votes
1 answer

Lag unbalanced panel dataset in Matlab

I have an unbalanced panel dataset in Matlab that I need to lag. Unbalanced panel datasets are quite easu to work with in R with the plm package. Is there a similar functionality in Matlab? Here is a toy example: A =…
Mace
  • 1,259
  • 4
  • 16
  • 35
0
votes
0 answers

Imputation using related data (R)

I have a panel dataset with population data. I am working mostly with two vectors - population and households. The household vector(there are 3 countries) has a substantial amount of missing values, the population vector is full. I use a model with…
0
votes
1 answer

Winsorizing Panel Data (dataframe) by year and Trimming for certain conditions

I'm trying to winsorize (replacing outliers with values that are 2 or 3 standard deviations away from the mean) on panel data and for each year. I installed the robustHD package which includes such a function, however I'm unable to implement it on…
Gritti
  • 85
  • 3
  • 11
0
votes
1 answer

PLM in R with time invariant variable

I am trying to analyze a panel data which includes observations for each US state collected across 45 years. I have two predictor variables that vary across time (A,B) and one that does not vary (C). I am especially interested in knowing the effect…
0
votes
1 answer

Inserting date multiple times from another data frame in panel data in R

I have a set of panel data that I need to insert the date from another data frame. allweeks <- seq(as.Date("2013-01-05"), as.Date("2013-12-28"), by="1 week") Above is the data for the date. Below is my data set runs from…
Jimmy
  • 59
  • 7
0
votes
0 answers

lmeNB Package: syntax problems

I just learnt of the existence of the lmeNB package and given that I have positive count data data with overdispersion, it seemed right up my sleeve. However, I cannot get it to work. The syntax of the package is found here I am trying to run a…
SJDS
  • 1,239
  • 1
  • 16
  • 31
0
votes
0 answers

R How to plot a "net interaction effect" (or marginal effect) when there are 'confounding' interactions

I want to draw the interaction effects between x1 and x2 for the following regression (let y be a positive count variable in a panel dataset) library(lme4) glmer.repex<-glmer.nb(y ~ x1 + x2 +I(x2^2) + x1:x2 +x1:I(x2^2) + (1|Year), data=repex, nAGQ =…
SJDS
  • 1,239
  • 1
  • 16
  • 31
0
votes
1 answer

Pad fitted values of PLM model with NAs

I have the following dataset seed(1) dt <- data.frame(name= rep(c("A", "B", "C"), c(9,11,10)), year=c(2001:2009,2000,2002:2011,2001:2010), var1=c(NA,rnorm(10),NA,rnorm(18)), …
Mace
  • 1,259
  • 4
  • 16
  • 35
0
votes
1 answer

create sequence of numbers from time dependent panel data

so i have a data set where i have years students were in classes, and what quarter of the year they were in, so 2002 is 4 times and it has quarter 1,2,3,4, like…
JPK
  • 39
  • 6
0
votes
1 answer

How to merge data to form a panel?

I have two data frames. Data frame "weather" looks like this: weather<-data.frame(Date=c("2012-04-01","2012-04-02","2012-04-03","2012-04-04"),Day=c("Sunday","Monday","Tuesday","Wednesday"), Temp=c(86,89,81,80)) Date Day Temperature …
Animesh
  • 43
  • 1
  • 6
0
votes
0 answers

procedurally convert interval data to cross sectional data

I'm working on a project where I have a database of events with a start and end time stamp. I want to work with the data as cross section data. The naive solution is to iterate over every quantum of time since epoch and check it against each…
CodeOcelot
  • 3,403
  • 3
  • 22
  • 23
0
votes
1 answer

turning biographical data into panel data

I have biographical data of more than 1600 people. The data includes their gender, birth year, hometowns, etc., as well as their career trajectories from the year they begun their work. I'm trying to turn this into a panel data, so that I have a…
halo09876
  • 2,725
  • 12
  • 51
  • 71
0
votes
1 answer

Generating interaction terms manually

I am trying to estimate a fixed effects panel with individual-specific time trends using plm and am running up against the same problem as other people. I'm more than willing to use the workaround described in the linked CrossValidated question but…
RoyalTS
  • 9,545
  • 12
  • 60
  • 101
-1
votes
1 answer

Error when doing Panel VAR (panelvar package) in R

I tried to run a panel var on dataset I got from Statistics Sweden and here is what I get: df<- read_excel("Inkfördelning per kommun.xlsx") nujavlar <- pvarfeols(dependent_vars = c("Kvintil-1", "Kvintil-4", "Kvintil-5"), lags = 1, transformation =…