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

Generating pred_corr vpc fails #96

Open
SybrandZielhuis opened this issue Apr 24, 2024 · 0 comments
Open

Generating pred_corr vpc fails #96

SybrandZielhuis opened this issue Apr 24, 2024 · 0 comments

Comments

@SybrandZielhuis
Copy link

SybrandZielhuis commented Apr 24, 2024

Hi,

I'm trying to generate a prediction corrected vpc but I keep getting the same error:

Error in dplyr::group_by():
! Must group by variables found in .data.
✖ Column sim is not found.

Backtrace:

  1. ├─vpc::vpc(...)
  2. ├─vpc:::vpc.default(...)
  3. │ └─base::do.call(...)
  4. ├─vpc (local) <fn>(...)
  5. │ └─vpc:::calc_vpc_continuous(...)
  6. │ └─sim %>% dplyr::group_by(strat, sim, bin) %>% ...
  7. ├─dplyr::summarise(...)
  8. ├─dplyr::group_by(., strat, sim, bin)
  9. └─dplyr:::group_by.data.frame(., strat, sim, bin)
  10. └─dplyr::group_by_prepare(.data, ..., .add = .add, error_call = current_env())
  11. └─rlang::abort(bullets, call = error_call)
    

This is the code I used:
vpc(sim = sim2, obs = obs, sim_cols = list(dv = "DV", sim = "REP"), obs_cols = list(dv = "DV"), show = list(obs_dv = TRUE, obs_ci = TRUE, pi_as_area = FALSE, sim_median_ci = TRUE, pi = FALSE), log_y = FALSE, xlab = "Time (hours)", # Label of the x-axis ylab = "Concentration (ng/ml)", # Label of the y-axis title = "VPC of a single administration of 20 mg of lenvatinib ", scales = "free", pi = c(0.05, 0.95), # prediction interval simulated data to show ci = c(0.05, 0.95), n_bins = "auto", pred_corr = TRUE, pred_corr_lower_bnd = 0, smooth = FALSE, verbose = FALSE )

Sim2 and obs are the following:

head(obs)
ID MDV TIME DV PRED
1 1 1 0.0 0.000 0.00
2 1 0 0.5 59.068 159.26
3 1 0 1.0 91.238 237.15
4 1 0 2.0 110.390 273.85
5 1 0 4.0 86.097 212.98
6 1 0 8.0 35.691 105.85
head(sim2)
ID MDV TIME DV PRED REP
1 1 1 0 0 0 1
2 1 0 0.5 173. 159. 1
3 1 0 1 314. 237. 1
4 1 0 2 854. 274. 1
5 1 0 4 505. 213. 1
6 1 0 8 95.9 106. 1

Does anyone know what I am doing wrong?

Kind regards,
Sybrand

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

1 participant