Below is the outcome without svyset and svy
Code:
. tabout x symptom if state==1 using table2B.xls, replace nwt(weight) nlab(Number) sebnone h1(nil) clab(freq 95%_CI) f(1 1) stats(chi2)
Table output written to: table2B.xls
x 0 1 Total Number
freq freq freq
1 6884.0 922.0 7806.0 7,518
2 4443.0 479.0 4922.0 6,017
Total 11327.0 1401.0 12728.0 13,534
Pearson chi2(1) = 13.3273 Pr = 0.000Code:
svyset [iw=weight]
Importance weights: weight
VCE: linearized
Single unit: missing
Strata 1: <one>
Sampling unit 1: <observations>
FPC 1: <zero>
. tabout x symptom if state==1 using table2B.xls, replace svy nwt(weight) nlab(Number) sebnone h1(nil) clab(freq 95%_CI) f(1 1) stats(chi2)
Survey results being calculated
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5
.......
Table output written to: table2B.xls
x 0 1 8 Total Number
freq freq freq freq
1 6788.6 729.3 0.0 7517.9 7,791
2 5515.6 500.9 0.0 6016.5 4,920
3 0.0 0.0 0.0 0.0 0
Total 12304.2 1230.2 0.0 13534.4 12,711
Pearson: Uncorrected chi2(4) = .
Design-based F(., .) = . Pr = .How can I get it to estimate chisquare with the svyset and svy option.
Attached is the data. sampledata.dta
Thanks.
No comments:
Post a Comment