class_name & class_id not very clear

61 views
Skip to first unread message

Jannick Mauron

unread,
Feb 15, 2024, 9:13:45 AM2/15/24
to R package GGIR
Hey Vincent

I have another question to which I haven't found an answer yet. Neither on the GGIR website, in the paper nor in the google group. 

If I add "save_ms5rawlevels = TRUE," in part 5 of the code, there are two additional files generated.
In the behavioralcodesYYYY-MM-DD.csv file, there are the default 16 levels of activity stored with their respective class_name and class_id. Is there somewhere a more detailed description of what these activity levels mean? Some are intuitive (0 = sleep) whereas others aren't. Can you provide some detailed information?

Best,
Jannick

Michael Rueschman

unread,
Feb 15, 2024, 11:22:29 AM2/15/24
to R package GGIR
For reference, this is what one of my behavioralcodes CSV file looks like:

2024-02-15_10h34_27.png

Here's my best guess on some of the components of the class names:
  • spt/day -> In the sleep period time window (spt) or not in the sleep period time window (day). spt_sleep is the estimated time asleep in the SPT-window; spt_wake_* classes are estimated time awake in the SPT-window.
  • IN/LIG/MOD/VIG/MVPA -> Levels of activity (Inactive, Light, Moderate, Vigorous, Moderate+Vigorous)
  • unbts/bts -> Unbouts and bouts. Unbouts are typically short(er) bursts of a given class. Bouts are sustained periods in given class.
  • The number suffixes represent ranges (e.g., 1_5 -> 1 to 5 minutes) or minimums (e.g., _30 indicates > 30 minutes) of a given bout in a given activity level (in minutes). Presumably these are configurable based on the boutdir.* configuration options.
I'm just a user, though, so don't take my word on this. ⁠Grinning face with smiling eyes

Michael Rueschman

unread,
Feb 15, 2024, 12:26:23 PM2/15/24
to R package GGIR
Small correction: boutdur.* options

From GGIR vignette: Configure durations of bouts: boutdur.mvpa, boutdur.in, and boutdur.lig. Note that this can be a vector of multiple values indicating the minimum and maximum duration of subsequent bout types, e.g. 1-5 minutes MVPA, 5-10 minutes MVPA, and longer than 10 minutes MVPA.

Jannick Mauron

unread,
Feb 16, 2024, 2:38:37 AM2/16/24
to R package GGIR
Hey Michael

Thank you very much for your answer, I think that makes a lot of sense. However, I also think it might be useful for some of the users to maybe document somewhere the requirements for a given data point to be categorized into one of the categories like an acceleration threshold or something. 

In my case I'd like to detect significant sleep disturbances during the night and I smoothed the datapoints over 1min and now came to the threshold in class_id of 1.2 leading to a "significant" sleep disturbance. However, it feels weird to kind of guess this threshold since I don't really know the thoughts behind these class_id's in the first place. 

Maybe Vincent knows more details about this class_id's.

Best,
Jannick

Vincent van Hees

unread,
Feb 19, 2024, 12:13:01 PM2/19/24
to Jannick Mauron, R package GGIR
Mike's explanation is correct. Part 5 variables are documented in the vignette and in the auto-generated part5 variable dictionary (added in autumn 2023).

I assumed that if a GGIR user is familiar with those variables you will be able to deduce what the class names are in the behaviouralcodes.csv. But, I can update the documentation to clarify this a bit more.

However, I also think it might be useful for some of the users to maybe document somewhere the requirements for a given data point to be categorized into one of the categories like an acceleration threshold or something.

This is documented in inspecting the output in the vignette and in the documentation of the input parameters. Further, the way GGIR classifies intensity levels has been described in papers I was a co-author on, and it is discussed in our training course https://www.accelting.com/ggir-training/ . Later this year we hope to write a dedicated vignette chapter to summarise all that...

In my case I'd like to detect significant sleep disturbances during the night and I smoothed the datapoints over 1min and now came to the threshold in class_id of 1.2 leading to a "significant" sleep disturbance. However, it feels weird to kind of guess this threshold since I don't really know the thoughts behind these class_id's in the first place.

This is documented in the vignette, these are codes to refer to classes and averaging them makes no sense just like you wouldn't average participant ID numbers. Instead you should maybe use majority vote. Either way I do not understand why you are take that route, GGIR facilitates this for you with argument "part5_agg2_60seconds".

I am responding to the google group on a voluntary and unpaid basis. If you have more questions please consider our GGIR training course options: https://www.accelting.com/ggir-training/. Further, I'd be happy to offer personal consultancy session(s).

Kind regards,

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 on the web, visit https://groups.google.com/d/msgid/RpackageGGIR/e405b8cb-ec3b-4cbe-a786-1485becfc63en%40googlegroups.com.

Jannick Mauron

unread,
Feb 20, 2024, 12:43:51 PM2/20/24
to R package GGIR
Dear Vincent

Thank you for your answer! I wasn't aware that there is a training course but I guess that's due to my bad research. Please apologize :)

And I'll dig deeper into the vignette!

Best,
Jannick
Reply all
Reply to author
Forward
0 new messages