RE: Output Results from a RANGE of Variables to Single Excel/.csv file
Hi, I'm running tab queries (foreach loop) on a series of health condition variables and was wondering if I can output/export them somehow into a single .csv results table?
Here's my loop code -
foreach n of varlist b_hcondn1 b_hcondn2 b_hcondn3 b_hcondn4 b_hcondn5 ///
b_hcondn6 b_hcondn7 b_hcondn8 b_hcondn9 b_hcondn10 b_hcondn11 ///
b_hcondn12 b_hcondn13 b_hcondn14 b_hcondn15 b_hcondn16 b_hcondn17{
tab `n' if `n' >=0
}
Thanks in advance.
SCE
Hi, I'm running tab queries (foreach loop) on a series of health condition variables and was wondering if I can output/export them somehow into a single .csv results table?
Here's my loop code -
foreach n of varlist b_hcondn1 b_hcondn2 b_hcondn3 b_hcondn4 b_hcondn5 ///
b_hcondn6 b_hcondn7 b_hcondn8 b_hcondn9 b_hcondn10 b_hcondn11 ///
b_hcondn12 b_hcondn13 b_hcondn14 b_hcondn15 b_hcondn16 b_hcondn17{
tab `n' if `n' >=0
}
Thanks in advance.
SCE
Comment