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
format date variableHello, i have a date variable in my dataset which is type "long" and formated in the following way:…
Dummy variablesDear all, I have a panel data (long data), shown below. Firm name Year Firm value Dummy A 1 …
Recognizing Texts ObservationsDear All, I have an issue with making STATA to recognize txt observations. I have a table that loo…
Moran test and ivreg2Hi, I am running a Moran’s test of residual correlation with nearby residuals. I know that Moran ru…
MlogitHi I am stuch with simple Mlogit. I appreciate help I am trying to see which regions are attracted b…
Subscribe to:
Post Comments (Atom)
0 Response to understand the stata code
Post a Comment