Dear Statalisters,
I am tearing my hair about here. This seems like a very simple issue but I just can't find anything that works. Sorry if it is a bit of a stupid question.
What I have is this:
I wish to cross-tabulate multiple variables (coded as present or absent) according to the participant being antibody positive or negative and then do a hypothesis test. I have added in the cc command as I wish to present odd's ratios as well as p values:
foreach var in VAR1 VAR2 VAR3 VAR4{
tab `var' ANTIBODY, chi2
cc `var' ANTIBODY
}
I have wasted a lot of time copying and pasting in to MS word and making errors along the way. Is there a way to ask Stata to make a nice looking table like this:
Variable ANITBODY POS ANTIBODY NEG p OR
VAR1 n (%) n (%) x.xxx x.xx-x.xx
VAR2 n (%) n (%) x.xxx x.xx-x.xx
VAR3 n (%) n (%) x.xxx x.xx-x.xx
VAR4 n (%) n (%) x.xxx x.xx-x.xx
VARX n (%) n (%) x.xxx x.xx-x.xx
Thank you in advance...
James
I am tearing my hair about here. This seems like a very simple issue but I just can't find anything that works. Sorry if it is a bit of a stupid question.
What I have is this:
I wish to cross-tabulate multiple variables (coded as present or absent) according to the participant being antibody positive or negative and then do a hypothesis test. I have added in the cc command as I wish to present odd's ratios as well as p values:
foreach var in VAR1 VAR2 VAR3 VAR4{
tab `var' ANTIBODY, chi2
cc `var' ANTIBODY
}
I have wasted a lot of time copying and pasting in to MS word and making errors along the way. Is there a way to ask Stata to make a nice looking table like this:
Variable ANITBODY POS ANTIBODY NEG p OR
VAR1 n (%) n (%) x.xxx x.xx-x.xx
VAR2 n (%) n (%) x.xxx x.xx-x.xx
VAR3 n (%) n (%) x.xxx x.xx-x.xx
VAR4 n (%) n (%) x.xxx x.xx-x.xx
VARX n (%) n (%) x.xxx x.xx-x.xx
Thank you in advance...
James
Comment