Announcement

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

  • the regression command with moderate variable

    Hi all
    I am new using Stat and I have problem with multiple regression with a moderating variable. and I have panel data 50 company through 10years
    the DV= M/B
    the IV = CEE, HCE, and SCE
    moderate = RCE
    The regression models as follow:
    1) to determine the influence of the moderator variable RCE on the CEE, HCE, and SCE:
    M/B i,t = β0+β1 CEE i,t +β2 HCE i,t +β3 SCE i,t + β4 RCE i,t + ε 13
    2) To determine the effect of the interaction among the independent variables and the moderator RC measure by RCE on the dependent variable. (Dadashinasab & Sofian, 2014)
    M/B i,t = β0 + β1 CEE i,t + β2 HCE i,t + β3 SCE i,t + β4 RCE i,t + β5 CEE it* RCE i,t + β6 HCE it* RCE i,t + β7 SCE it* RCE i,t + ε 16
    So, I am very confused, please what the command or how can I find the regression from statistics.
    Thank you very much
    Kamelia momani

  • #2
    So, let's imagine your data set has a variable identifying firms, called firm_id, another variable identifying time, which I'll call time, and variables called MB (no / characters allowed in Stata variable names), CEE, HCE, SCE, and RCE. I also assume that there is at most one observation for any firm at any particular time. I also assume that MB, CEE, HCE, SCE are all continuous variables, and RCE is categorical.

    You would start by declaring your data to be panel data:
    Code:
    xtset firm_id time
    Then your two regression models would be coded as.
    Code:
    xtreg MB CEE HCE SCE RCE, fe
    xtreg MB i.RCE##c.(CEE HCE SCE), fe
    I am also assuming you prefer to use a fixed effects model.

    If your data are not like what I have assumed, you need to post back with an example of your data. Do that using Stata's -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


    • #3
      thaaaaaaaank you very much Dr. Clyde Schechter but because all the data are continuous variables so I think the second cod is
      xtreg MB c.RCE##c.(CEE HCE SCE), fe
      Attached Files

      Comment


      • #4
        Yes, that is correct.

        Comment

        Working...
        X