Advice for a code for my master

126 views
Skip to first unread message

Bryan Montero

unread,
Aug 16, 2022, 11:13:03 PM8/16/22
to R package GGIR

Hello everyone,

First of all, thank you for developing this program.

I am working on a database for my master thesis that had 128 participants (overweight and obese). They wore the ActiGraph on the hip for 7 consecutive days or a bit longer just during the waking hours. I am not aware of cut points designed yet for this population, so I will attach to Hildebrand (2014, 2016) threshold intensity cut points for adults: light (47.4 mg), moderate (69.1 mg), and vigorous (258.7 mg).

Before running the complete sample, I decided to just do 14 participants and in that manner be able to correct any mistakes. In advance, my apologies for all the questions:

1.       Is it possible for the code to just gave 7 days with at least 10 hours? It is because in the QC folder files I am getting more than 7.

2.       I may be wrong when did it, but I created two other thresholds considering the three previous thresholds, those were: inactivity (0, 47.4) and MVPA (69.2,258.6). Was I supposed to do it in that way, or did the code already read that anything below 47.4 is inactivity, and above 69.1 and below 258.7 is MVPA?

3.       I am getting no results for MVPA, is that maybe because of the wrong MVPA category I made?

4.       I tried to define in the code that devices were not worn during sleeping hours, to do that I decided def.noc.sleep = c(23,6) but presented some problems, has anyone been able to do it? Because in timewindow = "MM", I used this criteria.

5.       I received at the end a warning message that says “unknown timezone 'CDT' ”, but I sought Chicago, Illinois, or a near city time zone in this link https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

Code:

install.packages("remotes")

remotes::install_github("wadpac/GGIR")

install.packages("GGIR", dependencies = TRUE)

#install.packages("GGIR", dependencies = TRUE)

library(GGIR)


g.shell.GGIR(

  mode=c(1,2,3,4,5),

  datadir= "C:/Users/bryan/OneDrive/Escritorio/GGIR/PATH_TEST",

  outputdir="C:/Users/bryan/OneDrive/Escritorio/GGIR/OUTPUT",

  f0 =1,

  f1= 14,

desiredtz ="CDT",

  do.report=c(2,4,5),

  print.filename= TRUE,


  windowsizes = c(5,60,3600),

  do.cal=TRUE,

  do.enmo = TRUE,

  do.anglez=TRUE,

  chunksize=1,


  strategy = 1,

  hrs.del.start = 0,

  hrs.del.end = 0,

  maxdur = 7,   

  includedaycrit = 10,

  M5L5res = 5,

  winhr = 5,

  qlevels = c(0.25, 0.50, 0.75, 0.99),

  qwindow= c(0,24),

  ilevels = c(0, 47.3, 47.4, 69.1, 69.2, 258.6, 258.7, 8000),

  iglevels = c(seq(0,4000,by=25),8000), 

  mvpathreshold = c(69.2, 258.6),

  mvpadur= c(1,5,10),

  bout.metric = 4,

  #closedbout = FALSE, 


  anglethreshold = 5,

  timethreshold = 5,

  acc.metric="ENMO",

  ignorenonwear=TRUE,

  overwrite=FALSE,

  constrain2range=TRUE,

  do.part3.pdf=TRUE,

  do.parallel=FALSE,


  excludefirstlast = FALSE,

  includenightcrit = 18,

  def.noc.sleep = 1,

  outliers.only = FALSE,

  criterror = 4,

  relyonsleeplog = FALSE,

  do.visual = TRUE,

  printsummary=TRUE,


  excludefirstlast.part5 =FALSE,

  threshold.in = c(0,47.3),

  threshold.lig = c(47.4),

  threshold.mod = c(69.1),

  threshold.mvpa = c(69.2,258.6),

  threshold.vig = c(258.7),

  boutcriter = 0.8,

  boutcriter.in = 0.9,        

  boutcriter.lig = 0.8,

  boutcriter.mvpa = 0.8,      

  boutcriter.vig = 0.8,       

  boutdur.in = c(5,10,20,30),

  boutdur.lig = c(5,10,20,30),

  boutdur.mvpa = c(1,5,10),

  boutdur.vig = c(1,5),


  timewindow = "MM", #From midnight to midnight which equals a calendar day, meaning that a night of sleep

  visualreport=TRUE)

Thank you so much for your help,

Bryan

Report_PA002_PreRAW.csv.pdf
Report_PA016_PreRAW.csv.pdf
Report_PA003_PreRAW.csv.pdf

Vincent van Hees

unread,
Aug 18, 2022, 11:51:18 AM8/18/22
to Bryan Montero, R package GGIR

Hi Bryan,​

1.       Is it possible for the code to just gave 7 days with at least 10 hours? It is because in the QC folder files I am getting more than 7.

The pdf plots as stored in the QC folder ​always show you all the data, because they are only intended for quality checking and when we QC the data we want to know how long a recording lasted.

See GGIR documentation for arguments maxdur and max_calendar_days which are to tell GGIR to ignoring after a certain number of recording days.

2.       I may be wrong when did it, but I created two other thresholds considering the three previous thresholds, those were: inactivity (0, 47.4) and MVPA (69.2,258.6). Was I supposed to do it in that way, or did the code already read that anything below 47.4 is inactivity, and above 69.1 and below 258.7 is MVPA?

By specifying:

mvpathreshold = c(69.2, 258.6), # affects GGIR part 2 output

and

threshold.mvpa = c(69.2,258.6), # affects GGIR part 5 output

you tell GGIR to run the MVPA analyses twice, once with a 69.2 threshold, and once with 258.6 threshold. MVPA does not have an upper threshold, because it is moderate and vigorous PA. There is no higher intensity than vigorous within GGIR.

3.       I am getting no results for MVPA, is that maybe because of the wrong MVPA category I made?

Depending on the acceleration metric you use and the study population 258.6 can be a very high threshold for MVPA, which would explain why you see very little or no time spent  in MVPA for it.

4.       I tried to define in the code that devices were not worn during sleeping hours, to do that I decided def.noc.sleep = c(23,6) but presented some problems, has anyone been able to do it? Because in timewindow = "MM", I used this criteria.

That functionality was indeed broken for a while (in the current CRAN release too I believe), but should be fixed now in the GGIR development version, which can be installed via:

install.packages("remotes")
remotes::install_github("wadpac/GGIR")

5.       I received at the end a warning message that says “unknown timezone 'CDT' ”, but I sought Chicago, Illinois, or a near city time zone in this link https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

You need the column that says "timezone data base". In your case the value would then be "America/Chicago".

Best,

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/951a8616-f755-4331-a9a8-1e82154ec48fn%40googlegroups.com.

Bryan Montero

unread,
Aug 19, 2022, 7:12:27 PM8/19/22
to R package GGIR
Hi professor van Hees,

Thank you so much for taking the time to go over my questions.

Regarding the sleep time on part 4, I reinstalled R and GGIR and ran the code having this message

Warning message: loglocation was specified and def.noc.sleep does not have length of 1, this is not compatible.  We assume you want to use the sleeplog and misunderstood argument def.noc.sleep. Therefore, we will reset def.noc.sleep to its default value of 1

#=====================
  # Part 4: Key functions: Integrating sleep log (if available) with sleep detection
  #=====================

  excludefirstlast = FALSE,
  includenightcrit = 18, 
  def.noc.sleep = c(23,6), 

  outliers.only = FALSE,
  criterror = 4,
  relyonsleeplog = FALSE,
  do.visual = TRUE,
  printsummary=TRUE,

Should I delete part 4 on my code considering that devices were only used during waking hours?

Sincerely,

Bryan

Vincent van Hees

unread,
Aug 30, 2022, 11:51:15 AM8/30/22
to Bryan Montero, R package GGIR
​Regarding:

Warning message: loglocation was specified and def.noc.sleep does not have length of 1, this is not compatible.  We assume you want to use the sleeplog and misunderstood argument def.noc.sleep. Therefore, we will reset def.noc.sleep to its default value of 1

Try:

loglocaton = c(),

The only other explanation I can think of is that you have not successfully update GGIR to the development version: 2.7-4.

Vincent

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