Hi, I am a senior in college working on an economics thesis.
I am trying to generate a dummy variable which would yield 1 if the observation is in the 95th percentile of the variable and a 0 otherwise. The variable in question is "inflation" and the new variable would be named "extremeinflation". The data is panel, not sure if this would make a difference in the syntax that I need.
I believe I should be using the command pctile in some kind of manner but I am confused on the exact syntax that I should be using.
Anything helps!
Thank you very much.
Related Posts with Generating a 95th percentile indicator variable
Margins: trouble with continuous interactions under simultaneous fixed effectsSometimes I wish to control for variable X via fixed effects (say, year fixed effects) but also allo…
Panel data - Creating a date variable from year and weeknumber as stringStata listers I am writing with a query relating to panel data for historical prices. I am trying t…
Please help: Importing and merging multiple sheets from an excel file while renaming variables using loopsHello, I am quite new using loops and really want to understand it better. I have an excel file with…
Time varying covariate in Cox Regression modelHi all. After a thorough search online I can't seem to find a solution to my problem, which is why I…
Panel data regressionHello everyone, I'm writing my thesis and I'm struggling with the processing of my data. First of a…
Subscribe to:
Post Comments (Atom)
0 Response to Generating a 95th percentile indicator variable
Post a Comment