Skip to content

Exclude message for r2, r2adj, corrxy when half life points are less than 3 #505

@Gero1999

Description

@Gero1999

From the related issue discussion in #503, we figured out that it could be nice to either:

  • change the default exclude mechanism to allow making exclusions only for particular parameter outputs in the half.life() calculations, rather than one homogenous exclude message for all

  • otherwise create a exclude function to populate the message 2 points used for half-life calculation for r.squared, adj.r.squared and corrxy with half.life_points < 3

2 points used for half-life calculation should not be also a exclude message for r.squared, adj.r.squared rather than just a warning? It will make it more CDISC reportable and specific to the profile. Right now, this is what happens:

df <- Theoph %>%
  filter(Subject == 1) %>%
  filter(Time %in% c(2.02, 7.03, 12.12))
o_conc <- PKNCAconc(df, formula = "conc ~ Time | Subject")
o_data <- PKNCAdata(data.conc = o_conc, intervals = data.frame(lambda.z = TRUE, start = 0, end = Inf))
PKNCA.options(min.hl.points = 2)
as.data.frame(pk.nca(o_data))
No dose information provided, calculations requiring dose will return NA.
# A tibble: 12 × 7
   Subject start   end PPTESTCD            PPORRES PPANMETH exclude
   <ord>   <dbl> <dbl> <chr>                 <dbl> <chr>    <chr>  
 1 1           0   Inf tmax                 2.02   ""       NA     
 2 1           0   Inf tlast               12.1    ""       NA     
 3 1           0   Inf lambda.z             0.0450 ""       NA     
 4 1           0   Inf r.squared            1      ""       NA     
 5 1           0   Inf adj.r.squared       NA      ""       NA     
 6 1           0   Inf lambda.z.corrxy     -1      ""       NA     
 7 1           0   Inf lambda.z.time.first  7.03   ""       NA     
 8 1           0   Inf lambda.z.time.last  12.1    ""       NA     
 9 1           0   Inf lambda.z.n.points    2      ""       NA     
10 1           0   Inf clast.pred           5.94   ""       NA     
11 1           0   Inf half.life           15.4    ""       NA     
12 1           0   Inf span.ratio           0.331  ""       NA     
Warning messages:
1: n must be > 2 for adj.r.squared 
2: 2 points used for half-life calculation 

For me personally does not sound right to consider an r.squared of 2 points for any summary table, but what do you think?

Originally posted by @Gero1999 in #503

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions