Adjust for covariates
0
2
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!

gene expression • 4.1k views
ADD COMMENT
0
Entering edit mode

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).

ADD REPLY
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

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.:

fit<- lm(y ~ x)
adjusted<- fit$residuals + fit$coefficients["(Intercept)"]

(Make sure this is correct and makes sense to you and your collaborators)

ADD REPLY
1
Entering edit mode

Could you explain why residual rather than fitted value for adjusted value ? Residual is observed - fitted so adjusted value (covariate corrected) should be fitted ?

ADD REPLY
0
Entering edit mode

Thanks for the reply!! I think this might do it!

ADD REPLY

Login before adding your answer.

Traffic: 2078 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6