extract_covariates function

Extract covariate values