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.
Related Posts with Append regression results horizontally
How to convert daily data to yearly dataHi, I am currently having daily data and I would like to convert it to yearly data. Ultimately, I wo…
converting string variables to numericI have a string variable that I want to change to numeric but I can't. Can you help me please stora…
Graph with a binomial category. Example in post!Good afternoon! https://cdn.jamanetwork.com/ama/cont...5G5CRDK6RD3PGA If I wanted to make a gra…
-lnoffset- and -exposure- options from -glm-Dear All, Good afternoon. I do hope this one finds you well. While challenging myself with the examp…
Curious histogram glitch?Array I can't find this reported before, and I am pretty sure it's NOT my data. Array Above, the re…
Subscribe to:
Post Comments (Atom)
0 Response to Append regression results horizontally
Post a Comment