0

I am trying to figure out how to calculate Area Under Curve or AUC of a time series composed by one "time" variable in POSIXct format, and another numerical variable (RQ in my case). What I want to do, in the end, is to compare the AUC of the variable RQ between males and females (I am working with mice). For that, I need the AUC value and the error/deviation of the AUC. I previously plotted the data and it looks like this:

enter image description here .

There I ploted WT vs TG, but is the same as Females and males. The shadowed areas correspond to dark hours (that is, during the night).

I grouped the data for each individual mice to see if I have differences, and I saw none, but I would try to compare the AUCs, because when I do the group by Mice, I have more info for each individual, but I lose a lot of info of the general behavior of the RQ variable.

The data frame looks like this:

enter image description here

My variables are:

  • Mice (the identification code for each mice, categorical variable)
  • Absolute_time (variable time in POSIXct format, goes from 2021-04-28 15:29:42 to 2021-04-30 11:01:42 and I have info for all mice every minute)
  • RQ (numerical variable I want to test)
  • Sex (categorical variable I want to test, 2 levels: female and male)

If you think about any other way two compare 2 curves, I am also interested to hear your ideas.

  • Could you add what has failed? Looks like you need to first choose a modeling approach you want to take? – NelsonGon Dec 29 '21 at 16:28
  • 1
    [See here](https://stackoverflow.com/q/5963269/5325862) on making a reproducible example that is easier for folks to help with, including code and data that we can work with (not a picture of it). What exactly would the AUC represent here? I'm familiar with it as a diagnostic for models, like comparing true & false positive rates, but not this – camille Dec 29 '21 at 16:31

0 Answers0