IOV on imported dataset #1268
Replies: 2 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 0Created on 2024-12-26 with reprex v2.1.1 |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Going to move this to discussions; chime in there if there's more you'd like to engage on. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
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:
Beta Was this translation helpful? Give feedback.
All reactions