I want to calculate the median of a variable with certain restrictions. I know that -sum variable, detail- gives me the 50th percentile, ie the median. Also I can command -sum variable if condition- but that doesn't give me the median. Also I'm not allowed to command -sum variable, detail if condition- or variations of that. Concretely I want something like -sum income, detail if income>1000-
Probably a simple answer, but any help would be appreciated.
Related Posts with Calculate median with conditions
generating an indexHi, I am trying to generate the index "z" in Stata, so that Z has the same value for all Xs and Ys. …
Help with analyzing survey data for presidential electionHello everyone, I am almost new to Stata and am trying to find the right model to fit my data which …
Reshape long (date; price_68372V; price_138056) Code: * Example generated by -dataex-. To install: ssc install dataex clear input float date doubl…
Excel files: Merge worksheets within Excel files and append Excel files with a loopDear Statalist, We have collected annual data on minorities in several countries for 25 years. Now …
margins in spatial panel data analysisHi, I have a problem using margins after the Spatial-AutoRegressive model, using xsmle. First I run…
Subscribe to:
Post Comments (Atom)
0 Response to Calculate median with conditions
Post a Comment