Problem with data files longer than 7 days

184 views
Skip to first unread message

Matt Patterson

unread,
Apr 15, 2020, 3:41:41 PM4/15/20
to R package GGIR
Hello, I'm not sure if anybody else is seeing this problem, but when I have a data file that is longer than 7 days, the part4 and part5 csv's ignore all days after 7.

I used the following settings:
strategy = 1
hrs.del.start = 0
hrs.del.end = 0
maxdur = 0

part4_nightsummary has only 7 nights sleep (part4.jpg)
part5_daysummary_MM has only 7 days (part5.jpg)

The visual report shows 10 full days of recording and the final 3 days have no sleeponset  or wake detections.

I also tried running with strategy = 2 with the same error.

Config included as well.

Is anyone else seeing this error? Or, am I missing something obvious?

My goal is process a folder with multiple tests, but each test can be a different number of days.

Any help is much appreciated, 

Matt





part4.jpg
part5_MM.jpg
Report_pilot_100.csv.pdf
config.csv

Vincent van Hees

unread,
Apr 15, 2020, 3:53:26 PM4/15/20
to Matt Patterson, R package GGIR
I think this is related to argument nnights, which by default in GGIR seems to be set at 7... Not good, we need to change this to c() such that the default setting is not to constrain the number of nights/days.

If you do nnights = c() or fill in the number of nights you expect in the data, it should process all of them.

Vincent


‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
--
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.

Matt Patterson

unread,
Apr 15, 2020, 3:59:51 PM4/15/20
to R package GGIR
Thanks for the response Vincent. That worked really well for me.

Yeah, I had 'nnights' commented out in my entry function, so it was defaulting to 7.

Good idea to change the default setting.

Thanks, Matt


On Wednesday, 15 April 2020 15:53:26 UTC-4, Vincent van Hees wrote:
I think this is related to argument nnights, which by default in GGIR seems to be set at 7... Not good, we need to change this to c() such that the default setting is not to constrain the number of nights/days.

If you do nnights = c() or fill in the number of nights you expect in the data, it should process all of them.

Vincent


‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Wednesday, April 15, 2020 9:41 PM, Matt Patterson <patte...@gmail.com> wrote:

Hello, I'm not sure if anybody else is seeing this problem, but when I have a data file that is longer than 7 days, the part4 and part5 csv's ignore all days after 7.

I used the following settings:
strategy = 1
hrs.del.start = 0
hrs.del.end = 0
maxdur = 0

part4_nightsummary has only 7 nights sleep (part4.jpg)
part5_daysummary_MM has only 7 days (part5.jpg)

The visual report shows 10 full days of recording and the final 3 days have no sleeponset  or wake detections.

I also tried running with strategy = 2 with the same error.

Config included as well.

Is anyone else seeing this error? Or, am I missing something obvious?

My goal is process a folder with multiple tests, but each test can be a different number of days.

Any help is much appreciated, 

Matt






--
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 Rpacka...@googlegroups.com.

John

unread,
May 18, 2020, 1:10:12 AM5/18/20
to R package GGIR
Hi Matt,
I am also having a similar issue when analysing my dataset in which the last day of data is often being missed out in Part 5 output. 
I was wondering if you also changed other arguments as well eg. ndayswindows? Or you only added in "nnights"?

Vincent van Hees

unread,
May 18, 2020, 4:51:06 AM5/18/20
to John, R package GGIR
Hi John,

When doing analysis on days defined from midnight-to-midnight (MM) in GGIR part 5 days will by default only be included if they have at least 23 hours of data (any data, valid or not valid) which can be modified with argument minimum_MM_length.part5. This applies as of GGIR 2.0.

However, I personally think it is not a good idea to include incomplete days in part 5 MM analysis. Time-use in an incomplete day is not comparable to time-use in a complete data. So, person-level averages will be biased if you combine them. In other words it is not fair to compare the fact that I was inactive in half day recording with a day on which I had full data. The magnitude of acceleration imputation we use in GGIR data does not address this issue, because imputation is only useful for measures like average acceleration, not for time-use variables. We would need an imputation of the behavioral sequence to include those incomplete days. To my knowledge this does not exist yet. Anyone interested in working on this, please reach out to me. Further, if the recording starts and stops at a midnight the sleep estimates may not be reliable for the first half and last half night. Therefore, my advice would be: If you want to work with 7 MM days in part 5, collect at least an extra 8 hours of data before and after it.

Part 2, 4 and 5 will result in a different number of days/nights because each part has a different purpose. In part 2 we are not so much interested in time-use and more on average and distribution of acceleration, which are more compatible with the imputation we use. In part 4 we only care about whether sleep can be detected.  In part 5, both sleep and daytime time use estimates need to be complete for the majority of the time.

If you have suggestions on how we can better utilize those incomplete days of data then let me know. Otherwise I think the best advise is to aim for longer recordings than just the commonly used 7 days.

Vincent


‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
To unsubscribe from this group and stop receiving emails from it, send an email to RpackageGGIR...@googlegroups.com.

Chong Kar Hau

unread,
May 21, 2020, 9:30:10 PM5/21/20
to Vincent van Hees, R package GGIR
Hi Vincent,
Thank you for the very detailed explanation about the time-use analysis with GGIR. I totally agree with you that it is not a good idea to include any incomplete days (<24h in length) in the analysis. For our projects the wearing protocol is 8 days with the first and last day being only half-monitored and thus we only considered the 6 full 24-h days in middle for the MM window analysis.
However I noticed that in  both previous and current versions of GGIR, whenever I used the argument 'excludefirstlast.part5' in MM analysis, half of the estimated sleep duration for Day 2 (the first day of 24-h monitoring) was not included in the calculated sleep variables. It seems to me that this argument ignores the first half of sleep period (midnight to wake up of Day 2) of Day 2 in the part 5 analysis too. I was able to get the full sleep duration calculated for Day 2 in Part 5 when I set this argument as FALSE, though I would have to get rid of the first and last day of the data manually. 

Best regards,

Kar-Hau, Chong (John)
PhD Candidate
Early Start  | Faculty of Social Sciences | 21.214
University of Wollongong NSW 2522 Australia
Email address: khc...@uowmail.edu.my

Vincent van Hees

unread,
Jun 4, 2020, 2:32:05 PM6/4/20
to Chong Kar Hau, R package GGIR
Hi John,
Days with less than 23 hours of data will be excluded from the MM analysis in part 5 by default, so if you set excludefirstlast.part5 = FALSE. You should be able to get only the 6 days you are interested in, but include sleep estimates for the first and last night. Or am I misunderstanding something?
Vincent



‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

Chong Kar Hau

unread,
Jun 8, 2020, 8:32:30 PM6/8/20
to Vincent van Hees, R package GGIR
Hi Vincent,
Yes, that's correct. I was able to get the sleep estimates for the 6 days in Part 5 output. However, the estimates for the first night (which is Day 2) looked strange to me. Please see attached the output of one data file (.cwa file) (using GGIR 2.0-0 version) and also the config. file.
The first variable that came to my attention was the wakeup_ts, which was shown in the pm format (17:46:40). Then the dur_spt_sleep_min shown was very short compared to the other days (<200 min or so); however, the dur_spt_min seems okay (614.5 min). 
So I did a bit of calculation to try to get the wakeup_ts: 24:00 minus sleeponset_ts of the day (21:39:45) and then minus the calculated duration (140.25 min) from dur_spt_min (614.5 min) to find out the duration of sleep from 00:00 till wake up time of Day 2, which was 474.25 min or 7:54:15 AM. However, the graph seems to suggest that the actual wake up time should be around 7 am or so: 
image.png
I am not sure if what I did was correct but I found this issue in all the data files, specifically for the first night estimates (Day 2 of wearing). It would be great to see if others also found the same issues with the Axivity data (I have no issues with GENEActiv data files though). 

Best regards,
John.


Example.xlsx
config.csv

Vincent van Hees

unread,
Sep 7, 2020, 4:50:57 AM9/7/20
to Chong Kar Hau, R package GGIR
Hi John,
This issue should have been fixed in the latest 2.1-0 release. If not, can you let us know?
Best wishes,
Vincent


Dr. Vincent van Hees
Independent consultant

ACCELTING.png



‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
Reply all
Reply to author
Forward
0 new messages