lhe17 / nebula

GNU General Public License v2.0
28 stars 6 forks source link

Two Boolean for One Predictor #22

Open h1hui opened 1 year ago

h1hui commented 1 year ago

Hello,

I have encountered another situation when running two different datasets. Both datasets has AD or CT as type, and for one dataset it used one boolean to distinguish AD/CT, but the other one had two. For what's more confusing, the re$summary for the latter one had two logFC, for typeAD and typeCT, and they are not the complete opposite of each other. Can you please explain why it's different for the two datasets, and how can I inteprete the result of the latter one?

Thanks, Ashley

Screen Shot 2023-05-04 at 3 33 01 PM Screen Shot 2023-05-04 at 3 34 30 PM

Screen Shot 2023-05-02 at 4 28 35 PM
lhe17 commented 1 year ago

Hi Ashley,

Thank you for your question.

re$summary gives two logFCs because this variable is coded by two dummy variables (typeAD, typeCT) in your second design matrix. A possible reason is that this variable is a factor or character variable that has more than two levels in your second data set. In this case, model.matrix will create more than one dummy variable (# of levels - 1). See more information about model.matrix via https://www.rdocumentation.org/packages/stats/versions/3.6.2/topics/model.matrix

Best regards,

Liang

On 5/5/2023 12:44 AM, Ashley Hui wrote:

Hello,

I have encountered another situation when running two different datasets. Both datasets has AD or CT as type, and for one dataset it used one boolean to distinguish AD/CT, but the other one had two. For what's more confusing, the re$summary for the latter one had two logFC, for typeAD and typeCT, and they are not the complete opposite of each other. Can you please explain why it's different for the two datasets, and how can I inteprete the result of the latter one?

Thanks, Ashley

Screen Shot 2023-05-04 at 3 33 01 PM https://user-images.githubusercontent.com/33336127/236344839-56accc5f-16de-4be4-b014-3d143e9691fe.png Screen Shot 2023-05-04 at 3 34 30 PM https://user-images.githubusercontent.com/33336127/236344844-a73704bd-26e5-4c1b-a4f3-f25a7da1e11b.png Screen Shot 2023-05-02 at 4 28 35 PM https://user-images.githubusercontent.com/33336127/236344851-9095bf59-3048-4649-a524-fe9e0e869d78.png

— Reply to this email directly, view it on GitHub https://github.com/lhe17/nebula/issues/22, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGDISURWSOV3OY5WIYGTQYTXEQWMVANCNFSM6AAAAAAXWMSIKE. You are receiving this because you are subscribed to this thread.Message ID: @.***>