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
-1
votes
2 answers

Best technique to convert to panel data

I have some returns data on 1000+ firms that I want to convert into panel form. From my understanding, it is neither truly wide nor long form (at least from the examples I've seen). I have attached an example of the original data set and what I want…
elbarto
  • 211
  • 3
  • 15
-1
votes
1 answer

R:repeating aggregate values for daily values in a panel setting

I have a data frame that has aggregate data over every 5 days(called a week in the dataset). > dput(Sample3) structure(list(Firm = c("ENG", "ENG", "ENG", "ENG", "ENG", "AUS", "AUS", "AUS", "AUS", "AUS", "NZ", "NZ", "NZ", "NZ", "NZ"), Week =…
Polar Bear
  • 731
  • 1
  • 7
  • 21
-1
votes
1 answer

Converting daily stock returns to annual returns using a panel data set in R

I have a panel data set in R with daily stock returns. The data looks like: company code company name date daily return 1 A 1990-09-01 0.1 1 A 1990-09-02 0.05 …
Nan
  • 1
  • 2
-1
votes
1 answer

How to export Stata xtcsd test results?

I would like to export results of cross section dependence tests for 12 panel data sets to a table in order to compare them with similar tests done with different software. Below is the regression and test instruction example from the xtcsd help…
Paul Rougieux
  • 10,289
  • 4
  • 68
  • 110
-1
votes
1 answer

R: Insert missing dates in longitudinal data without losing information

I have a longitudinal dataset in a data table, similar to the simplified example below: > head(data) Country ID Date Value 1: AT AT6306 2012-11-01 16.2 2: AT AT6306 2012-11-02 12.2 3: AT …
altabq
  • 1,322
  • 1
  • 20
  • 33
-2
votes
1 answer

change of unit of analysis for panel data in R

I looking at foreign powers intervening into civil wars using R studio. My first dataset unit of analysis is conflict year while the second one is conflict month. I would need to have both of them in conflict years so I can merge them. Is there any…
-2
votes
2 answers

Aggregating count data

I have a dataset (test_data) on civil conflicts between 1989-2016. The unit of analysis is _DyadID_, which is the unique identifier for each pair of actors involved in civil conflict in this time period. The dataset also includes _SideA_ and _SideB_…
Lee Tagziria
  • 53
  • 2
  • 10
-2
votes
1 answer

How to replace NA with latest value in unbalanced panel?

I would like to replace NA with previous value in an unbalanced panel data (long format). Before replace, the data would look like Firm Date Var_1 AAA 19990430 NA AAA 19990531 10 AAA 19990630 NA AAA 19990731 …
Dylan
  • 51
  • 1
  • 4
-2
votes
1 answer

compute absolute distance/weighted moving average. Stata or R

I want to capture in a variable (called “absolutedistance”) the absolute value of the distance of a numeric variable (called “v1”) between a given subject (identified with var “id”; total 50 subjects) in a given year (identified with var “duration”;…
vic_tor
  • 1
  • 3
-2
votes
1 answer

how to collapse 2 variables by dummies in panel data

I have to collapse some variable of my dataset but I’m getting issues. Basically, there are 2 variables valor_receita_propria (in English is own_revenue_value) qt_tec_total (or total_tec_qt, the numberof technicians in a institution). There…
-2
votes
1 answer

PLM package in R

This is a trivial question; but, I'm new to R; and, none of the tutorials I've seen address it. When using the PLM package in R for my panel data, do I include the cross sectional units, the individuals' variable, in my regression formula? While…
user110059
-2
votes
1 answer

Using variables from different years to create a model

Is there a way to do the following Stata code in R? I want to create a staggered model, and I want to use the values of certain variables for 1994 for people who turned 40 in 1998; and want to use the values of the same variables for 1996 for people…
Aslı Gürer
  • 39
  • 1
  • 9
-3
votes
1 answer

Heteroscedasticity Test for Random Effects Model

I'm running a random effects model using the plm package and now I need to test for the presence of heteroscedasticity, but I'm not sure how to process it in the mentioned package. My model: random <- plm(Y ~ X, data=panel_data, model= "random",…
phill
  • 95
  • 2
  • 10
-4
votes
2 answers

Panel data or time-series data and xt regression

Need help observing simple regression as well as xt-regression for panel data. The dataset consists of 16 participants in which daily observations were made. I would like to observe the difference between pre-test (from the first date on which…
lei10003
  • 5
  • 2
1 2 3
56
57