Announcement

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

  • Comparing Proportions- please help

    Hi there!

    I am stuck on something that seems so simple, yet I cannot find a straightforward solution.
    I am conducting analysis on some survey data. For each question, I have the number of respondents who selected each category. For example:
    Q1.please indicate your primary area of COVID-19 response work during the past 6 months
    Options = 1) communications 2) Case management 3)COVID line 4)Surveillance and so on.
    I had coded these options on stata from 1-7 (as there were 7 options for question 1).
    I simply want to compare the proportion of respondents in each category because I want to know if they are statistically different.

    right now I have various format of this variable. I have its original format as q1code (coded 1-7). I also created dummy variable for each option so I have 7 more categorical variables coded as 0/1, where 1 is the actual count I am interested in. I tried running a chi square on each of these categorical variables =
    tab2 q1code2 q1code1 q1code3 q1code4 q1code5 q1code6 q1code7, row col chi.
    This will give me 2x2 tables for each combination of those variables. For example=

    | q1code1
    q1code==2 | 0 1 | Total
    -----------+----------------------+----------
    0 | 34 3 | 37
    | 91.89 8.11 | 100.00
    | 69.39 100.00 | 71.15
    -----------+----------------------+----------
    1 | 15 0 | 15
    | 100.00 0.00 | 100.00
    | 30.61 0.00 | 28.85
    -----------+----------------------+----------
    Total | 49 3 | 52
    | 94.23 5.77 | 100.00
    | 100.00 100.00 | 100.00

    Pearson chi2(1) = 1.2907 Pr = 0.256


    However, I am not interested in the "0" group. I want to know if 3/52 (5.77) is significantly different than 15/52 (28.85). I can do a prtest for each of these variables against each other but that seems very inefficient. I am hoping there is a simple solution to this.

    Thank you!
    Meera

  • #2
    Here is a cleaner version of the syntax and output
    Click image for larger version

Name:	chi.PNG
Views:	1
Size:	18.6 KB
ID:	1598500


    Last edited by Meera Mahmud; 18 Mar 2021, 06:35.

    Comment

    Working...
    X