From: Johan.Rosenborg@astrazeneca.com
Subject: [NMusers] Modelling individual data using a data file on several subjects
Date: Tue, September 21, 2004 8:33 am
Is there a way to use an if statement on ID in the $ERROR block (or
somewhere else in the model file) to extract records from a data file
subject by subject?/ Johan
Modelling individual data using a data file on several subjects
3 messages
3 people
Latest: Sep 21, 2004
From: "mathangi"
Subject: RE: [NMusers] Modelling individual data using a data file on several subjects
Date: Tue, September 21, 2004 11:33 am
Hello,
Here is a way to model individual data using a data file on several subjects
using "awk programming". I am not sure how and whether it can be performed
using NONMEM alone.
I have provided the batch file (which calls awk codes ) below for extracting
one id data and fit the data for that individual. Though this is not the
final code, the idea is the same. It requires some more fine programming
like adding loops, so that the whole process is automated. Sentences
starting with REM are comments.
REM Output data for id = 20 from the main datafile to id20.csv
gawk "$1~/ID/{print$0}" datafile.csv>id20.csv
gawk "$1~/20/{print$0}" datafile.csv>>id20.csv
REM print the name of the datafile in $DATA of the ctl file, here let us say
it is id20.ctl. general.ctl is a common ctl stream, where only the datafile
needs to be changed. If initial estimates needs to be changed for each, that
can also be performed by using additional codes.
gawk -f ex5.awk general.ctl>id20.ctl
REM ex5.awk is an awk file called to perform the above mentioned action. The
code in ex5.awk
REM is given below, which prints id20.csv after $DATA
REM $1~/\$DATA/{$2="id20.csv"}
REM {print}
REM NONMEM run is performed.
call nmgo -q id20.ctl
REM print NONMEM fit file for id = 20 to an csv or excel. This file could be
made to contain
REM fits for all ID
gawk "{print}" c:\xxx\id20.df\id20.fit>allid.out
Hope this helps as a starting point.
I would also like to know other ways of performing the same.
Thanks
Mathangi
From: "Bachman, William (MYD)" bachmanw@iconus.com
Subject: RE: [NMusers] Modelling individual data using a data file on several subjects
Date: Tue, September 21, 2004 11:59 am
Johan,
It's not really clear to me what you want to do. Can you elaborate?
Bill
_______________________________________________________