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
Robustness checksDear statalist, I am running a bootstrap on an OLS model with the dependent variable being log(maxi…
convert hexadecimal to binaryI have variables whose values come as hexadecimal strings 32 characters long as a rusult of an md5 h…
HGLM - Model 2 level variables not siginificant but postestimation plot shows variationGood day, I am using a two level HGLM model model 1 - Level 1 variables have significant effect on …
How to calculate year in month with conditionsDear all, Year of birth and month of birth of each individual in a given dataset, now I want to gen…
Comparing coefficients while keeping difference between other coefficients constant in mixed modelDear Statalist users, I would like to compare whether the slope is statistically different between …
Subscribe to:
Post Comments (Atom)
0 Response to understand the stata code
Post a Comment