NeishabouriCount_y Error with ActiGraph Count Data for Preschoolers

50 views
Skip to first unread message

Lala

unread,
Jun 4, 2024, 10:06:04 AMJun 4
to R package GGIR
Hello all,

First of all, I would like to express my sincere gratitude to Dr. Vincent van Hees, Dr. Jairo Hidalgo Migueles, and the GGIR community for their invaluable responses on the GGIR Google Group.

I am analyzing a dataset corresponding to the scenario "For externally derived ActiGraph count data in .CSV format assuming a study protocol where the sensor was not worn during the night," as illustrated in one of the examples in the manual. The protocol involved preschoolers wearing accelerometers on their hip/waist for 7 days during waking hours (15-second epoch, normal filter).

Additionally, our dataset already has non-wear time and nap time removed. Therefore, there are gaps in the 15-second intervals where non-wear time and nap time are present.

As a result, I intend to skip parts 3 and 4 and analyze only parts 1, 2, and 5.

I have tried several approaches based on the manual and the GGIR Google Group, but I keep encountering the following error message:
 
Part 2
1 Error in Math.data.frame(list(NeishabouriCount_y = c("0", "62.5", "2.5",  :
  non-numeric-alike variable(s) in data frame: NeishabouriCount_y, NeishabouriCount_x, NeishabouriCount_z, NeishabouriCount_x.1


Could you provide me with some valuable advice on what I might be missing? Below are the code and CSV file I have prepared based on the manual.

GGIR(
     #-------------------------------
     # General parameters
     #-------------------------------
     mode = c(1,2,5),
     datadir = "C:/Users/Epidemiology/Desktop/data",          
     outputdir = "C:/Users/Epidemiology/Desktop/output",      
     f0 = 1, f1 = 0,
     overwrite = FALSE,
     do.imp = FALSE,
     idloc=2,  #id is located in the filename
     print.filename = TRUE,
     storefolderstructure = FALSE,
     #=====================
     #  Part 1 parameters:
     #=====================
     windowsizes = c(15,900,3600),   # 15s epoch
     dataFormat = "actigraph_csv",
     extEpochData_timeformat = "%m/%d/%Y %H:%M:%S",
     desiredtz = "America/Denver",
     configtz = "America/Denver",
     minimumFileSizeMB = 0.05,   # Set minimum file size (50KB)
     printsummary=TRUE,
     #-------------------------------
     # Part 2 parameters:
     #-------------------------------
     data_masking_strategy = 2,
     ndayswindow = 7,
     includedaycrit = 1,   # intended to include all data
     qwindow = c(6, 22),
     mvpathreshold = 240,
     #-------------------------------  
     # Part 3, 4 parameters:
     #-------------------------------
     ignorenonwear =  TRUE,
     do.visual = FALSE,
     #-------------------------------
     # Part 5 parameters:
     #-------------------------------
     do.enmo=FALSE,
     do.neishabouricounts = TRUE,  
     acc.metric = "NeishabouriCount_y", # The cut-off for distinguishing SED, LPA and MVPA is based on Axis 1 (vertical axis).
     HASPT.algo = "NotWorn",
     HASIB.algo = "NotWorn",
     threshold.lig = c(26),       # LPA cut-point
     threshold.mod = c(420),       # MVPA cut-point
     threshold.vig = NULL,         # aim to calculate MVPA without distinguishing between MPA and VPA
     excludefirstlast = FALSE,
     boutcriter = NULL,               # Bout duration is not applied.
     boutcriter.in = NULL,
     boutcriter.lig = NULL,
     boutcriter.mvpa = NULL,
     boutdur.in = NULL,                   # Bout duration is not applied.
     boutdur.lig = NULL,           # Bout duration is not applied.
     boutdur.mvpa = NULL,           # Bout duration is not applied.
     #-------------------------------
     # Report generation
     #-------------------------------
     visualreport = FALSE,
     save_ms5rawlevels = TRUE,      
     save_ms5raw_without_invalid = FALSE,  
     do.report = c(2, 5),
)
pre005.csv

Lala

unread,
Jun 4, 2024, 10:06:04 AMJun 4
to R package GGIR
pre005.csv

Vincent van Hees

unread,
Jun 13, 2024, 10:11:29 AMJun 13
to Lala, R package GGIR
Hello Lala,

I am actually in the process of helping a group with a similar scenario which led to some enhancements to the code, but we are still testing this.

Would you mind helping to test this by in stalling GGIR with:

install.packages("remotes")
remotes::install_github("wadpac/GGIR", ref = "issues_1082Date_1089NotWorn")

Next,  make sure you GGIR cal includes:

HASPT.algo = "NotWorn",
HASIB.algo = "NotWorn",
do.imp = FALSE, # Do not impute nonwear because sensor was never worn 24/7
HASPT.ignore.invalid = NA, # Treat nonwear as potential part of guider window
ignorenonwear = FALSE, # Consider nonwear as potential sleep
relyonguider = TRUE, # has minor influence
includenightcrit = 8, # or whatever you think is realistic
includedaycrit = 8,  # or whatever you think is realistic
The error message you reported is probably related to a bug that is now also fixed.

As a result, I intend to skip parts 3 and 4 and analyze only parts 1, 2, and 5.
I understand your reasoning, but this is not how GGIR works. We need to run GGIR part 3 and 4 with argument values "NotWorn" (as shown above) in order to tell GGIR to just look for the longest non-wear period in the day and to use that as sleep window. We do this because part 5 expects a definition of waking hours versus sleep period time window.

Best wishes,

Vincent

--
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/d167ab1b-221b-4aaa-90bd-518840e5c655n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages