Announcement

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

  • exporting results of bivariate regression done in loop into matrix

    Hello,

    I kindly ask your assistance on exporting results from a loop into matrix to be finally exported to word.
    I want to do a bivariate regression, where one outcome variable is regressed against each of the exposure variables separately to create unadjusted odds ratio. I want to do this for four different surveys (four years).
    the loop looks like this:

    Code:
    forvalues i=1/4 {
    foreach var of varlist v106_new v025 adolescent_age_F  media_new husband_edu_new v190 region_f religion_f women_occupation husband_occupation wantedness_child birthor swpatt3gr swpsoc3gr {
    svy:logit skilled_delivery i.`var' if survey==`i', or
    }
    }
    Thank you.

  • #2
    Code:
    ssc install estout, replace
    Code:
    estimates clear
    forvalues i=1/4 {
        foreach var of varlist v106_new v025 adolescent_age_F media_new husband_edu_new v190 region_f religion_f women_occupation husband_occupation wantedness_child birthor swpatt3gr swpsoc3gr{
            eststo: svy:logit skilled_delivery i.`var' if survey==`i', or
        }
     }
    esttab est* using myfile.rtf, eform replace
    Last edited by Andrew Musau; 06 Jul 2023, 07:38.

    Comment

    Working...
    X