Announcement

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

  • Append regression results horizontally

    Hi,

    I am a new STATA user and found this forum has been incredibly helpful for me. I can't seem to find answers to my specific situation so I decide to post this problem and hopefully someone can help me.

    I am trying to run logit regressions with mediating variables. I have tried to use GSEM, but the logit regression won't converge. After I went through some of the posts in the forum that recommended relogit and Firthlogit, I decided to run separate regressions, and multiply the coefficient together to get the indirect effect.

    Luckily, I have been able to find results using relogit. However, it is hard for me to export the results, as I am running multiple mediating variables with multiple predicting variables. I have created two varlists, one for predicting variables and one for mediating variables. My problem is when I am trying to export my results to excel, it can only append vertically. Is there any way I can append the results horizontally when I am running through my predicting variables list?


    My code:

    local indivar inshold top1_hold top5_hold mot_hold lt_time_holding lt_turnover_holding ind_holding ind_holding2 tra_holding //predicting variable list
    local medvar risk_com duality //mediating variable list

    foreach m of local medvar {

    foreach x of local indivar{

    relogit `m' `x' ta firmage tobin roa sperf sgrowth lev2 srv fci rdass capxass assint f500 hrfd unique ind_tobin total_inshold
    eststo a: nlcom (_b[`x']), post


    relogit target `m' `x' ta firmage tobin roa sperf sgrowth lev2 srv fci rdass capxass assint f500 hrfd unique ind_tobin total_inshold
    eststo b: nlcom(_b[`m']) , post

    relogit target `m' `x' ta firmage tobin roa sperf sgrowth lev2 srv fci rdass capxass assint f500 hrfd unique ind_tobin total_inshold
    eststo c: nlcom (_b[`x']), post
    esttab a b c using test_gsem.csv, starlevels(* 0.10 ** 0.05 *** 0.01) append

    }
    esttab a b c using test_gsem.csv, starlevels(* 0.10 ** 0.05 *** 0.01) append

    }

    Thank you so much.


Working...
X