All,
I am running two-way tabulations on data survey set for weighting, stratification, etc. The column variable has 3 categories but the variable that defines the subpopulation of interest excludes one of the three categories in the column variable. I was expecting that running the two-way table with the defined subpopulation would automatically exclude the column that has no observations. It instead prints out the column of all zeroes and does not provide significance tests explaining that these can't be computed because the marginals contain a zero. I am guessing this has a simple solution that I am just overlooking. Below is the code that I am using and a sample table that is output. The subpopulation identifier is defined as chs_strict > 0, leaving only cases with a value of 1 or 2 in the chs_strict variable.
As always, thank you for any help.
I am running two-way tabulations on data survey set for weighting, stratification, etc. The column variable has 3 categories but the variable that defines the subpopulation of interest excludes one of the three categories in the column variable. I was expecting that running the two-way table with the defined subpopulation would automatically exclude the column that has no observations. It instead prints out the column of all zeroes and does not provide significance tests explaining that these can't be computed because the marginals contain a zero. I am guessing this has a simple solution that I am just overlooking. Below is the code that I am using and a sample table that is output. The subpopulation identifier is defined as chs_strict > 0, leaving only cases with a value of 1 or 2 in the chs_strict variable.
As always, thank you for any help.
Code:
svyset hosp_ed [pw=discwt], strata(neds_stratum) single(centered) foreach var of varlist race female pay1 pay2 age_cat catag3 pregnant pl_nchs region disp_ed /// aweekend year { svy, subpop(subp): tabulate `var' chs_strict, count column percent /// format(%12.2g) cellwidth(15) stubwidth(15) pearson }
Comment