Social networks primarily focus on the phenomenon of the contagion effect when examining behavior patterns within specific social groups. However, the impact of peer effects is characterized by the tendency to imitate the behaviors of friends and the selection process, where individuals tend to affiliate with others sharing similar traits, significantly contributing to shaping social behaviors that are frequently interconnecting. This article presents a Bayesian approach that uses latent-space estimation methods to detect and examine contagion effects, considering the impact of social selection. The research provides a methodological explanation, followed by a sequence of simulation trials designed to explore operational functionalities and possible real-world applications. To illustrate the potential correlation between changes in alcohol use and the influence of social networks, this study concludes by presenting an example of adolescent drinking behavior.