How do i do calculations within a table based on groups
이전 댓글 표시
Hi everyone,
so I have a table which basically has data from a qPCR ( method to measure gene expression).
I have data like this:

I now want to caluculate the deltadeltaCt value which is:
deltadeltaCt = deltaCt value - deltaCtvalue(Ctr)
Every Genotype has its own control. This corresponds to the deltaCt value of the condition 'Ctr'.
For example i would want to calculate:
8,3817 - 8,3817
7,5029 - 8,3817
7,7519 - 8,3817
and in this case ofter the third calculation the value of the deltaCt(control) has to change because it is a different Genotype.
My guess was to use groups and splitapply but so far, I just coudn't get it to run as I want.
I hope you understand what i mean and one of you can probably help.
Thanks and best regards
Julian
댓글 수: 2
madhan ravi
2019년 9월 8일
Attach the table as .mat file.
dpb
2019년 9월 8일
As madhan suggests, having the data to use to illustrate makes things much simpler for those here...showing what code you used specifically and what the result was and what was different than what you expected also would be key--we don't know what "your guess" entailed.
I would strongly suggest you turn the various cellstr() type variables in the table into categorical ones--things will work more cleanly/efficiently that way with the grouping variables.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Data Type Identification에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!