Announcement

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

  • Steps for somersd Kendall's tau for complex survey data

    I am interested in comparing 2 ordinal variables from 2 independent-survey datasets by DISCO. I have the pweight and the strata variable for both datasets.
    I believe Kendall’s tau is the best way to assess this using the somersd pkg in Stata 15.1. However, I am unclear as to the steps to follow to conduct this comparison:

    I appended the datasets together retaining the original variable names and adding a source (year) variable
    Created a variable super_strata

    Code:
     egen int super_strata = group(source q36)
    After the above steps is when I’m unsure of the steps to run taua
    Here’s my code

    Code:
     svyset [pweight = Final_We], strata(super_strata) 
    drop if DISCO == 0
    drop if DISCO == 3
    somersd  q24a q20a, taua
    I receive the error message no observations
    r(2000);

    Are any of these steps correct? Would appreciate help for conducting these comparisons

    Thank You!



    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input double(q36 q24a q20a) int source double Final_We float DISCO int super_strata
    19 . 1 2018 14229.0917 2 19
    19 . 1 2018  8471.5482 2 19
    19 . . 2018  8471.5482 2 19
    19 . 1 2018 14229.0917 2 19
    19 . . 2018 14229.0917 2 19
    19 . . 2018 14229.0917 2 19
    19 . 1 2018  8471.5482 2 19
    19 . 1 2018  8471.5482 2 19
    19 . 1 2018  8471.5482 2 19
    19 . 2 2018  8471.5482 2 19
    19 . 1 2018 14229.0917 2 19
    19 . 1 2018  8471.5482 2 19
    19 . . 2018  8471.5482 2 19
    19 . 1 2018 14229.0917 2 19
    19 . . 2018  8471.5482 2 19
    19 . 1 2018  8471.5482 2 19
    19 . . 2018  8471.5482 2 19
    19 . . 2018  8471.5482 2 19
    19 . . 2018  8471.5482 2 19
    19 . . 2018 14229.0917 2 19
    19 . . 2018 14229.0917 2 19
    19 . 1 2018  8471.5482 2 19
    19 . . 2018 14229.0917 2 19
    19 . . 2018 14229.0917 2 19
    19 . 1 2018 14229.0917 2 19
    19 . . 2018 14229.0917 2 19
    19 . 2 2018  8471.5482 2 19
    19 . 4 2018  8471.5482 2 19
    19 . 2 2018 14229.0917 2 19
    19 . . 2018 14229.0917 2 19
    19 . . 2018  8471.5482 2 19
    19 . 2 2018 14229.0917 2 19
    19 . 2 2018 14229.0917 2 19
    19 . 1 2018  8471.5482 2 19
    19 . . 2018  8471.5482 2 19
    19 . 2 2018 14229.0917 2 19
    19 . 1 2018 14229.0917 2 19
    19 . 2 2018  8471.5482 2 19
    19 . . 2018 14229.0917 2 19
    19 . . 2018  8471.5482 2 19
    19 . 3 2018  8471.5482 2 19
    19 . . 2018  8471.5482 2 19
    19 . . 2018  8471.5482 2 19
    19 . 1 2018 14229.0917 2 19
    19 . . 2018 14229.0917 2 19
    19 . . 2018  8471.5482 2 19
    19 . 1 2018  8471.5482 2 19
    19 . 1 2018  8471.5482 2 19
    19 . 1 2018 14229.0917 2 19
    19 . 1 2018 14229.0917 2 19
    19 . . 2018 14229.0917 2 19
    19 . 2 2018 14229.0917 2 19
    19 . 1 2018  8471.5482 2 19
    19 . . 2018 14229.0917 2 19
    19 . 1 2018 14229.0917 2 19
    19 . . 2018 14229.0917 2 19
    19 . . 2018 14229.0917 2 19
    19 . . 2018 14229.0917 2 19
    19 . 1 2018  8471.5482 2 19
    19 . 2 2018  8471.5482 2 19
    19 . . 2018  8471.5482 2 19
    19 . . 2018  8471.5482 2 19
    19 . 1 2018  8471.5482 2 19
    19 . . 2018  8471.5482 2 19
    19 . 1 2018 14229.0917 2 19
    19 . . 2018  8471.5482 2 19
    19 . 1 2018  8471.5482 2 19
    19 . . 2018 14229.0917 2 19
    19 . 1 2018  8471.5482 2 19
    19 . 2 2018 14229.0917 2 19
    19 . 1 2018 14229.0917 2 19
    19 . . 2018 14229.0917 2 19
    19 . . 2018 14229.0917 2 19
    19 . 4 2018  8471.5482 2 19
    19 . 2 2018  8471.5482 2 19
    19 . 2 2018  8471.5482 2 19
    19 . 4 2018 14229.0917 2 19
    19 . 2 2018  8471.5482 2 19
    19 . 2 2018  8471.5482 2 19
    19 . . 2018 14229.0917 2 19
    19 . 1 2018 14229.0917 2 19
    20 . . 2018 19362.7462 2 20
    20 . . 2018 11527.9627 2 20
    20 . . 2018 11527.9627 2 20
    20 . . 2018 19362.7462 2 20
    20 . 4 2018 11527.9627 2 20
    20 . 1 2018 11527.9627 2 20
    20 . 1 2018 11527.9627 2 20
    20 . 4 2018 11527.9627 2 20
    20 . . 2018 19362.7462 2 20
    20 . . 2018 11527.9627 2 20
    20 . 2 2018 11527.9627 2 20
    20 . . 2018 11527.9627 2 20
    20 . . 2018 19362.7462 2 20
    20 . 1 2018 11527.9627 2 20
    20 . 1 2018 19362.7462 2 20
    20 . 2 2018 11527.9627 2 20
    20 . . 2018 11527.9627 2 20
    20 . 1 2018 11527.9627 2 20
    20 . 1 2018 11527.9627 2 20
    end
    label values q36 q36
    label def q36 19 "Delta North", modify
    label def q36 20 "Delta South", modify
    label values q24a q24a
    label values q20a q20a
    label def q20a 1 "Very badly", modify
    label def q20a 2 "Fairly badly", modify
    label def q20a 3 "Neither good nor bad", modify
    label def q20a 4 "Fairly well", modify
    label values DISCO DISCOlabel
    label def DISCOlabel 2 "Benin DISCO", modify
Working...
X