Data analysis in cosmology