How do i do calculations within a table based on groups
Mostrar comentarios más antiguos
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 comentarios
madhan ravi
el 8 de Sept. de 2019
Attach the table as .mat file.
dpb
el 8 de Sept. de 2019
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.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Data Type Identification en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!