Entering edit mode
6.9 years ago
bsmith030465
▴
240
Hi,
Sorry for the naive question! I want to adjust for some covariates in my expression data such that the output is 'adjusted' for the covariates? For example:
INPUT: expression matrix COVARIATES: tissue, location, age, outcome
DESIRED OUTPUT (asked by collaborator): 'adjusted' expression matrix
Do I just need the fitted values from output of 'lm'? Or am I just thinking this incorrectly?
thanks!
Ask your collaborator why he/she wants the adjusted values, since it's better to adjust for the covariates while doing the analysis (e.g., including them in the model).
Yes, that's what I thought. I think they want to do the subsequent analysis themselves (try out a few things), and have asked for the adjusted matrix, at least for tissue, location & age.
In my understanding "adjusted for..." means the value that the response data points would have if they had the same covariates. I.e. the expressions if all the samples had the same tissue, location, age, and outcome. In this case, you would take the residuals from the model (rather than the fitted values). Possibly add the intercept to the residuals to make the values comparable to the real ones rather than with mean 0. E.g.:
(Make sure this is correct and makes sense to you and your collaborators)
Could you explain why residual rather than fitted value for adjusted value ? Residual is observed - fitted so adjusted value (covariate corrected) should be fitted ?
Thanks for the reply!! I think this might do it!