Covariate dependent random measures with applications in biostatistics