compute.cwres(xpose4generic)
compute.cwres()所属R语言包:xpose4generic
Compute the Conditional Weighted Residuals
加权残值计算条件
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This function computes the conditional weighted residuals (CWRES) from a NONMEM run. CWRES are an extension of the weighted residuals (WRES), but are calculated based on the first-order with conditional estimation (FOCE) method of linearizing a pharmacometric model (WRES are calculated based on the first-order (FO) method). The function requires a NONMEM table file and an extra output file that must be explicitly asked for when running NONMEM, see details below.
此函数计算条件的加权的残差(CWRES)从NONMEM运行。 CWRES是一个扩展加权残差(WRES),但计算的基础上与条件估计(FOCE)的方法,对,线性化pharmacometric模型(WRES计算的一阶(FO)的方法的基础上)的一阶。该函数需要一个的NONMEM表文件和一个额外的输出文件,必须明确要求运行时NONMEM,详情如下。
用法----------Usage----------
compute.cwres(run.number,
tab.prefix="cwtab",
sim.suffix="",
est.tab.suffix=".est",
deriv.tab.suffix=".deriv",
old.file.convention=FALSE,
id="ALL",
printToOutfile=TRUE,
onlyNonZero=TRUE,
...)
xpose.calculate.cwres(object,
cwres.table.prefix = "cwtab",
tab.suffix = "",
sim.suffix = "sim",
est.tab.suffix=".est",
deriv.tab.suffix=".deriv",
old.file.convention=FALSE,
id = "ALL",
printToOutfile = TRUE,
onlyNonZero = FALSE,
classic = FALSE,
...)
参数----------Arguments----------
参数:run.number
The run number of the NONMEM from which the CWRES are to be calculated.
的NONMEM计为从该CWRES运行次数。
参数:tab.prefix
The prefix to two NONMEM file containing the needed values for the computation of the CWRES, described in the details section.
前缀到2的NONMEM文件包含所需的值计算的CWRES,在细节部分描述。
参数:sim.suffix
The suffix ,before the ".", of the NONMEM file containing the needed values for the computation of the CWRES, described in the details section. For example, the table files might be named cwtab1sim.est and cwtab1sim.deriv, in which case sim.suffix="sim".
前后缀,“。”,的NONMEM文件包含所需值的计算,在细节部分的CWRES。例如,表的文件可能被命名为cwtab1sim.est和cwtab1sim.deriv,在这种情况下,sim.suffix="sim"。
参数:est.tab.suffix
The suffix, after the ".", of the NONMEM file containing the estimated parameter values needed for the CWRES calculation.
的后缀,“。”,的NONMEM文件中估计的参数值需要的CWRES计算。
参数:deriv.tab.suffix
The suffix, after the ".", of the NONMEM file containing the derivatives of the model with respect to the random parameters needed for the CWRES calculation.
的后缀,“。”,NONMEM文件,其中包含衍生工具的模型需要的CWRES计算的随机参数。
参数:old.file.convention
For backwards compatibility. Use this if you are using the previous file convention for CWRES (table files named cwtab1, cwtab1.50, cwtab1.51, ... , cwtab.58 for example).
为了向后兼容。如果您使用的是以前的文件约定的CWRES(表文件名为cwtab1,cwtab1.50,cwtab1.51,...,例如cwtab.58)。
参数:id
Can be either "ALL" or a number matching an ID label in the datasetname. Value is fixed to "ALL" for xpose.calculate.cwres.
可以是“ALL”或匹配的ID标签中的datasetname。值固定为“ALL”xpose.calculate.cwres。
参数:printToOutfile
Logical (TRUE/FALSE) indicating whether the CWRES values calculated should be appended to a copy of the datasetname. Only works if id="ALL". If chosen the resulting output file will be datasetname.cwres. Value is fixed to TRUE for xpose.calculate.cwres.
逻辑(TRUE / FALSE),是否CWRES值计算应附加到的datasetname的副本。只有工作,如果id=“ALL”。如果选择生成的输出文件将datasetname。cwres。值固定为TRUE为xpose.calculate.cwres。
参数:onlyNonZero
Logical (TRUE/FALSE) indicating if the return value (the CWRES values) of compute.cwres should include the zero values associated with non-measurement lines in a NONMEM data file.
逻辑(TRUE / FALSE)如果返回值(CWRES值)compute.cwres应包括NONMEM数据文件的非测量线与零值。
参数:object
An xpose.data object.
对象的xpose.data。
参数:cwres.table.prefix
The prefix to the NONMEM table file containing the derivative of the model with respect to the etas and epsilons, described in the details section.
含有该衍生物的模型相对于ETAS和的Epsilon,中描述的细节部分的的NONMEM表文件的前缀。
参数:tab.suffix
The suffix to the NONMEM table file containing the derivative of the model with respect to the etas and epsilons, described in the details section.
ETAS的Epsilon,在细节部分就含有该衍生物的模型的的NONMEM表文件的后缀。
参数:classic
Indicates if the function is to be used in the classic menu system.
表示如果该函数是经典的菜单系统中要使用。
参数:...
Other arguments passed to basic functions in code.
其他参数传递给代码的基本功能。
Details
详细信息----------Details----------
compute.cwres This function is the computational 'brains' of the CWRES computation and does not require an Xpose data object to work. The function simply reads in the following two files:
compute.cwres此功能是计算机的“大脑”的CWRES计算,并不需要一个XPOSE的数据对象的工作。简单的函数读取以下两个文件:
xpose.calculate.cwres This function is a wrapper around the function compute.cwres. It computes the CWRES for the model file associated with the Xpose data object input to the function. If possible it also computes the CWRES for any simulated data associated with the current Xpose data object. If you have problems with this function try using compute.cwres and then rereading
xpose.calculate.cwres这个函数是一个包装周围的功能compute.cwres。它计算与XPOSE数据对象输入的功能模型文件的CWRES。如果可能的话,它也与当前XPOSE数据对象相关联的数据的任何模拟计算CWRES。如果你有问题,使用此功能,请尝试使用compute.cwres“,然后重读
值----------Value----------
参数:compute.cwres
Returns a vector containing the values of the CWRES.
返回一个含有的CWRES值矢量。
参数:xpose.calculate.cwres
Returns an Xpose data object that contains the CWRES. If simulated data is present, then the CWRES will also be calculated for that data.
返回一个XPOSE数据对象包含CWRES的。如果模拟数据是本,然后CWRES将也可以用于该数据计算。
设置NONMEM模型文件----------Setting up the NONMEM model file----------
In order for this function to calculate the CWRES, NONMEM must be run while requesting certain tables and files to be created. How these files are created differs depending on if you are using \$PRED or ADVAN as well as the version of NONMEM you are using. These procedures are known to work for NONMEM VI but may be different for NONMEM V. We have attempted to indicate where NONMEM V may be different, but this has not been extensively tested!
在这函数来计算CWRES,为了NONMEM同时要求一定要建立的表和文件,必须运行。如何创建这些文件的不同而不同,如果您使用的是\ $的PRED或ADVAN以及NONMEM的版本,你使用的是。这些程序被称为NONMEM VI,但可能是不同的NONMEM五,我们试图表明NONMEM V可能会有所不同,但是这并没有被广泛的测试!
This procedure can be done automatically using Perl Speaks NONMEM (PsN) and we highly recommend using PsN for this purpose. After installing PsN just type 'execute [modelname] -compute_cwres'. See http://psn.sourceforge.net for more details.
使用Perl说NONMEM(PSN),我们强烈建议您使用PSN为此目的,这个过程就可以自动完成。安装完成后PSN只需键入execute [modelname] -compute_cwres。请参阅http://psn.sourceforge.net,了解详细信息。
There are five main insertions needed in your NONMEM control file:
主要有五种插入需要在您的的NONMEM控制文件:
\$ABB COMRES=X.
\ $ ABB COMRES = X。
Insert this line directly after your \$DATA line. The value of X is the number of ETA() terms plus the number of EPS() terms in your model. For example for a model with three ETA() terms and two EPS() terms the code would look like this:
\ $ DATA线后直接插入此行。 X的值的数量ETA()条款,加上EPS()在你的模型。例如,3)条款和EPS(ETA()项的代码的模型是这样的:
Verbatim code.
逐字代码。
Using ADVAN.
使用ADVAN。
If you are using ADVAN routines in your model, then Verbatim code should be inserted directly after the \$ERROR section of your model file. The length of the code depends again on the number of ETA() terms and EPS() terms in your model. For each ETA(y) in your model there is a corresponding term G(y,1) that you must assign to a COM() variable. For each EPS(y) in your model, there is a corresponding HH(y,1) term that you must assign to a COM() variable.
如果您使用的ADVAN例程在你的模型中,然后逐字代码应该被插入后,直接在\ $错误部分的模型文件。再次的代码长度取决于(ETA)的条款和EPS()的数量在你的模型。对于每一个ETA(y)在你的模型有相应的项G(Y,1),你必须分配给一个COM()的变量。对于每个EPS(y)在你的模型中,有一个相应的HH(Y,1)的术语,你必须指定一个COM()的变量。
For example for a model using ADVAN routines with three ETA() terms and two EPS() terms the code would look like this:
例如,一个模型使用ADVAN例程3)条款和EPS(ETA()的代码看起来像这样的条款:
Using PRED.
使用PRED。
If you are using \$PRED, the verbatim code should be inserted directly after the \$PRED section of your model file. For each ETA(y) in your model there is a corresponding term G(y,1) that you must assign to a COM() variable. For each EPS(y) in your model, there is a corresponding H(y,1) term that you must assign to a COM() variable. The code would look like this for three ETA() terms and two EPS() terms:
如果您使用的是\ $ PRED,逐字代码后,应直接插入\ $的PRED部分的模型文件。对于每一个ETA(y)在你的模型有相应的项G(Y,1),你必须分配给一个COM()的变量。对于每个EPS(y)在你的模型中,有一个对应的H(Y,1)的术语,你必须指定一个COM()的变量。三)项和两个EPS(ETA()项的代码是这样的:
INFN routine.
INFN程序。
Using ADVAN with NONMEM VI.
使用ADVAN与NONMEM六。
If you are using ADVAN routines in your model, then an \$INFN section should be placed directly after the \$PK section using the following code. In this example we are assuming that the model file is named something like 'run1.mod', thus the prefix to these file names 'cwtab' has the same run number attached to it (i.e. 'cwtab1'). This should be changed for each new run number.
如果您使用的ADVAN在模型中的例程,然后\ $ INFN部分应放在后直接使用下面的代码在\ $ PK部分。在这个例子中,我们假设的模型文件被命名为像“run1.mod”,因此这些文件名具有相同的运行cwtab“号连接到(即”cwtab1)的前缀。这应该被改变为每个新的运行次数。
Using ADVAN with NONMEM V.
使用ADVAN与NONMEM五
If you are using ADVAN routines in your model, then you need to use an INFN subroutine. If we call the INFN subroutine 'myinfn.for' then the \$SUBS line of your model file should include the INFN option. That is, if we are using ADVAN2 and TRANS2 in our model file then the \$SUBS line would look like:
如果您使用的ADVAN在模型中的例程,那么你需要使用一个INFN的子程序。如果我们把INFN的子程序的myinfn.for“,然后\ $的SUBS线的模型文件应包括的INFN选项。也就是说,如果我们使用的是ADVAN2和反在我们的模型文件,然后在\ $的SUBS行会看起来像:
Using \$PRED with NONMEM VI.
使用\ $ PRED与NONMEM六。
If you are using \$PRED, then an the following code should be placed at the end of the \$PRED section of the model file (together with the verbatim code). In this example we are assuming that the model file is named something like 'run1.mod', thus the prefix to these file names 'cwtab' has the same run number attached to it (i.e. 'cwtab1'). This should be changed for each new run number.
如果您使用的是\ $ PRED,那么下面的代码应该被放置在末尾的模型文件在\ $的的PRED部分的(连同的逐字代码),。在这个例子中,我们假设的模型文件被命名为像“run1.mod”,因此这些文件名具有相同的运行cwtab“号连接到(即”cwtab1)的前缀。这应该被改变为每个新的运行次数。
Using \$PRED with NONMEM V.
使用\ $ PRED与NONMEM五。
If you are using \$PRED with NONMEM V, then you need to add verbatim code immediately after the \$PRED command. In this example we assume 4 thetas, 3 etas and 1 epsilon. If your model has different numbers of thetas, etas and epsilons then the values of NTH, NETA, and NEPS, should be changed respectively. These vales are found in the DATA statement below. Please note that the 3rd and 4th lines of code should be one line with the '...' removed from each line, reading: \" COMMON /ROCM6/ THETAF(40),OMEGAF(30,30),SIGMAF(30,30) .
如果您使用的是\ $ PRED与NONMEM V,那么你需要的添加逐字代码,\ $ PRED命令后,立即。在这个例子中,我们假设4 thetas,3 ETAS和小量。如果你的模型有不同数量的的thetas,ETAS的Epsilon NTH,NETA和棉结的值,应该改变。这些山谷中发现下面的数据表。请注意,第3和第4行代码应该是符合“...”从每一行,内容如下:\" COMMON /ROCM6/ THETAF(40),OMEGAF(30,30),SIGMAF(30,30) 。
cwtab*.deriv table file.
cwtab *。DERIV表文件。
A special table file needs to be created to print out the values contained in the COMRES variables. In addition the ID, IPRED, MDV, DV, PRED and RES data items are needed for the computation of the CWRES. The following code should be added to the NONMEM model file. In this example we continue to assume that we are using a model with three ETA() terms and two EPS() terms, extra terms should be added for new ETA() and EPS() terms in the model file. We also assume the model file is named something like 'run1.mod', thus the prefix to these file names 'cwtab' has the same run number attached to it (i.e. 'cwtab1'). This should be changed for each new run number.
一个特殊的表需要创建文件,打印出来的COMRES变量中包含的值。此外ID, IPRED, MDV, DV, PRED and RES数据资料需要为计算的CWRES。下面的代码应该被添加到NONMEM模型文件。在这个例子中,我们继续假设我们使用的是ETA()的条款和两个EPS()项的模型,额外的条款,应添加新的ETA()和EPS()在模型文件中的条款。我们还假设的模型文件被命名为像“run1.mod”,因此这些文件名具有相同的运行cwtab“号连接到(即”cwtab1)的前缀。这应该被改变为每个新的运行次数。
\$ESTIMATION.
\ $估计。
To compute the CWRES, the NONMEM model file must use (at least) the FO method with the POSTHOC step. If the FO method is used and the POSTHOC step is not included then the CWRES values will be equivalent to the WRES. The CWRES calculations are based on the FOCE approximation, and consequently give an idea of the ability of the FOCE method to fit the model to the data. If you are using another method of parameter estimation (e.g. FOCE with interaction), the CWRES will not be calculated based on the same model linearization procedure.
要计算的CWRES的,必须使用NONMEM模型文件(至少)与POSTHOCFO方法步骤。如果FO使用方法和不包括POSTHOC步骤然后CWRES值将相当于到WRES。 CWRES计算基于的FOCE近似,并因而得到一个想法FOCE法拟合模型与数据的能力。如果你使用的是其他的参数估计方法(例如,的FOCE与互动),CWRES将不被计算在同一个模型线性化方法。
(作者)----------Author(s)----------
Andrew Hooker
参考文献----------References----------
improved model diagnostic for the FO/FOCE methods. PAGE 15 (2006) Abstr 1001 [http://www.page-meeting.org/?abstract=1001].
实例----------Examples----------
## Not run: [#不运行:]
## Capture CWRES from cwtab5.est and cwtab5.deriv[#捕获CWRES,从cwtab5.est和cwtab5.deriv]
cwres <- compute.cwres(5)
mean(cwres)
var(cwres)
## Capture CWRES from cwtab1.est and cwtab1.deriv, do not print out, allow zeroes[#捕获CWRES从cwtab1.est和cwtab1.deriv的,不打印出来,让零]
cwres <- compute.cwres("1", printToOutFile = FALSE,
onlyNonZero = FALSE)
## Capture CWRES for ID==1[#捕获ID == CWRES 1]
cwres.1 <- compute.cwres("1", id=1)
## xpdb5 is an Xpose data object[#xpdb5是一个XPOSE的数据对象]
## We expect to find the required NONMEM run and table files for run[#我们希望找到所需的NONMEM运行和表文件运行的]
## 5 in the current working directory[排名第5的当前工作目录]
xpdb5 <- xpose.data(5)
## Compare WRES, CWRES[#比较WRES,CWRES。]
xpdb5 <- xpose.calculate.cwres(xpdb5)
cwres.wres.vs.idv(xpdb5)
## End(Not run)[#(不执行)]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|