Skip to content

Fix scaling in apply_sadeh.R#10

Open
joshuamirth wants to merge 1 commit intodipetkov:masterfrom
joshuamirth:master
Open

Fix scaling in apply_sadeh.R#10
joshuamirth wants to merge 1 commit intodipetkov:masterfrom
joshuamirth:master

Conversation

@joshuamirth
Copy link

Actigraph counts need to be scaled by 100 before scoring with Sadeh (the same as in Cole-Kripke). See the Actigraph user manual: "He [Sadeh] used the same device that Cole-Kripke used to develop their algorithm, and ActiGraph therefore adapted it in
the same way by scaling our data".

Fixed scaling in apply_sadeh.
@dipetkov
Copy link
Owner

Thank you for your contribution.

Have you run tests on actual data or are these corrections based on the descriptions in the Sadeh paper and the ActiLife manual?

At the time I implemented the algorithms I had access to large collection of (private) data as well as the ActiLife software, so I ran lots of tests to make sure I got the same results.

@dipetkov
Copy link
Owner

dipetkov commented Mar 12, 2022

For what is worth, the "divide by 100" adjustment is applied to before the apply_cole_kripke algorithm, not the apply_sadeh algorithm.

actigraph_adjustment <- function(data) {
data %>%
mutate(
count = pmin(.data$axis1 / 100, 300)
)
}

@joshuamirth
Copy link
Author

Based on actual data. Counts/epoch is typically in the 10-30,000 range, so thresholding without first scaling sets (essentially) all counts to 300 and the Sadeh algorithm then produces nonsensical results. This same data is scored successfully by the Cole-Kripke algorithm as you've implemented it.

I don't have access to the ActiLife software to compare, but scaling by 100 produces closer agreement with the ground truth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments