Sampling and inference in social networks