Viariable "dur_day_spt_min" in part5_personsummary_MM

125 views
Skip to first unread message

ZHANG JIAQI

unread,
Apr 5, 2025, 3:14:34 AMApr 5
to R package GGIR
Hi, Vincent,

Thank you for all the effort in GGIR.

We are currently using GGIR package 3.2 for PA analyses. However, when looking at the variable "dur_day_spt_min" in the output file "part5_personsummary_MM_L30M100V245_T5A5", the time spent in sleep and wake totaled exceeding 24 hr (1440 min). Since this is midnight to midnight window, I assume that every window size should be equivalent to 1440 min. Then, I checked the "part5_daysummary_full_MM_L30M100V245_T5A5" from the QC file and found that every ID had their "dur_day_spt_min" around 2880 min in their last window. I was quite confused by the results and I hope you can help me figure out what went wrong in my analyses.

Many thanks,
Jiaqi


Below are my scripts:

GGIR(mode=c(1,2,3,4,5),
     datadir = "F:/!! File Transfer/Full Raw Data",
     outputdir = "F:/!! File Transfer",
     do.parallel = TRUE,
     chunksize = 0.2,
     
     do.report=c(2,4,5),
     idloc = 5,
     dynrange = 8,
     
     printsummary = TRUE,
     #=====================
     # Part 2
     #=====================
     data_masking_strategy = 1,
     hrs.del.start = 0,          hrs.del.end = 0,
     maxdur = 7,                 includedaycrit = 16,
     Sadeh_axis = "Y",
     qlevels = c(c(840/1440), c(1140/1440), c(1320/1440), c(1380/1440),
                 c(1410/1440), c(1415/1440), c(1420/1440), c(1425/1440),
                 c(1430/1440), c(1435/1440), c(1439/1440)),
     qwindow=c(0,24),
     mvpathreshold =c(100),
     mvpadur = c(1, 5, 10),
     boutcriter = 0.8,
     includenightcrit = 16,
     iglevels = TRUE,
     
     #=====================
     # Part 3 + 4
     #=====================
     excludefirstlast = TRUE,
     def.noc.sleep = 1,
     criterror = 2,
     do.visual = TRUE,
     
     #=====================
     # Part 5
     #=====================
     threshold.lig = c(30),  threshold.mod = c(100),  threshold.vig = c(245),
     boutcriter.in = 0.9,    boutcriter.lig = 0.8,
     boutcriter.mvpa = 0.8,
     boutdur.in = c(10, 30), boutdur.lig = c(1, 5, 10),
     boutdur.mvpa = c(1, 5, 10),
     includedaycrit.part5 = 2/3,
     winhr = c (0.017, 0.083, 0.167, 0.25, 0.333, 0.417, 0.5, 1, 2, 5, 10),
     qM5L5 = 0.25,
     require_complete_lastnight_part5 = TRUE,

     #=====================
     # Visual report
     #=====================
     timewindow = c("MM","WW"),
     visualreport=TRUE)

part5_personsummary_MM_L30M100V245_T5A5.csv
part5_daysummary_MM_L30M100V245_T5A5.csv
part5_daysummary_full_MM_L30M100V245_T5A5.csv

Vincent van Hees

unread,
Apr 9, 2025, 10:30:15 AMApr 9
to ZHANG JIAQI, R package GGIR
Dear Jiaqi,

Thanks for reporting this.
To allow me to reproduce and investigate the error could you share with me an example .RData file from the meta/basic output subfolder?

Thanks,

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/808443f4-1fbc-4225-a121-9dd7cd55dd24n%40googlegroups.com.

ZHANG JIAQI

unread,
Apr 12, 2025, 8:10:22 AMApr 12
to R package GGIR
Thanks for your reply. I have attached two examples of .RData file from the meta/basic output subfolder of my dataset.

Regards,
Jiaqi

meta_S1.017 (2024-09-14).gt3x.RData
meta_S1.016 (2024-09-13).gt3x.RData

Vincent van Hees

unread,
Apr 22, 2025, 9:18:02 AMApr 22
to ZHANG JIAQI, R package GGIR
Thanks Jiaqi,

I identified a bug that is specific tot the combined use of excludefirstlast = TRUE and timewindow = "MM".

I have drafted a fix which you can test by installing GGIR via:
remotes::install_github("wadpac/GGIR", ref = "issue1292_define_days_when_nights_excluded")

My plan is to merge it in the upcoming days and to include it in the next GGIR release..

Thanks,

Vincent

ZHANG JIAQI

unread,
Apr 29, 2025, 3:21:50 AMApr 29
to R package GGIR
Dear Vincent,

Thank you very much for your prompt response and assistance with this matter.

I have tested the code you provided and observed that the variable dur_day_spt_min in the output file part5_personsummary_MM_L30M100V245_T5A5 has been successfully corrected. However, I noticed slight changes in the values of other variables as well following the modification.

Could you please kindly inform whether these changes are expected and align with the intended adjustments?

Thank you for your support.

Regards,
Jiaqi

Vincent van Hees

unread,
May 1, 2025, 10:29:21 AMMay 1
to ZHANG JIAQI, R package GGIR
Dear Jiaqi,

Thanks for reporting back. Yes, if the definition of a day window changes as was the case than all variables for that day are likely to change since they are calculated over a different time window and by that different data. However, for the days for which the duration has remained unchanged the other values should also be the same.

Please note that I have integrated this update in the new GGIR 3.2-6 release.

Best regards,

Vincent

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

Reply all
Reply to author
Forward
0 new messages