Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem estimating chisquare with tabout

    I am experiencing problem estimating chi-square with tabout command when I svyset the data and use the svy option but that is not the case without the svyset and svy option. I have tried to resolve the problem but to no avail.

    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.000
    Below is the outcome with svyset and svy:
    Code:
    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 = .
    Category 3 of variable x is zero in the cross-tabulation when svyset and svy are used and could be the cause. If it is the cause, how can it be avoided?

    How can I get it to estimate chisquare with the svyset and svy option.

    Attached is the data. sampledata.dta


    Thanks.
    Attached Files
    Last edited by Kehinde Atoloye; 18 Mar 2023, 00:50.
Working...
X