# Alternative way of specifying dosage regimen

**URL:** <https://discourse.pumas.ai/t/alternative-way-of-specifying-dosage-regimen/218>\
**Category:** Simulation\
**Created:** [February 20, 2020, 4:58pm UTC](https://discourse.pumas.ai/t/alternative-way-of-specifying-dosage-regimen/218 "2020-02-20T16:58:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abhinav](https://avatars.discourse-cdn.com/v4/letter/a/e495f1/32.png) [@Abhinav](https://discourse.pumas.ai/u/Abhinav)\
**Post date:** [February 20, 2020, 4:58pm UTC](https://discourse.pumas.ai/t/alternative-way-of-specifying-dosage-regimen/218/1 "2020-02-20T16:58:19Z")

</div>

I am trying the example specified on introduction to pumas tutorial webpage ([https://tutorials.pumas.ai/html/introduction/introduction.html](https://tutorials.pumas.ai/html/introduction/introduction.html)). When I specified the dosage regimen as “regimen = DosageRegimen([15,15,15,15], time=[0,4,8,12])”, the output plots are identical to the ones presented on the webpage. However, when I specified dosage regimen equivalently as “regimen = DosageRegimen(15, time=0, ii=4, addl=3)”, the output plots obtained are different (especially periph and resp compartments, see below).

 ![pumas intro output](https://canada1.discourse-cdn.com/flex030/uploads/pumas/original/1X/1e05caf112a37d0de528f47482ed1a33dd670ba9.png) I am wondering what caused this difference. Any thoughts are highly appreciated.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![pkofod](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pumas.ai/pkofod/32/59_2.png) [@pkofod](https://discourse.pumas.ai/u/pkofod)\
**Post date:** [February 20, 2020, 8:16pm UTC](https://discourse.pumas.ai/t/alternative-way-of-specifying-dosage-regimen/218/2 "2020-02-20T20:16:00Z")

</div>

Dear Abhinav,

Good question. I do wonder if you are simulating that subject with the same random effects. Can you maybe share the exact code you’re running?

Best,  
Patrick

---

<div class="post-metadata">

**Author:** ![vijay](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pumas.ai/vijay/32/96_2.png) [@vijay](https://discourse.pumas.ai/u/vijay)\
**Post date:** [February 21, 2020, 1:30am UTC](https://discourse.pumas.ai/t/alternative-way-of-specifying-dosage-regimen/218/3 "2020-02-21T01:30:48Z")

</div>

hi Abhinav,

As Patrick suggested, It looks like you are simulating from a model which has random effects on the subject. This will result in a different simulation each time even for the same subject due to the randomness.

Vijay

---

<div class="post-metadata">

**Author:** ![Abhinav](https://avatars.discourse-cdn.com/v4/letter/a/e495f1/32.png) [@Abhinav](https://discourse.pumas.ai/u/Abhinav)\
**Post date:** [February 21, 2020, 2:20am UTC](https://discourse.pumas.ai/t/alternative-way-of-specifying-dosage-regimen/218/4 "2020-02-21T02:20:06Z")

</div>

Thanks for your responses.  
I ran the same code two times one after the other, but with different versions of dosage regimen specification.  
Could you please let me know how to specify a seed number in Pumas so that the simulations can be reproduced with the same random effects?

---

<div class="post-metadata">

**Author:** ![vijay](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pumas.ai/vijay/32/96_2.png) [@vijay](https://discourse.pumas.ai/u/vijay)\
**Post date:** [February 21, 2020, 7:14am UTC](https://discourse.pumas.ai/t/alternative-way-of-specifying-dosage-regimen/218/5 "2020-02-21T07:14:11Z")

</div>

we will post a complete example later, but for now you can do

```auto
using Random
Random.seed!(123)

```

at the top of your script.

Note that if you are running in Pumas v0.9 or lower, and JuliaPro v1.2, you may still get a different plot each time due to default multithreading in JuliaPro. In the next release we have fixed this and using the code above at the top of your script will give you the same result every time.
