computes a the mean and standard deviation of the dependent variable data in DV_col grouped by time and dose.

compute_grouped_mean_sd(
  data,
  dv_col,
  ntime_col,
  dose_col,
  group_col = NULL,
  reference_dose = NULL,
  conf_int = 0.95
)

Arguments

data

A data frame containing C-QT analysis dataset

dv_col

An unquoted column name for dependent variable

ntime_col

An unquoted column name for the Time group

dose_col

An unquoted column name for dose group

group_col

An unquoted column of optional grouping column

reference_dose

Reference dose value for comparison calculations

conf_int

Numeric confidence interval level (default: 0.9)

Value

a dataframe of the dv averaged over the grouped time and dose

Examples

data_proc <- preprocess(cqtkit_data_verapamil)
data_proc <- dplyr::mutate(data_proc, DOSEF = as.factor(DOSEF))

compute_grouped_mean_sd(
  data_proc, deltaQTCF, NTLD, DOSE, reference_dose = 0
)
#> # A tibble: 30 × 17
#> # Groups:   time [15]
#>     time  dose mean_dv    sd geo_mean_dv geo_sd_dv     n    se ci_low ci_high
#>    <dbl> <dbl>   <dbl> <dbl> <lgl>       <lgl>     <int> <dbl>  <dbl>   <dbl>
#>  1   0.5     0  -8.28   6.43 NA          NA           22  1.37 -11.1  -5.43  
#>  2   0.5   120  -5.86   6.25 NA          NA           21  1.36  -8.71 -3.02  
#>  3   1       0  -5.43   7.06 NA          NA           22  1.50  -8.55 -2.30  
#>  4   1     120  -0.271  8.11 NA          NA           21  1.77  -3.96  3.42  
#>  5   1.5     0  -5.42   6.77 NA          NA           22  1.44  -8.42 -2.41  
#>  6   1.5   120  -4.20   8.35 NA          NA           21  1.82  -8.00 -0.402 
#>  7   2       0  -2.28   5.23 NA          NA           22  1.11  -4.60  0.0352
#>  8   2     120   1.52   8.61 NA          NA           21  1.88  -2.40  5.43  
#>  9   2.5     0  -4.07   9.70 NA          NA           22  2.07  -8.37  0.234 
#> 10   2.5   120   1.01  10.4  NA          NA           21  2.28  -3.74  5.76  
#> # ℹ 20 more rows
#> # ℹ 7 more variables: group <chr>, mean_delta_dv <dbl>, geomean_delta_dv <int>,
#> #   delta_sd <dbl>, delta_se <dbl>, ci_low_delta <dbl>, ci_up_delta <dbl>