GGIR Part5 – Incomplete 24h days not included in summary

40 views
Skip to first unread message

Ines Ebner

unread,
Mar 24, 2025, 9:13:04 AMMar 24
to R package GGIR

Hi everyone,

I’m working with GeneActiv .bin files recorded at 50 Hz over 5 to 14 days.

I would like to include as much data as possible in the Part 5 summary. However, I noticed that only full 24h days are being included, even though I have the following settings in my GGIR script:

---- 
r
includedaycrit.part5 = 0.5, excludefirstlast.part5 = FALSE, includenigthcrit.part5 = 0
-----
full GGIR skript I use:
-------
```{r}
library(GGIR)
GGIR(mode=c(1,2,3,4,5),
      datadir="E:/GeneActiv_Analysis/Data", #Hier individueller Path zu der Datei/Dateien einfügen achte auf die richtigen Slashs /
      outputdir="E:/GeneActiv_Analysis", #nicht das gleiche  wie bei datadir
      do.report=c(1,2,3,4,5), f0 = 1, f1 = 0, #wenn in data mehr als eine Datei liegt, muss f1 = 0 entsprechend der Anzahl der Datein angepasst werden
          studyname = "1-16-SLE CASTLE", verbose = TRUE, overwrite=TRUE,
#=====================
  #Part1 parameters
#=====================
  windowsizes = c(5,900,3600),
    use.temperature = TRUE,
  do.cal=TRUE,
  do.enmo=TRUE,
    acc.metric = "ENMO",
  do.anglez=TRUE,
  chunksize=1,
  printsummary=TRUE,
      #=====================
      # Part 2
      #=====================
      strategy = 1,
      hrs.del.start = 0,          hrs.del.end = 0,
      includedaycrit = 12,
      qwindow=c(0,24),
      mvpathreshold =c(93.2),
      excludefirstlast = FALSE,
      includenightcrit = 0,
      #=====================
      # Part 3 + 4
      #=====================
      def.noc.sleep = 1,
      outliers.only = FALSE,
      criterror = 4,
      do.visual = FALSE,
      #=====================
      # Part 5
      #=====================
     
      threshold.lig = c(45.8), threshold.mod = c(93.2),  threshold.vig = c(418.3),
      boutcriter = 0.8,      boutcriter.in = 0.9,     boutcriter.lig = 0.8,
      boutcriter.mvpa = 0.8, boutdur.in = c(10,20,30), boutdur.lig = c(1,10,30),
      boutdur.mvpa = c(1,10,30),
      includedaycrit.part5 = 0.5,
      includenigthcrit.part5=0,
      excludefirstlast.part5 = FALSE,
      #=====================
      # Visual report
      #=====================
      timewindow = c("MM"),
      visualreport=TRUE,
------

In Part 2, I can see that one day has 17 valid hours (April 15, 2023), but this day is not included in the Part 5 person summary. Instead, only the 3 full days (April 12–14) are counted, even though I thought the 17-hour day should qualify based on the includedaycrit.part5 = 0.5 setting.

Does anyone know why the 17-hour day is excluded in Part 5? I don't get it.... 
Any help or clarification would be greatly appreciated! I post you the part2 and part5 files. 

Thank you and best regards,
Ines


part2_daysummary_example.csv
part5_personsummary_MM_L45.8M93.2V418.3_T5A5_example.csv

Vincent van Hees

unread,
Apr 4, 2025, 7:00:15 AMApr 4
to Ines Ebner, R package GGIR
This is intentional, including incomplete days when doing time use analysis, as part 5 does, will bias your results.

Possible solutions:
  • Analyse data from wake-up to wake-up or from sleep onset to sleep onset which may align better with the start and end time of your study compared with midnight-midnight  day windows. https://wadpac.github.io/GGIR/articles/chapter12_TimeUseAnalysis.html
  • For future studies: Collect more days of data. I think at least N + 3 days of data if you want to quantify behaviour across a N day period. One of the major limitations of for example UK Biobank accelerometer data is that it was collected over only 7x24 hours making it impossible to reliably quantify both sleep and day time activity for 7 consecutive days.

That said, I think you missed parameter minimum_MM_length.part5 which is a way to make GGIR a bit more tolerant to incomplete days when working with midnight-midnight (MM) windows, but as I mentioned above this would introduce bias if not done carefully. For example, you can only use it if you are convinced that the missing data on those days is reflected by time spent in behavioural classes that are not used in your research. I think this is very tricky and I would advise against it.

Best,

Vincent

Dr. Vincent van Hees | Independent consultant | https://accelting.com/
image

--
You received this message because you are subscribed to the Google Groups "R package GGIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to RpackageGGIR...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/RpackageGGIR/e777cc22-6025-4ece-ad30-8bb4416f1e31n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages