0

I have a panel dataset with a 'Company Name - Country - Year' structure. The variables are financial attributes for listed companies (say, y, x1, x2 x3 etc.) located in different countries. There are 4 countries involved and the dataset spans 10 years (2011 to 2020). The number of companies for which data is available differs across the 4 countries.

Following is a snapshot of the dataset.

Company Country Year D/E TDTA LTDTA STDTA Liquid ratio Profitability Size P/E Surplus
ALICON CASTALLOY LTD India 2011 128.3589 0.371844392 0.155361798 0.216482594 0.626872695 0.143452963 21.88224644 3.6629 0.191703899
ALICON CASTALLOY LTD India 2012 145.8856 0.361449015 0.075690176 0.285758839 0.632109096 0.121955491 22.26809975 4.6148 0.189898385
ALICON CASTALLOY LTD India 2013 114.6795 0.32939055 0.016479674 0.312910876 0.597648987 0.110514887 22.38078659 3.6636 0.161800789
ALICON CASTALLOY LTD India 2014 107.9006 0.318235519 0.032506572 0.285728947 0.622053575 0.11292846 22.39569031 4.8393 0.097195415
ALICON CASTALLOY LTD India 2015 134.124 0.360167667 0.077957692 0.282209976 0.64851083 0.116692366 22.68836349 15.4823 0.284340355
ALICON CASTALLOY LTD India 2016 138.4348 0.380129133 0.098677129 0.281452005 0.632704362 0.132214242 22.73671382 14.3018 0.261805373
ALICON CASTALLOY LTD India 2017 153.7061 0.386036785 0.121818896 0.264217889 0.685974099 0.128421822 22.76660861 22.4139 0.114658603
ALICON CASTALLOY LTD India 2018 106.3272 0.310354903 0.087852251 0.222502653 0.821700135 0.123780884 23.03925264 19.6087 0.091544136
ALICON CASTALLOY LTD India 2019 91.0259 0.320969758 0.0801801 0.240789659 0.801445692 0.149648519 23.19887655 14.9046 0.190002201
ALICON CASTALLOY LTD India 2020 106.5843 0.372381221 0.135538078 0.236843143 0.891019668 0.096605765 22.98210092 14.1902 0.099609827
AMARA RAJA BATTERIES LTD India 2011 13.9508 0.080751313 0.06281992 0.017931393 1.213515068 0.202486795 23.59240034 10.9429 0.139951793
AMARA RAJA BATTERIES LTD India 2012 10.21 0.062208615 0.058062164 0.004146452 1.629492248 0.222471791 23.88640399 11.6376 0.285242442

I want to perform a simple panel data analysis of the kind y ~ x1 + x2 + x3 using the plm package in R. Because of the 3-way structure I ran into difficulties so (as advised in Fixed Effects plm package R - multiple observations per year/id) I created a separate id for each company-country pair using dlpyr:

library(dplyr)
F1$id <- group_indices(F1, Company, Country)

where F1 is my input dataframe.

Now, when I run

library(plm)
formula = D_E ~ Liquidity_Ratio + Surplus 
plm.reg <- plm(formula, data = F1, index = c("id", "Year"), model = "between")
summary(plm.reg)

I am unable to understand the results (for eg. the summary is a long list of coeffs)

Call:
plm(formula = formula, data = F1, model = "between", index = c("id", 
    "Year"))

Unbalanced Panel: n = 552, T = 1-11, N = 3510
Observations used in estimation: 552

Residuals:
ALL 552 residuals are 0: no residual degrees of freedom!

Coefficients: (2959 dropped because of singularities)
                            Estimate Std. Error t-value Pr(>|t|)
(Intercept)                   0.1791        NaN     NaN      NaN
Liquidity_Ratio0.00450533    -0.1791        NaN     NaN      NaN
Liquidity_Ratio0.045110358   -0.7164        NaN     NaN      NaN
Liquidity_Ratio0.16995834   924.9422        NaN     NaN      NaN
Liquidity_Ratio0.172856618  376.0109        NaN     NaN      NaN
Liquidity_Ratio0.187658552  965.6439        NaN     NaN      NaN

and so on ending with

Liquidity_Ratio4.598641438   11.2690        NaN     NaN      NaN
Liquidity_Ratio4.856558476   -0.5373        NaN     NaN      NaN
Liquidity_Ratio5.593391052    7.4484        NaN     NaN      NaN
Liquidity_Ratio8.9001985      1.9260        NaN     NaN      Na
Total Sum of Squares:    3957000
Residual Sum of Squares: 0
R-Squared:      1
Adj. R-Squared: NaN
F-statistic: NaN on 551 and 0 DF, p-value: NA

I am new to panel data analysis and need to find out where I am going wrong.

  • 1
    This has nothing to do with the actual model specificiation, but it looks like `Liquidity_Ratio` is being treated as categorical rather than numeric variable leading to many many dummy variables/parameters. Try to convert `Liquidty_Ratio` to numeric with `as.numeric()` if it's a character variable or `as.numeric(levels(Liquidity_Ratio)[Liquidity_Ratio])` if it's a factor – rps1227 Jul 06 '23 at 07:12
  • @rps1227 This works. – user11254108 Jul 11 '23 at 08:58

0 Answers0