Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to do OLS with a moderating variable, control variables and fixed effects

    Dear reader,

    For my thesis I am studying the influence of board gender diversity on firm performance, moderated by genderinequality. I use firm size, firm age, nationality diversity and board size as control variables.
    Now I would like to run an OLS regression, but I cannot figure out how I have to add the moderating variables, control variables and fixed effects. Could you help me out with what steps/commands I have to do?

    Looking forward to hearing from you.

    With kind regards,
    Irene

  • #2
    First question: is OLS really suitable for your data? Do you have only a single observation for each firm, or do you have panel data? If the latter, OLS is usually inappropriate, and you should look into -xtreg- instead. In fact, you seem to have that in mind when you mention "fixed effects," though it is hard to be sure since that term is used to mean different things.

    Moderating effects are represented as interactions, and the best way to do that is to use Stata's factor variable notation. Read -help fvvarlist- to see how that is done.

    For general advice about how to use -xtreg-, run -help xtreg- and then click on the link near the top of the page to the PDF documentation that comes installed with your Stata. Click on the Remarks and examples link and read there.

    If after reading those you need more specific guidance, please post back with specific questions and include an example of your data using the -dataex- command. If you are running version 15.1 or a fully updated version 14.2, -dataex- is already part of your official Stata installation. If not, run -ssc install dataex- to get it. Either way, run -help dataex- to read the simple instructions for using it. -dataex- will save you time; it is easier and quicker than typing out tables. It includes complete information about aspects of the data that are often critical to answering your question but cannot be seen from tabular displays or screenshots. It also makes it possible for those who want to help you to create a faithful representation of your example to try out their code, which in turn makes it more likely that their answer will actually work in your data.

    When asking for help with code, always show example data. When showing example data, always use -dataex-.

    Comment

    Working...
    X