Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SD score used instead of measurements when evaluating "extraneous-same-day" for the last time (step 12d) #33

Open
delosh653 opened this issue Feb 18, 2021 · 1 comment
Milestone

Comments

@delosh653
Copy link
Collaborator

In lines 638 - 662 of growth.R (step 12d), it uses the SD score when it should be the actual measurements:

  #  ii.  Determine dup_tot_* (# of days with extraneous for that subject/parameter) and nodup_tot_* (# of days with nonexlcuded
  #       non-extraneous for that subject/parameter).
  # iii.  If dup_tot_*/(dup_tot_*+nodup_tot_*) is greater than 1/2, replace exc_*=7 for all extraneous for that subject/parameter
  #       for each age where the  largest measurement minus the smallest measurement for that subject/parameter/age is larger than
  #       the maximum difference (ht 3cm; wt 0-9.999 kg 0.25kg; wt 10-29.9999 kg 0.5 kg; wt 30kg and higher 1 kg).

  data.df[J(dup.ratio.df[dup.ratio > 1 / 2, list(subjid, param)]), exclude := (function(df) {
    df[, `:=`(tbc.sd.min = as.double(NaN),
              tbc.sd.max = as.double(NaN))]
    df[valid(
      exclude,
      include.extraneous = T,
      include.temporary.extraneous = T
    ), `:=`(tbc.sd.min = min(tbc.sd),
            tbc.sd.max = max(tbc.sd))]
    df[tbc.sd.max - tbc.sd.min > ifelse(param == 'HEIGHTCM',
                                        3,
                                        ifelse(
                                          param == 'WEIGHTKG',
                                          ifelse(tbc.sd.min < 10, 0.25, ifelse(tbc.sd.min < 30, 0.5, 1)),
                                          NA
                                        )),
       exclude := 'Exclude-Extraneous-Same-Day']
    return(df$exclude)
  })(copy(.SD)), .SDcols = c('exclude', 'tbc.sd'), by = .(subjid, param, agedays)]

It does something similar in step 12e. We may want to reevaluate this step overall anyway.

dchud added a commit that referenced this issue Jul 6, 2021
@dchud
Copy link
Collaborator

dchud commented Aug 23, 2022

Note the reference to ticket 33 above is incorrect.

@dchud dchud added this to the v3.0.0 milestone Feb 27, 2023
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

No branches or pull requests

2 participants