Estimation and Inference for Network Data