Dear all,
I came across the KHB method for mediation analysis. I have gone through the paper “Comparing coefficients of nested nonlinear probability models” but I couldn’t figure out (after trying many times) the command in the ordered outcome section which is as shown below:
. forv i = 1/3 { 2. quietly eststo: khb ologit edu fses || abil, outcome(`i´) ape > summary 3. }
. esttab, scalars("ratio_fses Conf.-Ratio" "pct_fses Conf.-Perc.")
I use an ordered logit as my dependent variable has 6 outcomes(which are educational levels) and I have a number of control variables too.
Dependent variable = isced1997_r
Independent variable= i.sl_hs045d2
Mediator= i.sl_cs010
Control variables = i.dn042, i.dn003, i.cs009, i.cs008.
I use this command:
. forv i = 1/6 { 2. quietly eststo: khb ologit isced1997_r i.sl_hs045d2 || i.sl_cs010, outcome(`i´) ape > summary 6. }
. esttab, scalars("ratio_ i.sl_hs045d2 Conf.-Ratio" "pct_ i.sl_hs045d2 Conf.-Perc.")
But get this message- program error: code follows on the same line as open brace
I will really appreciate your guidance on inputting this in Stata in order to get the analysis done. Many thanks.
Related Posts with KHB method for mediation analysis
Automatically Produced Timestamp in Results Window at Each StepSorry, this might be a basic question but when searching for an answer that includes "timestamp" I g…
Using predict to estimate a value after a linear regressionI have two variables, height and weight. I ran a regression and now need to predict the height at ce…
Whiskers and Outliers in a Box PlotDear Stata Experts, How can I do the following: 1. Extend the whiskers to cover all the values (in…
Changing month in date variableHi to all!, I have a question regarding my dataset. I digitized a historical book and I noticed tha…
Fixed Effects ResidualsHi there, I estimate a model using FE and also FE2SLS and I would like to compare the FE and FE2SLS …
Subscribe to:
Post Comments (Atom)
0 Response to KHB method for mediation analysis
Post a Comment