-
Notifications
You must be signed in to change notification settings - Fork 36
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
IOV on imported dataset #1256
Comments
Hi @farmacyst99 - Can you try the updated approach below? This lets the event expand function ( Kyle library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
library(mrgsolve)
#>
#> Attaching package: 'mrgsolve'
#> The following object is masked from 'package:stats':
#>
#> filter
#patients <- read_csv("~/Desktop/pmx/replicated_patients.csv") %>% slice(1:10) %>% as.data.frame()
patients <- data.frame(BSA = runif(10, 0.8, 1.2))
e <- ev_expand(amt = 40*patients$BSA, tinf = 0.5, ii = 24, addl = 4)
data <- realize_addl(e)
data <- mutate(data, OCC = cumsum(evid)-1, .by = ID)
head(data, n = 11)
#> ID time amt rate ii addl cmt evid tinf OCC
#> 1 1 0 43.75310 87.50621 0 0 1 1 0.5 0
#> 2 1 24 43.75310 87.50621 0 0 1 1 0.5 1
#> 3 1 48 43.75310 87.50621 0 0 1 1 0.5 2
#> 4 1 72 43.75310 87.50621 0 0 1 1 0.5 3
#> 5 1 96 43.75310 87.50621 0 0 1 1 0.5 4
#> 6 2 0 32.44486 64.88972 0 0 1 1 0.5 0
#> 7 2 24 32.44486 64.88972 0 0 1 1 0.5 1
#> 8 2 48 32.44486 64.88972 0 0 1 1 0.5 2
#> 9 2 72 32.44486 64.88972 0 0 1 1 0.5 3
#> 10 2 96 32.44486 64.88972 0 0 1 1 0.5 4
#> 11 3 0 39.22790 78.45581 0 0 1 1 0.5 0 Created on 2024-12-26 with reprex v2.1.1 |
Going to move this to discussions; chime in there if there's more you'd like to engage on. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I am trying to simulate a model which has IOV modeling, and I have a data of patients covariates which I want to simulate, but I am not able to implement IOV correctly, as the ID and dosing amount code I have written messes up the sequence of ID. Can you help me here is the model file:
and this is how my dataframe looks:
The text was updated successfully, but these errors were encountered: