0
$\begingroup$

Sample Panel Data

Year Firm_ID Region Industry ROE ROA Tobin_Q ESG Leverage Age Size
2012 1 Asia/Pacific Rim Oil_and_Gas_Refining_and_Marketing 12.19 6.22 1.17 51.24 1.45 1.58 6.51
2013 1 Asia/Pacific Rim Oil_and_Gas_Refining_and_Marketing 11.88 6.06 1.12 55.37 1.47 1.59 6.56
2014 1 Asia/Pacific Rim Oil_and_Gas_Refining_and_Marketing 11.82 5.69 1.17 57.85 1.51 1.6 6.63
2015 1 Asia/Pacific Rim Oil_and_Gas_Refining_and_Marketing 11.3 5.05 1.05 48.76 1.5 1.61 6.7
2016 1 Asia/Pacific Rim Oil_and_Gas_Refining_and_Marketing 13.22 5.39 1.13 52.48 1.48 1.62 6.78
2017 1 Asia/Pacific Rim Oil_and_Gas_Refining_and_Marketing 12.07 4.56 1.18 41.74 1.44 1.63 6.85
2018 1 Asia/Pacific Rim Oil_and_Gas_Refining_and_Marketing 12.95 4.72 1.28 53.31 1.43 1.64 6.91
2019 1 Asia/Pacific Rim Oil_and_Gas_Refining_and_Marketing 11.63 4.35 1.42 42.56 1.46 1.65 7
2020 1 Asia/Pacific Rim Oil_and_Gas_Refining_and_Marketing 9.37 3.63 1.22 41.74 1.47 1.66 7.07
2012 2 EMEA Electric_Utilities 14.4 5.95 1.1 77.27 1.55 1.11 4.39
2013 2 EMEA Electric_Utilities 12 5.03 1.2 72.31 1.59 1.15 4.37
2014 2 EMEA Electric_Utilities 30.2 14.1 1.24 66.53 1.51 1.18 4.33
2015 2 EMEA Electric_Utilities 33.56 18.75 0.94 66.53 1.42 1.2 4.36
2016 2 EMEA Electric_Utilities 3.65 2.22 0.98 67.77 1.37 1.23 4.34
2017 2 EMEA Electric_Utilities 6.53 3.96 1.07 64.46 1.35 1.26 4.34
2018 2 EMEA Electric_Utilities 6.77 3.82 1.23 65.7 1.43 1.28 4.35
2019 2 EMEA Electric_Utilities 11.94 6.48 1.28 66.12 1.46 1.3 4.37
2020 2 EMEA Electric_Utilities 14.06 4.49 1.08 57.02 1.27 1.32 4.76
2012 3 Americas Oil_and_Gas_Storage_and_Transportation 19.13 6.91 1.89 11.57 1.65 1.11 4.56
2013 3 Americas Oil_and_Gas_Storage_and_Transportation 18.29 6.83 2.17 12.81 1.64 1.15 4.6
2014 3 Americas Oil_and_Gas_Storage_and_Transportation 16.75 6.38 2.1 12.81 1.66 1.18 4.67
2015 3 Americas Oil_and_Gas_Storage_and_Transportation 13.15 5.25 1.64 14.46 1.66 1.2 4.69
2016 3 Americas Oil_and_Gas_Storage_and_Transportation 11.87 4.98 1.67 19.01 1.66 1.23 4.72
2017 3 Americas Oil_and_Gas_Storage_and_Transportation 12.55 5.25 1.64 19.01 1.65 1.26 4.74
2018 3 Americas Oil_and_Gas_Storage_and_Transportation 17.98 7.49 1.52 28.51 1.66 1.28 4.76
2019 3 Americas Oil_and_Gas_Storage_and_Transportation 18.89 7.74 1.6 34.3 1.66 1.3 4.79
2020 3 Americas Oil_and_Gas_Storage_and_Transportation 15.37 6 1.29 33.88 1.68 1.32 4.81

For example, my fixed effects model is using the code:

dummyvar = lm(ROE ~ ESG + Leverage + Age + 
    Size + factor(Industry) + factor(Region), 
    data=Updated_Age_Data)

Whereby the industry and regions are the dummy variables. ROE is the dependent, ESG is my independent, and leverage, age, and size are my control variables.

How do I apply the same concept to a random effects model? Would either of these be the correct code? As I want the output to show the significance of ROE based on region and industry type.

random1  <- plm(ROE ~ ESG + Leverage + Age + 
    Size + Region + Industry, 
    index=c("Firm_ID", "Year"), model="random", 
    data=Updated_Age_Data)

OR

random2  <- plm(ROE ~ ESG + Leverage + Age + 
    Size + Industry + Region, 
    data=Updated_Age_Data, model="random")

List of acronyms/explanations:

  • ROE = Return on Equity
  • ESG - Proxy for corporate social responsbility
  • ROE is my dependent variable
  • ESG is my independent variable
  • Age, Size and leverage are my control variables
$\endgroup$
3
  • $\begingroup$ Welcome to stack! Please @Emma, try to give a toy dataset to provide a minimal reproducible example (see [mcve]) so that people here can gives you answer that can be tested and reproduced by otehrs $\endgroup$
    – denis
    Commented Apr 23, 2022 at 13:46
  • $\begingroup$ @denis Hi, apologies for that. I just tried to include a sample in, my unsure how to format it nicely in the snippet code as per the link you sent. $\endgroup$
    – Emma
    Commented Apr 23, 2022 at 14:10
  • $\begingroup$ try to use dput on your dataset $\endgroup$
    – denis
    Commented Apr 23, 2022 at 14:10

1 Answer 1

0
$\begingroup$

As you do not give a dataset, I will try to give you some guidance without having the possibility to test.

I think you need to have a look at the lme4 and lmerTest packages for the mixed effect linear regressions.

From what I understand, Industry and Region are your cluster variables. Your regression with random intercept would look like

lmer(ROE~ESG+Leverage+Age+Size+(1|Industry)+(1|Region),
     data = Updated_Age_Data)

For random slopes of your independent variable:

lmer(ROE~ESG+Leverage+Age+Size+(1 + ESG|Industry) + (1 + ESG|Region),
     data = Updated_Age_Data)

You could also want to use GEE from the gee package or geepack package, but these do not allow for 3 levels random models. If you want just 2 level random variable, gee would do the trick too (without estimating the variance of intercepts and slopes)

$\endgroup$
4
  • $\begingroup$ Hi, apologies if I'm wrong. But I did some tests which told me to use the random-effect model. Would the mixed effect linear regression model not be something entirely different? Thank you for the reply nevertheless! $\endgroup$
    – Emma
    Commented Apr 23, 2022 at 14:12
  • $\begingroup$ mixed-effect and random effect are two ways of naming the same thing actually, see en.wikipedia.org/wiki/Mixed_model $\endgroup$
    – denis
    Commented Apr 23, 2022 at 14:13
  • $\begingroup$ Sorry, I should have worded it better. I'm looking to just get the results using just the random-effects model, rather than mixing the two! The fixed-effects code was there just for example haha. $\endgroup$
    – Emma
    Commented Apr 23, 2022 at 14:19
  • $\begingroup$ If you found this answer helpful, then please consider upvoting and/or accepting it. $\endgroup$ Commented Apr 25, 2022 at 13:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.