Announcement

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

  • One sample test of proportions

    Dear Stata users,

    I have a question regarding comparing 3 or more percentages within the same population.

    The specific question, I have a continuous variable age split into 3 categories (age_cat), cat A, cat B and cat C and their reported percentages in the sample.
    Cat A = 56%
    Cat B = 20%
    Cat C = 24%

    I want to check whether percentages of cat A, cat B and cat C are significantly different from each other or not. and report the p-values.

    I tried using this code but getting an error,

    // chitest age_cat, sep(3)
    error: option sep() not allowed

    I believe I should be applying one-sample test of proportions to compare the percentages across categories, however, not sure how to execute it.

    I have computed the 95% CI for each category and there is no overlap, however not sure about the exact p-values.

    Kindly advise which test should be used; any help will be really appreciated. Thank you.

    Regards,
    Isha

  • #2
    Your categories are ordered. Does -chitest- assume nominal categories?

    I'm unclear about the motivation of your test, but with ordered categories, maybe you could consider something like this? (The illustration assumes that you have a sample of one hundred.)
    Code:
    input byte cat byte count
    1 56
    2 20
    3 24
    end
    
    ologit cat [fweight=count], nolog
    estimates store Model
    
    // Linear, quadratic components of orthogonal polynomial contrasts (and overall)
    quietly margins , post
    contrast q._predict, noeffects
    
    // Individually, pairwise
    quietly estimates restore Model
    margins , pwcompare(pveffects) mcompare(bonferroni)
    You'd probably want to look at its frequency properties (-help simulate-) before making much of it.

    Comment

    Working...
    X