My data has the following variables: symbol (to identify which firm it is), year, industry and mandatory (a dummy variable =1 if the firm is "mandatory"). I want to compute the proportion of firms that are "mandatory" by a given industry and a given year excluding the focal firm. After reading https://www.statalist.org/forums/for...ding-own-value and https://www.statalist.org/forums/for...interval-t-1-0, I wrote the following:
Code:
sort Year industry Symbol rangestat (mean) mandatory_prop=mandatory, interval(Year 0 0) by(industry) excludeself
Thanks!
0 Response to check that rangestat is used correctly
Post a Comment