A POSITIVE ASSOCIATION BETWEEN SOCIAL TIES HAS BEEN REPORTED BETWEEN SOCIAL RELATIONSHIPS OR PEER INTERACTIONS AND BETTER PERFORMANCE. HOWEVER, THESE FINDINGS WERE REPORTED USING TRADITIONAL DESCRIPTIVE METHODS THAT SUFFERED ENDOGENEITY, POSITING A SERIOUS THREAT TO THE INFERENCES MADE. MOREOVER, LITTLE IS KNOWN ABOUT HOW THE NETWORKS OF FRIENDSHIPS IN A MEDICAL SCHOOL FORM AND WHAT FACTORS DERIVE THE COMMUNITY STRUCTURE. THIS STUDY WAS DONE TO EVALUATE THE FACTORS THAT SHAPED THE SOCIAL STRUCTURE OF MEDICAL STUDENTS' COMMUNITIES WITH PARTICULAR EMPHASIS ON THE ROLE OF ACADEMIC PERFORMANCE AND GENDER DIFFERENCES. THE RESULTS OF THE CORRELATION TEST BETWEEN THE SOCIAL POPULARITY MEASURES AND PERFORMANCE WERE STATISTICALLY SIGNIFICANT IN THE MALE GROUP AND INSIGNIFICANT IN THE FEMALE GROUP. THIS VARIANCE MIGHT POINT OUT TO A DIFFERENT MECHANISM OF COMMUNITY BUILDING AND SOCIAL TIES THAT DIFFERS AMONG GENDERS. TO INVESTIGATE THE FACTORS THAT AFFECT COMMUNITY BUILDING, WE USED EXPONENTIAL-FAMILY RANDOM GRAPH MODELS TO MODEL THE NETWORKS AND IDENTIFY THE FACTORS THAT BEST PREDICT THE EMERGENCE OF TIES. THE MALE NETWORK INCLUDED 69 NODES AND 365 EDGES. BESIDES RECIPROCITY, TRIANGLE CLOSURE, THE CITY OF RESIDENCE, OUT-DEGREE AND IN-DEGREE POPULARITY; THE ACADEMIC PERFORMANCE WAS A SIGNIFICANT FACTOR IN TERMS OF BOTH THE GPA AND THE DIFFERENCE BETWEEN GRADES OF BOTH NODES. IN THE FEMALE NETWORK, (50 NODES AND 176 EDGES), ACADEMIC PERFORMANCE WAS A NOT SIGNIFICANT FACTOR, BOTH THE GPA AND THE DIFFERENCE BETWEEN GRADES OF BOTH NODES; WHILE RECIPROCITY, TRIANGLE CLOSURE, THE CITY OF RESIDENCE, OUT-DEGREE AND IN-DEGREE POPULARITY WERE. THE FINAL MODEL IN MALE AND FEMALE NETWORK SHOWED A HIGH DEGREE OF GOODNESS-OF-FITNESS STATISTICS. THESE RESULTS HIGHLIGHT THE ISSUE OF HOMOPHILY ON PERFORMANCE, AS A SIGNIFICANT FACTOR IN HOW MALES IN THIS STUDY BUILD THEIR FRIENDSHIP NETWORK IN CONTRAST TO FEMALES. IT ALSO EMPHASIZES THE NEED FOR BETTER INFERENTIAL MODELS THAT GENUINELY CAPTURE THE NETWORK EFFECT ON PERFORMANCE BEFORE JUMPING TO CONCLUSIONS USING TRADITIONAL DESCRIPTIVE MODELS THAT SUFFER THE RISK OF ENDOGENEITY.