Greeting Stata Users,
I am using svy, subpop ( ): tab a b, pearson to generate chi-square statistic for a bivariate table. Variable 'a' has 3 categories and I wanted to drop one of the categories with n < 30. I created 0/1 variable, such that keepvalues=1 if inlist(a,1,2), 0 otherwise.
I used svy, subpop(keepvalues): tab a b, pearson to generate a chi-square statistic. However, instead of excluding the category the svy, supop (keepvalues) command populated the excluded category with zeros and failed to calculate the chi-squared.
Please advise.
The output after the run:
b
1 2
a 1 n11 n12
2 n21 n22
3 0 0
Table contains a zero in the marginals.
Statistics cannot be computed.
Pearson:
Uncorrected chi2(2) = .
Design-based F(., .) = . P = .
Related Posts with Re: svy, subpop ( ): tab a b, obs Pearson failed to calculate Chi-square statistic
Query on dose-response codeHi all, I am carrying out a study examining the effect of a medication on breast cancer death. I h…
How can I Graph the Logistic Regression Plot with Interaction Terms in Stata?Hi, There, I have a online dataset at use http://ssc.wisc.edu/sscc/pubs/files/grad.dta,clear The lo…
margianl effect of tobit model after GSEMHello all, I have a structure model as below Code: gsem ($x <- shock $xfirm_control i.year) //…
Exporting simulation results to Excel fileHi, I am running a simulation to compute the frequency of a p_value less than 0.05. My code is as fo…
How to create a table of means and differences of variablesHello everyone I am new to Stata and statistics in general. I am looking to replicate the following…
Subscribe to:
Post Comments (Atom)
0 Response to Re: svy, subpop ( ): tab a b, obs Pearson failed to calculate Chi-square statistic
Post a Comment