I find a code for generating 97th percentile for each year. However, I am not sure why the percentile_97 need to be replaced by r(c_1). Does it mean that the count of analyst is the % within 97th percentile?
Thank you if you can give me any explanation of the code.
*generating 97th percentile for each year*
gen percentile_97=.
su fiscal_year
scalar a= r(min)
scalar b= r(max)
forvalues i= `=scalar(a)'/`=scalar(b)' {
centile max_analy_count if fiscal_year==`i', cent(97)
replace percentile_97=r(c_1) if fiscal_year==`i'
}
sort ticker analys forecasted_year forecasted_month
Related Posts with understand the stata code
Deleting ID that is not present in both datasets for Panel DataHi, I am interested in doing regression analysis with panel data.The data I've chosen is in 2 waves…
Box Cox regression (Lambda model) result shows 0.000 standard errors for estimated coefficients and Sigma constantHello all, I am Florence Ijagbone. I am working on the social welfare function as part of my PhD pr…
EGARCH modelling expressionsHi everyone, I was wondering if anyone would be able to help me with an issue I have come across on…
Announcement of the Stata Journal Editors’ Prize 2023Stata Journal 23(1) released last week carries an invitation to nominate for the Editors' Prize in 2…
Stacked bar graph for a binary and a categorical variableHi. I have a binary variable, OC, and a categorical variable Department. Department has 16 categorie…
Subscribe to:
Post Comments (Atom)
0 Response to understand the stata code
Post a Comment