# peermean **Repository Path**: arlionn/peermean ## Basic Information - **Project Name**: peermean - **Description**: Stata module to compute mean of Peer firms - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-05-03 - **Last Updated**: 2024-05-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # peermean ## 1. 介绍 Stata module to compute mean of Peer firms. ## 2. 安装 ```stata ssc install gitee, replace gitee install arlionn/peermean/src, replace ``` 版本信息如下: ```stata . which peermean D:/stata/plus\p\peermean.ado *! version 1.1 16Nov2023 *! Version: 1.0 2jan2008 *! Author: Yujun Lian, arlionn@163.com ``` ## 3. 计算思路 Suppose there are 4 firms in an industry with output y {1, 2, 3, 4}. They are peers of each other. When we consider firm A, its peers include firm B, firm C and firm D. The mean of output of firm A's peers equals y_mean{-A} = (2+3+4)/3. In general, the peer mean can be calculated by the following formula: ```stata -------------------------------------------------------------------- 1 y[peerx] = -----(y1+y2+...+y[i-1]+ +y[i+1]+...+y[N]) N-1 1 = -----(y1+y2+...+y[i-1] + y[i] +y[i+1]+...+y[N] - y[i]) N-1 N 1 = -----(y_mean) - ----- y[i] N-1 N-1 = w1*y_mean - w2*y_i -------------------------------------------------------------------- where, w1 = N/(N-1) and w2 = 1/(N-1) ``` ## 4. 范例 ```stata *-Data setup sysuse "nlsw88.dta", clear keep if industry<=3 keep wage hours industry bysort industry: gen Ni = _n keep if Ni<=industry replace wage = int(wage) list, sepby(industry) clean *-peer mean peermean wage, by(industry) *-Results list indust wage Ni wage_peer, sepby(industry) abb(15) +-----------------------------------------------+ | industry wage Ni wage_peer | |-----------------------------------------------| 1. | Ag/Forestry/Fisheries 11 1 0 | |-----------------------------------------------| 2. | Mining 5 1 40 | 3. | Mining 40 2 5 | |-----------------------------------------------| 4. | Construction 11 1 8.5 | 5. | Construction 11 2 8.5 | 6. | Construction 6 3 11 | +-----------------------------------------------+ ``` ## 5. 参考文献 - Adhikari, B. K., & Agrawal, A. (2018). Peer influence on payout policies. Journal of Corporate Finance, 48, 615–637. [Link](https://doi.org/10.1016/j.jcorpfin.2017.12.010), [PDF](http://sci-hub.ren/10.1016/j.jcorpfin.2017.12.010), [Google](). - Bird, A., Edwards, A., & Ruchti, T. G. (2018). Taxes and Peer Effects. The Accounting Review, 93(5), 97–117. [Link](https://doi.org/10.2308/accr-52004), [PDF](http://sci-hub.ren/10.2308/accr-52004), [Google](). - Chen, Y.-W., Chan, K., & Chang, Y. (2019). Peer effects on corporate cash holdings. International Review of Economics & Finance, 61, 213–227. [Link](https://doi.org/10.1016/j.iref.2019.02.008), [PDF](http://sci-hub.ren/10.1016/j.iref.2019.02.008), [Google](). - Peng, Z., Lian, Y., & Forson, J. A. (2020). Peer effects in R&D investment policy: Evidence from China. International Journal of Finance & Economics, 26(3), 4516–4533. Portico. [Link](https://doi.org/10.1002/ijfe.2028), [PDF](http://sci-hub.ren/10.1002/ijfe.2028), [Google]().