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
generate Table with Percentiles, Panel DataHello, I am working with a panel data set containing 550 district variables over 6 years. One obser…
Box plot - Only lable Most extreme outliersDear Statalists, after going through several tutorials and information about box plots in Stata, I …
How to save the value of a local in another datasetHi all I'd like to store the results of my .do file in a new dataset. For example, I have four di…
xtivreg2 with interaction between categorical var and continuous var.Dear Stata users, I am trying to analyze IV regression but xtivreg2 does not support interaction. …
Generating values in a variable through two other variables in the datasetHi! I need help to create the values in a variable automatically from two other variables. My data …
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