Hello,
I am working on a paper that examines marital quality (marital happiness, divorce proneness, etcetera) across three US marriage cohorts, 1980, 2000, and 2022 - extending this paper using new data from 2022. I am decomposing the change in marital happiness due to various factors using new data from 2022. I am decomposing the change in marital happiness due to various factors using the oaxaca command. I am using Stata 19.
Here is my command, comparing 1980 and 2022 where “marhap” is a continuous measure of marital happiness, “agecurrmarr” through “relig” are the predictors, “cohort19802022” distinguishes the two cohorts (it is 0/1), and it is svy weighted and conducted for the subpop of wives.
It works beautifully.

Now I want to feed them into a table using the "collect" suite of commands. But, I cannot figure out how to refer to the specific parts of the matrices I need. For example, how do I call the e(b) for the first group (i.e. 1980 cohort) and how do I call the "explained" and "unexplained"? I am *very* new to the collect command, so I apologize in advance if this is obvious. But most examples are with simple regression commands I have seen, as opposed to a command like oaxaca that produces several matrices.
Note that this table is from an earlier version, I dropped a few variables and I am doing it separately for men and women, but I think what I am eventually going for comes across.

Any help would be greatly appreciated!!!!
Claire Kamp Dush
Professor, Sociology and Minnesota Population Center
University of Minnesota, Twin Cities
Minneapolis, MN US
I am working on a paper that examines marital quality (marital happiness, divorce proneness, etcetera) across three US marriage cohorts, 1980, 2000, and 2022 - extending this paper using new data from 2022. I am decomposing the change in marital happiness due to various factors using new data from 2022. I am decomposing the change in marital happiness due to various factors using the oaxaca command. I am using Stata 19.
Here is my command, comparing 1980 and 2022 where “marhap” is a continuous measure of marital happiness, “agecurrmarr” through “relig” are the predictors, “cohort19802022” distinguishes the two cohorts (it is 0/1), and it is svy weighted and conducted for the subpop of wives.
Code:
oaxaca marhap agecurrmarr yrsmar remarried_couple premarcohab blackresp latinoresp othernwresp lesshs_w hs_w somecoll_w lesshs_h hs_h somecoll_h wifepart wifefull husbpart husbfull wifeextend husbextend anypschool anyschool hhwork hwsat wifefair husbfair edecide genderatt lifelongmarr relig, by(cohort19802022) noisily weight(1) svy(,subpop(if wiferesp == 1))
Now I want to feed them into a table using the "collect" suite of commands. But, I cannot figure out how to refer to the specific parts of the matrices I need. For example, how do I call the e(b) for the first group (i.e. 1980 cohort) and how do I call the "explained" and "unexplained"? I am *very* new to the collect command, so I apologize in advance if this is obvious. But most examples are with simple regression commands I have seen, as opposed to a command like oaxaca that produces several matrices.
Note that this table is from an earlier version, I dropped a few variables and I am doing it separately for men and women, but I think what I am eventually going for comes across.
Any help would be greatly appreciated!!!!
Claire Kamp Dush
Professor, Sociology and Minnesota Population Center
University of Minnesota, Twin Cities
Minneapolis, MN US

Comment