This paper analyzes the endogeneity bias problem caused by associations of members within a network when the spatial autoregressive (SAR) model is used to study social interactions. When there are unobserved factors that affect both friendship decisions and economic outcomes, the spatial weight matrix (sociomatrix; adjacency matrix) in the SAR model, which represents the structure of a friendship network, might correlate with the disturbance term of the model, and consequently result in an endogenous selection problem in the outcomes. We consider this problem of selection bias with a modeling approach. In this approach, a statistical network model is adopted to explain the endogenous network formation process. By specifying unobserved components in both the network model and the SAR model, we capture the correlation between the processes of network and outcome formation, and propose a proper estimation procedure for the system. We demonstrate that the estimation of this system can be effectively done by using the Bayesian method. We provide a Monte Carlo experiment and an empirical application of this modeling approach on the friendship networks of high school students and their interactions on academic performance in the Add Health data.