Announcement

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

  • Generate 20th percentile woth weights

    Hello,
    I a new to Stata, and I have got a following question. Could someone please kindly help me?
    I need to generate a 20th percentile. All variables must be used with weights.
    When I enter pctile variable [aw=weight] if variable2=1, p(20), Stata gives me a mistake-variable 1 is laready defined. What should i do?

  • #2
    Code:
    pctile variable [aw=weight] if variable2=1, p(20)
    is not legal code, but it would not lead to an error message about "variable 1".

    Perhaps you meant

    Code:
    _pctile variable [aw=weight] if variable2==1, p(20)
    Either way, please note the FAQ Advice

    Say exactly what you typed and exactly what Stata typed (or did) in response. N.B. exactly! If you can, reproduce the error with one of Stata's provided datasets, a small fragment of your dataset, or a simple concocted dataset that you include in your posting.

    Comment

    Working...
    X