Announcement

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

  • Diference in creating interaction term by "#" vs. manually multiplication

    Dear Members,
    I am quite new with Stata and wish to seek some help from you.
    I've run a panel regression under random effect GLS regression with syntax as following:
    xtset ID
    panel variable: ID (balanced)
    xtreg ln_imp lnsub i.gender lnsubXgender ft lnfa i.state lnecon lnperf num i.yr, vce(cluster ID)


    In my model, I've log transformed both the IV and DV while creating an interaction term between the lngsv (natural log transformed) and eth (one IV as a dummy variable) by simply multiplication (basically a 1*a continuous variable) and found out a negative significant result with the interaction term (at the same time, the coefficient for lnsub is also negative significant). However, if I substitute the method by stating:
    xtreg ln_imp lnsub i.gender c.lnsub#i.gender ft lnfa i.state lnecon lnperf num i.yr, vce (cluster ID).

    The results for the interaction term is switching to a positive insignificant output.
    I am wondering which method should I rely on?
    In addition, since I've log transformed both the IV and the DV, does it still make sense to use a -twoway lfit- to graph the interaction effect?
    Thank you so much for your kind help and I am looking forward your reply.

    Sincerely,
    Bin

  • #2
    For interactions involving a continuous and a categorical variable, the number of possible interactions equals the number of categories in your categorical variable. You then include all intercations except one in the regression unless you have grounds to consider only some of the interactions. Simple multiplication works for an interaction involving 2 continuous variables because you have only one resulting interaction. If you have a binary variable coded 1/0, the 0 category is redundant and effectively you are left with one interaction.

    Because your description is neither clear enough nor do you do not provide the resulting output from Stata, it is difficult to diagnose what went wrong with your procedure. Nevertheless, correctly using factor variables seldom gives you the wrong results. Look at the FAQs on how to post Stata output using code delimiters and using dataex to present data examples if you need specific advice on what went wrong here.

    Comment

    Working...
    X