df <- read.csv('C:/Users/Asus/OneDrive/Рабочий стол/Итог_2.csv', sep = ';')
df$Cluster <- as.factor(df$Cluster)

tab_corr(df[ , c(10, 11, 12, 13, 14, 15 )], corr.method = "spearman")
  Rang ln_cap ln_rev ln_lab ln_vrp ln_inv
Rang   -0.241*** -0.373*** -0.335*** 0.051 -0.439***
ln_cap -0.241***   0.810*** 0.744*** 0.050 0.135***
ln_rev -0.373*** 0.810***   0.855*** 0.044 0.200***
ln_lab -0.335*** 0.744*** 0.855***   -0.028 0.130***
ln_vrp 0.051 0.050 0.044 -0.028   0.664***
ln_inv -0.439*** 0.135*** 0.200*** 0.130*** 0.664***  
Computed correlation used spearman-method with listwise-deletion.
corr_mat <- round(cor(df[ , c(10, 11, 12, 13, 14, 15 )], method = "spearman"), 2)
corrplot(corr_mat, method = 'number', tl.col = "black",
         cl.ratio = 0.2, tl.srt = 45, col = COL2('PuOr', 10))

M1 <- plm(ln_rev ~ ln_lab + ln_cap + Rang + ln_inv + ln_vrp, df, model = "pooling")
## Warning in pdata.frame(data, index = index, ...): duplicate couples (id-time) in resulting pdata.frame
##  to find out which, use, e.g., table(index(your_pdataframe), useNA = "ifany")
tab_model(M1)
  ln rev
Predictors Estimates CI p
(Intercept) 5.28 1.83 – 8.74 0.003
ln lab 0.76 0.72 – 0.81 <0.001
ln cap 0.27 0.24 – 0.30 <0.001
Rang -0.01 -0.02 – -0.01 <0.001
ln inv -0.29 -0.80 – 0.21 0.255
ln vrp 0.76 0.27 – 1.25 0.003
Observations 1392
R2 / R2 adjusted 0.794 / 0.793
summary(M1)
## Pooling Model
## 
## Call:
## plm(formula = ln_rev ~ ln_lab + ln_cap + Rang + ln_inv + ln_vrp, 
##     data = df, model = "pooling")
## 
## Unbalanced Panel: n = 348, T = 4-4, N = 1392
## 
## Residuals:
##      Min.   1st Qu.    Median   3rd Qu.      Max. 
## -6.014992 -0.720341 -0.086666  0.633278  5.230226 
## 
## Coefficients:
##               Estimate Std. Error t-value  Pr(>|t|)    
## (Intercept)  5.2848000  1.7601279  3.0025  0.002726 ** 
## ln_lab       0.7620624  0.0233637 32.6174 < 2.2e-16 ***
## ln_cap       0.2698373  0.0134507 20.0613 < 2.2e-16 ***
## Rang        -0.0128339  0.0021419 -5.9919 2.641e-09 ***
## ln_inv      -0.2933609  0.2577948 -1.1380  0.255333    
## ln_vrp       0.7596887  0.2510426  3.0261  0.002523 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    9436.5
## Residual Sum of Squares: 1942.6
## R-Squared:      0.79413
## Adj. R-Squared: 0.79339
## F-statistic: 1069.31 on 5 and 1386 DF, p-value: < 2.22e-16
M2 <- plm(ln_rev ~ ln_lab+ ln_cap + Rang + ln_inv + ln_vrp, df, model = "pooling")
## Warning in pdata.frame(data, index = index, ...): duplicate couples (id-time) in resulting pdata.frame
##  to find out which, use, e.g., table(index(your_pdataframe), useNA = "ifany")
tab_model(M2)
  ln rev
Predictors Estimates CI p
(Intercept) 5.28 1.83 – 8.74 0.003
ln lab 0.76 0.72 – 0.81 <0.001
ln cap 0.27 0.24 – 0.30 <0.001
Rang -0.01 -0.02 – -0.01 <0.001
ln inv -0.29 -0.80 – 0.21 0.255
ln vrp 0.76 0.27 – 1.25 0.003
Observations 1392
R2 / R2 adjusted 0.794 / 0.793
summary(M2)
## Pooling Model
## 
## Call:
## plm(formula = ln_rev ~ ln_lab + ln_cap + Rang + ln_inv + ln_vrp, 
##     data = df, model = "pooling")
## 
## Unbalanced Panel: n = 348, T = 4-4, N = 1392
## 
## Residuals:
##      Min.   1st Qu.    Median   3rd Qu.      Max. 
## -6.014992 -0.720341 -0.086666  0.633278  5.230226 
## 
## Coefficients:
##               Estimate Std. Error t-value  Pr(>|t|)    
## (Intercept)  5.2848000  1.7601279  3.0025  0.002726 ** 
## ln_lab       0.7620624  0.0233637 32.6174 < 2.2e-16 ***
## ln_cap       0.2698373  0.0134507 20.0613 < 2.2e-16 ***
## Rang        -0.0128339  0.0021419 -5.9919 2.641e-09 ***
## ln_inv      -0.2933609  0.2577948 -1.1380  0.255333    
## ln_vrp       0.7596887  0.2510426  3.0261  0.002523 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    9436.5
## Residual Sum of Squares: 1942.6
## R-Squared:      0.79413
## Adj. R-Squared: 0.79339
## F-statistic: 1069.31 on 5 and 1386 DF, p-value: < 2.22e-16
tab_model(lm(ln_rev ~ (ln_lab + ln_cap + Rang + ln_inv + ln_vrp)*Cluster, df))
  ln rev
Predictors Estimates CI p
(Intercept) 6.04 0.11 – 11.97 0.046
ln lab 0.86 0.78 – 0.93 <0.001
ln cap 0.30 0.25 – 0.34 <0.001
Rang -0.01 -0.02 – -0.00 0.024
ln inv 0.29 -0.49 – 1.07 0.469
ln vrp 0.12 -0.54 – 0.79 0.718
Cluster [1] -10.99 -18.41 – -3.56 0.004
ln lab × Cluster [1] -0.22 -0.31 – -0.13 <0.001
ln cap × Cluster [1] -0.06 -0.11 – -0.01 0.032
Rang × Cluster [1] 0.02 0.01 – 0.04 <0.001
ln inv × Cluster [1] -0.35 -1.38 – 0.68 0.508
ln vrp × Cluster [1] 1.25 0.31 – 2.19 0.009
Observations 1392
R2 / R2 adjusted 0.813 / 0.812
tab_model(M1, M2)
  ln rev ln rev
Predictors Estimates CI p Estimates CI p
(Intercept) 5.28 1.83 – 8.74 0.003 5.28 1.83 – 8.74 0.003
ln lab 0.76 0.72 – 0.81 <0.001 0.76 0.72 – 0.81 <0.001
ln cap 0.27 0.24 – 0.30 <0.001 0.27 0.24 – 0.30 <0.001
Rang -0.01 -0.02 – -0.01 <0.001 -0.01 -0.02 – -0.01 <0.001
ln inv -0.29 -0.80 – 0.21 0.255 -0.29 -0.80 – 0.21 0.255
ln vrp 0.76 0.27 – 1.25 0.003 0.76 0.27 – 1.25 0.003
Observations 1392 1392
R2 / R2 adjusted 0.794 / 0.793 0.794 / 0.793
b <- plm(ln_rev ~ ln_lab + ln_cap + Rang + ln_inv + ln_vrp + Cluster, df, model = "random")
## Warning in pdata.frame(data, index = index, ...): duplicate couples (id-time) in resulting pdata.frame
##  to find out which, use, e.g., table(index(your_pdataframe), useNA = "ifany")
summary(b)
## Oneway (individual) effect Random Effect Model 
##    (Swamy-Arora's transformation)
## 
## Call:
## plm(formula = ln_rev ~ ln_lab + ln_cap + Rang + ln_inv + ln_vrp + 
##     Cluster, data = df, model = "random")
## 
## Unbalanced Panel: n = 348, T = 4-4, N = 1392
## 
## Effects:
##                  var std.dev share
## idiosyncratic 0.2663  0.5160 0.197
## individual    1.0847  1.0415 0.803
## theta:
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##  0.7595  0.7595  0.7595  0.7595  0.7595  0.7595 
## 
## Residuals:
##       Min.    1st Qu.     Median    3rd Qu.       Max. 
## -4.5285694 -0.2305911  0.0033076  0.2672087  2.8258057 
## 
## Coefficients:
##               Estimate Std. Error z-value  Pr(>|z|)    
## (Intercept)  4.2353247  1.4485712  2.9238  0.003458 ** 
## ln_lab       0.6483853  0.0297078 21.8255 < 2.2e-16 ***
## ln_cap       0.1966042  0.0131588 14.9409 < 2.2e-16 ***
## Rang         0.0033984  0.0034570  0.9830  0.325587    
## ln_inv      -0.0339248  0.1646271 -0.2061  0.836736    
## ln_vrp       0.6440594  0.1448221  4.4472 8.698e-06 ***
## Cluster1     1.0522486  0.1713881  6.1396 8.275e-10 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    885.92
## Residual Sum of Squares: 395.54
## R-Squared:      0.55353
## Adj. R-Squared: 0.5516
## Chisq: 1717.11 on 6 DF, p-value: < 2.22e-16
a <- plm(ln_rev ~ ln_lab + ln_cap + Rang + ln_inv + ln_vrp + Cluster, df, model = "within")
## Warning in pdata.frame(data, index = index, ...): duplicate couples (id-time) in resulting pdata.frame
##  to find out which, use, e.g., table(index(your_pdataframe), useNA = "ifany")
summary(a)
## Oneway (individual) effect Within Model
## 
## Call:
## plm(formula = ln_rev ~ ln_lab + ln_cap + Rang + ln_inv + ln_vrp + 
##     Cluster, data = df, model = "within")
## 
## Unbalanced Panel: n = 348, T = 4-4, N = 1392
## 
## Residuals:
##       Min.    1st Qu.     Median    3rd Qu.       Max. 
## -4.3405697 -0.1466563  0.0053268  0.1611811  2.7718635 
## 
## Coefficients:
##          Estimate Std. Error t-value  Pr(>|t|)    
## ln_lab  0.3697854  0.0432631  8.5474 < 2.2e-16 ***
## ln_cap  0.1490598  0.0146512 10.1739 < 2.2e-16 ***
## Rang    0.0121956  0.0057544  2.1194    0.0343 *  
## ln_inv -0.1002592  0.1854226 -0.5407    0.5888    
## ln_vrp  0.8386919  0.1682776  4.9840 7.294e-07 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    361.13
## Residual Sum of Squares: 276.67
## R-Squared:      0.23389
## Adj. R-Squared: -0.02566
## F-statistic: 63.4399 on 5 and 1039 DF, p-value: < 2.22e-16
feglm(ln_rev ~ ln_lab+ ln_cap + Rang + ln_inv + ln_vrp + Cluster, df, fixef_vars = "Cluster")
## Warning: In fixest_env(fml = fml, data = data, family = famil...:
##  feglm(fml = ln_...: fixef_vars is not a valid argument for function feglm()
## GLM estimation, family = gaussian, Dep. Var.: ln_rev
## Observations: 1,392
## Standard-errors: IID 
##              Estimate Std. Error   t value   Pr(>|t|)    
## (Intercept)  3.869444   1.760484  2.197944 2.8118e-02 *  
## ln_lab       0.737412   0.023530 31.339211  < 2.2e-16 ***
## ln_cap       0.263726   0.013365 19.732580  < 2.2e-16 ***
## Rang        -0.002239   0.002800 -0.799520 4.2413e-01    
## ln_inv      -0.131778   0.256872 -0.513010 6.0803e-01    
## ln_vrp       0.686761   0.248984  2.758253 5.8876e-03 ** 
## Cluster1     0.591398   0.102036  5.795982 8.3988e-09 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Log-Likelihood: -2,191.4   Adj. Pseudo R2: 0.335773
##            BIC:  4,433.5     Squared Cor.: 0.79903
tab_model(feglm(ln_rev ~ ln_lab+ ln_cap + Rang + ln_inv + ln_vrp + relevel(Cluster, ref = "1"), df))
  ln rev
Predictors Estimates CI p
(Intercept) 4.46 1.03 – 7.89 0.011
ln lab 0.74 0.69 – 0.78 <0.001
ln cap 0.26 0.24 – 0.29 <0.001
Rang -0.00 -0.01 – 0.00 0.424
ln inv -0.13 -0.64 – 0.37 0.608
ln vrp 0.69 0.20 – 1.18 0.006
relevel(Cluster, ref =
“1”)0
-0.59 -0.79 – -0.39 <0.001
Observations 1392
R2 / R2 adjusted 0.338 / 0.336
tab_model(feglm(ln_rev ~ ln_lab+ ln_cap + Rang + ln_inv + ln_vrp + Cluster, df))
  ln rev
Predictors Estimates CI p
(Intercept) 3.87 0.42 – 7.32 0.028
ln lab 0.74 0.69 – 0.78 <0.001
ln cap 0.26 0.24 – 0.29 <0.001
Rang -0.00 -0.01 – 0.00 0.424
ln inv -0.13 -0.64 – 0.37 0.608
ln vrp 0.69 0.20 – 1.18 0.006
Cluster [1] 0.59 0.39 – 0.79 <0.001
Observations 1392
R2 / R2 adjusted 0.338 / 0.336
phtest(a, b)
## 
##  Hausman Test
## 
## data:  ln_rev ~ ln_lab + ln_cap + Rang + ln_inv + ln_vrp + Cluster
## chisq = 111.76, df = 5, p-value < 2.2e-16
## alternative hypothesis: one model is inconsistent
zz <- plm(log(Revenue) ~ log(Capital) + log(Labor) + log(VRP) + log(Invest) + Cluster, data = df)
## Warning in pdata.frame(data, index = index, ...): duplicate couples (id-time) in resulting pdata.frame
##  to find out which, use, e.g., table(index(your_pdataframe), useNA = "ifany")
zzwith <- zz$within

zzra <- plm(log(Revenue) ~ log(Capital) + log(Labor) + log(VRP) + log(Invest) + Cluster, data = df, model = "random")
## Warning in pdata.frame(data, index = index, ...): duplicate couples (id-time) in resulting pdata.frame
##  to find out which, use, e.g., table(index(your_pdataframe), useNA = "ifany")
print(zzra)
## 
## Model Formula: log(Revenue) ~ log(Capital) + log(Labor) + log(VRP) + log(Invest) + 
##     Cluster
## 
## Coefficients:
##  (Intercept) log(Capital)   log(Labor)     log(VRP)  log(Invest)     Cluster1 
##     4.815862     0.197752     0.648535     0.615764    -0.037874     0.941960
print(summary(zzra))
## Oneway (individual) effect Random Effect Model 
##    (Swamy-Arora's transformation)
## 
## Call:
## plm(formula = log(Revenue) ~ log(Capital) + log(Labor) + log(VRP) + 
##     log(Invest) + Cluster, data = df, model = "random")
## 
## Unbalanced Panel: n = 348, T = 3-4, N = 1391
## 
## Effects:
##                  var std.dev share
## idiosyncratic 0.2672  0.5169 0.198
## individual    1.0830  1.0407 0.802
## theta:
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##  0.7244  0.7590  0.7590  0.7589  0.7590  0.7590 
## 
## Residuals:
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
## -4.5218 -0.2265  0.0027  0.0000  0.2689  2.8330 
## 
## Coefficients:
##               Estimate Std. Error z-value  Pr(>|z|)    
## (Intercept)   4.815862   1.351734  3.5627  0.000367 ***
## log(Capital)  0.197752   0.013118 15.0745 < 2.2e-16 ***
## log(Labor)    0.648535   0.029686 21.8462 < 2.2e-16 ***
## log(VRP)      0.615764   0.141518  4.3511 1.354e-05 ***
## log(Invest)  -0.037874   0.164787 -0.2298  0.818217    
## Cluster1      0.941960   0.130309  7.2287 4.877e-13 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    888.24
## Residual Sum of Squares: 395.95
## R-Squared:      0.55423
## Adj. R-Squared: 0.55262
## Chisq: 1720.64 on 5 DF, p-value: < 2.22e-16
print(summary(zz))
## Oneway (individual) effect Within Model
## 
## Call:
## plm(formula = log(Revenue) ~ log(Capital) + log(Labor) + log(VRP) + 
##     log(Invest) + Cluster, data = df)
## 
## Unbalanced Panel: n = 348, T = 3-4, N = 1391
## 
## Residuals:
##       Min.    1st Qu.     Median    3rd Qu.       Max. 
## -4.3666458 -0.1428966  0.0065714  0.1614145  2.7517449 
## 
## Coefficients:
##              Estimate Std. Error t-value  Pr(>|t|)    
## log(Capital) 0.150698   0.014655 10.2828 < 2.2e-16 ***
## log(Labor)   0.370587   0.043332  8.5522 < 2.2e-16 ***
## log(VRP)     0.646678   0.141300  4.5766 5.295e-06 ***
## log(Invest)  0.037644   0.172403  0.2183    0.8272    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    360.62
## Residual Sum of Squares: 277.58
## R-Squared:      0.23029
## Adj. R-Squared: -0.029734
## F-statistic: 77.7159 on 4 and 1039 DF, p-value: < 2.22e-16