Announcement

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

  • syntax question

    Hi, I have a tech question that I'm hoping someone can help me with. The question is: what STATA syntax would I use to answer the following?

    What is the probability that 20 people out of 100 that I interview at random will have condition X? From previous research I know that an 40% of the population suffer with condition X.

    Thanks

  • #2
    Alex:
    welcome to the list.
    Your question sounds not that clear to me: the probability of what you're after is 20% (or 0.20, that is 20/100: this proportion is the estimate of the probability)
    If this were the case, Stata (not STATA, please) syntax is as follows:
    Code:
    display 20/100
    .

    However, if your query is differet from what I got, I would recommend you to take a look at -logistic- and related entry in Stata 13.1 .pdf manual or scoll down Statistics from Stata menu, stop at -Survival analysis- and take a comprehensive tour in its options and their entries in Stata 13.1 .pdf manual.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      I think what Alex wants is:
      Code:
      display binomial(100, 20, 0.4)  // PROBABILITY OF 20 OR FEWER
      
      // OR
      
      display binomial(100, 20, 0.4) - binomial(100, 19, 0.4) // PROBABILITY OF EXACTLY 20
      
      // OR
      
      display 1-binomial(100, 19, 0.4) // PROBABILITY OF 20 OR MORE

      Comment


      • #4
        Dear Carlos and Clyde. Thank you so very much for your assistance answering this question. It has really helped. Alex

        Comment


        • #5
          Alex:
          just a belated small contribution following Clyde's methodological stream:
          Code:
          display 1-binomial(100, 0, 0.4)// probability of at least 1
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment

          Working...
          X