Three Essays On Friendship Formation And Peer Effects