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
pweight not allowed - helpHello, I am trying to use the pweight subcommand, but I am getting the error that it isn't allowed. …
collinearity diagnostics for ordered logistic regressionDear researchers, I am trying to get the VIF after running the xtologit but it doesn't work with me…
Marking Answer Sheets using STATAI am trying to find a quicker way to mark answer sheets using stata (over 500 answer sheets with eac…
How to make this graph with stack option?Dear all, I would like to make a graph as shown below. In my simple example, I calculated concentra…
overlapping graph lines are obscuredHi there I would like to plot multiple lines on a graph, but often these lines overlap, in which ca…
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