Part 5 - Physical Activity

58 views
Skip to first unread message

Alja Bijlsma

unread,
Oct 20, 2021, 11:11:38 AM10/20/21
to R package GGIR
Dear all, 

I am new in the Actigraphy and R/GGIR world, so I hope someone can help me.

For my research project a group of preterm born and term born children currently aged 3 years old used the GENEActiv actiwatch located on their wrist for 5-7 days. Our main goal is to assess the sleep characteristics in both groups, using the GGIR package. But we are also interested in the type/amount of physical activity of the children.

Our script for part 5 is:

 # Part 5 parameters:
             #-------------------------------
             save_ms5rawlevels = TRUE,
             # Key functions: Merging physical activity with sleep analyses --> BASE ON LITERATURE
             threshold.lig = (5.3/85.7) * 1000,        # --> zie GGIR vignet 2.3.4 obv Roscoe
             threshold.mod = (8.6/85.7) * 1000,        # --> zie GGIR vignet 2.3.4 obv Roscoe
             # threshold.vig = (VigorousCutPointFromPaper/85.7) * 1000,  # --> zie GGIR vignet 2.3.4 obv, echter in Roscoe cutpoints vigorous niet aanwezig (was niet te meten bij preschoolers)
             threshold.lig = c(30), #40 #threshold(s) for inactivity (can be more than one number)
             threshold.mod = c(100), #100 120 #threshold(s) for moderate activity (can be more than one number)
             threshold.vig = c(400), #500 #threshold(s) for vigorous activity (can be more than one number)
             excludefirstlast = FALSE,
             boutcriter = 0.8,
             boutcriter.in = 0.9, #0.8 #fraction of an inactivity bout that needs to be below the threshold (needs to be 1 number)
             boutcriter.lig = 0.8, #fraction of an light activity bout that needs to be between the thresholds (needs to be 1 number)
             boutcriter.mvpa = 0.8, #fraction of an light activity bout that needs to be above the threshold (needs to be 1 number)
             boutdur.in = c(10,20,30), # duration of bouts to be calculated (default value)
             boutdur.lig = c(1,5,10), # duration of bouts to be calculated (default value)
             boutdur.mvpa = c(1,5,10), # duration of bouts to be calculated (default value)
             timewindow = c("WW","MM"), 

Is this part sufficient to extract the physical activity parameters (eg. How much time in minutes a child spend in light or moderate physical activity per day)? Or is part 5 only usable for merging the physical activity with the sleep analyses?

Thanks for your help.

Best, Alja 

Vincent van Hees

unread,
Oct 24, 2021, 3:57:28 PM10/24/21
to Alja Bijlsma, R package GGIR
Dear Alja,

You are providing some of the arguments such as threshold.lig twice, make sure that you provide every argument only once.

If you want to use Roscoe then it seems you are missing argument: do.enmoa = TRUE, do.enmo = FALSE, and acc.metric="ENMOa".

Note you can re-run specific parts if you want to explore different approaches.

Yes, you can use the GGIR part 5 output for this, but you still need to run GGIR parts 1, 2, 3 and 4, because the will be used as input for part 5.

Re. boutdur... and boutcriter... arguments => I think this should be part of scientific debate as it very much relates to how we define 'activity'. I am not sure I should be the one to recommend one way or the other.

Best wishes,

Vincent

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

‐‐‐‐‐‐‐ 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.
To view this discussion on the web, visit https://groups.google.com/d/msgid/RpackageGGIR/789e55db-5096-4cbc-bbcd-a29e99c99c39n%40googlegroups.com.

Alja Bijlsma

unread,
Oct 28, 2021, 11:50:46 AM10/28/21
to R package GGIR
Dear Vincent,

Thanks for your answer. 
In the script I am using these arguments: do.enmoa = TRUE, do.enmo = FALSE, and acc.metric="ENMOa" are in part 1, see below. I think that is correct or not? 
# Part 1 parameters:
             #-------------------------------
             # Key functions: reading file, auto-calibration, and extracting features
             windowsizes = c(5,900,3600), #Epoch length, non-wear detection resolution, non-wear detection evaluation window
             do.cal= TRUE, # Apply autocalibration? (recommended)
             do.enmoa = TRUE, #Needed for physical activity analysis --> zie GGIR vignet 2.3.4 obv Roscoe
             do.enmo = FALSE,#Needed for physical activity analysis --> zie GGIR vignet 2.3.4 obv Roscoe
             acc.metric='ENMOa', #comment is needed for Roscoe --> zie GGIR vignet 2.3.4 obv Roscoe
             do.angley=TRUE, #Needed for sleep detection
             do.anglez=TRUE, #Needed for sleep detection
             chunksize=1, #size of data chunks to be read (value = 1 is maximum)
             printsummary=TRUE,
             #-------------------------------

And I am aware that I have to run al the GGIR parts to get the output of the sleep and physical activity. 
You mentioned that I am providing some arguments twice in part 5, do you mean that e.g.   threshold.lig = (5.3/85.7) * 1000,   will get the same output as  threshold.lig = c(30), #40 #threshold(s) for inactivity (can be more than one number)?

Thanks for the clarification. 

Best Wishes, Alja


Op zondag 24 oktober 2021 om 21:57:28 UTC+2 schreef Vincent van Hees:

Vincent van Hees

unread,
Nov 1, 2021, 4:04:52 PM11/1/21
to Alja Bijlsma, R package GGIR
Dear Alja,

To provide two threshold values you need to do:

argumentname = c(value1, value2)

So, in your case:
threshold.lig = c((5.3/85.7) * 1000, 30)
threshold.mod = c((8.6/85.7) * 1000, 100)

This means that argument threshold.lig is assigned a vector of two thresholds, and GGIR will use all thresholds in the vector.

In R you can never provide the same argument twice. R will only use one of them without clearly communicating which value was used. I will have a look whether I can make GGIR raise a warning when a user accidentally provides an argument value twice.

Best wishes,
Vincent


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