I am new to Stata, and have over 50 corr and sum mean results in my current project (each with only two variables) with varied and inconsistent conditions that I want to export into a single Excel table. Here is an example of three:
corr nifsal shaked if migzar=="Jewish" & sug_pikuah=="a"
corr nifsal shaked if migzar=="Christian" & notzri==0
corr nifsal shaked if migzar=="Muslim" & notzri==0 & migdar=="mixed"
My two tables, one for corr and one for sum means, would ideally have 4 columns, "Variable 1", "Variable 2", "Conditions", "Result". There are only two variables so there is no need to collect the whole corr matrix, only one scalar.
I can't seem to find an efficient way to export this data, without individually collecting each result as a loop can't loop over inconsistent conditions. I am also having difficulty collecting and exporting the corr results without collecting the entire matrix. Any advice? Thanks.
corr nifsal shaked if migzar=="Jewish" & sug_pikuah=="a"
corr nifsal shaked if migzar=="Christian" & notzri==0
corr nifsal shaked if migzar=="Muslim" & notzri==0 & migdar=="mixed"
My two tables, one for corr and one for sum means, would ideally have 4 columns, "Variable 1", "Variable 2", "Conditions", "Result". There are only two variables so there is no need to collect the whole corr matrix, only one scalar.
I can't seem to find an efficient way to export this data, without individually collecting each result as a loop can't loop over inconsistent conditions. I am also having difficulty collecting and exporting the corr results without collecting the entire matrix. Any advice? Thanks.

Comment