Skip to content

Instantly share code, notes, and snippets.

@kylebaron
Created May 12, 2016 18:07
Show Gist options
  • Save kylebaron/0283163f8d1420bb55d8429420c4a89b to your computer and use it in GitHub Desktop.
Save kylebaron/0283163f8d1420bb55d8429420c4a89b to your computer and use it in GitHub Desktop.
THETAs from multiple models
library(mrgsolve)

## mrgsolve: Community Edition

## www.github.com/metrumresearchgroup/mrgsolve

code <- '
$THETA 
1 2 3
$THETA name="theta"
4 5 6

$PARAM SEX = 0, WT = 70, FLAG=0

$MAIN
double PKPAR  = THETA1*pow(WT/70,THETA2)*pow(THETA3,SEX );
double PDPAR = theta1 + theta2*SEX + theta3*FLAG;

'

mod <- mcode("dollar_theta", code)

param(mod)

## 
##  Model parameters (N=9):
##  name   value . name   value
##  FLAG   0     | THETA2 2    
##  SEX    0     | theta3 6    
##  theta1 4     | THETA3 3    
##  THETA1 1     | WT     70   
##  theta2 5     | .      .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment