Last active
January 19, 2022 10:57
-
-
Save adamhsparks/d6a5cbe62263422cabcdecb3eb6afdc0 to your computer and use it in GitHub Desktop.
A Julia function to calculate area under the disease progress curve (AUDPC)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function audpc(evaluation, dates) | |
n = length(evaluation) - 1 | |
disvec = Base.zeros(n) | |
datevec = Base.zeros(n) | |
out = 0.0 | |
for i in 1:n | |
disvec[i] = (evaluation[i] + evaluation[i + 1]) / 2 | |
datevec[i] = dates[i + 1] - dates[i] | |
out = sum(disvec .* datevec) | |
end | |
return out | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example from the audpc() help from R's agricolae package.
1015.0