Re: W for time varying covariates
Dear Bernard,
The user guide for scm seems to indicate that for the functionality of
time-varying covariates, you need to estimate the standard deviation of the
residual error as THETAS(s) (with SIGMAS(s) fixed to 1):
https://github.com/UUPharmacometrics/PsN/releases/download/4.7.0/scm_userguide.pdf
(see option “time_varying")
One more thing, before you switch to estimating the magnitude of the residual
error as a fixed effect: notice that W should represent the standard deviation
of the residual error (IRES in my example code below), and SIGMA(1,1) would
generally represent the variance.
Below, I provide the code that I would use for the additive error with SIGMA
estimated.
(the code with SIGMA fixed is provided in the scm user guide, under
time_varying).
Best wishes
Jakob
PS.
For other users, it should be noted that for covariates that are mostly varying
between individuals, and just slightly over time (e.g. WT in adults), the
option -time_varying in scm will have little or no impact.
But in this case, if another covariates is mostly varying over time, one may as
well include WT among the ones listed as time varying (assuming WT was measured
multiple times).
DS.
Example code for estimating additive error model with sigma estimated.
IPRED = [Model specific equation, or F]
IRES = DV-IPRED
ADD = SQRT(SIGMA(1,1))
SD = ADD
IWRES = IRES/SD
Y = IPRED + EPS(1)
Jakob Ribbing, Ph.D.
Senior Consultant, Pharmetheus AB
Cell/Mobile: +46 (0)70 514 33 77
[email protected]
www.pharmetheus.com
Phone, Office: +46 (0)18 513 328
Uppsala Science Park, Dag Hammarskjölds väg 52B
SE-752 37 Uppsala, Sweden
This communication is confidential and is only intended for the use of the
individual or entity to which it is directed. It may contain information that
is privileged and exempt from disclosure under applicable law. If you are not
the intended recipient please notify us immediately. Please do not copy it or
disclose its contents to any other person.
Quoted reply history
On 05 Oct 2017, at 15:38, Bernard Ngara <[email protected]> wrote:
> Dear users
>
> I was trying to fit a covariate model using SCM approach in PsN with the code:
>
> model = run1.mod
> logfile=run1.log
> search_direction = both
> p_forward=0.05
> p_backward=0.01
> continuous_covariates=CD4,HWT,BWT,HT,BMI,AGE,TOAR,VAS
> categorical_covariates=LNGTH,SEX,REGIMEN,CARE,EDU,WHO,BMI4AGE
> time_varying =CD4,HWT,BMI,AGE,TOAR,VAS
>
> [test_relations]
> FOA=CD4,LNGTH,HWT,BMI,AGE,SEX,REGIMEN,TOAR,CARE,EDU,WHO,VAS,BMI4AGE
> FOR=CD4,LNGTH,HWT,BMI,AGE,SEX,REGIMEN,TOAR,CARE,EDU,WHO,VAS,BMI4AGE
>
>
> [valid_states]
> continuous = 1,2
> categorical = 1,2
>
> The run fails and gives the following error message:
>
> Starting scm forward search
> Could not find assignment to W in $PRED needed for time_varying at
> C:/Portable_PKPD/Perl/bin/..\site\lib\PsN_4_7_0/tool/scm.pm line 5764.
>
> However I do have the W in the model file as:
>
> IF(DVID.EQ.1) W=SIGMA(2,2) ;
> IF(DVID.EQ.2) W=SIGMA(4,4)
> IRES=IPRED-DV
> IWRES=IRES/W
>
> The baseline model runs well with stability and reasonable estimates of
> parameters but I am facing a challange on implementing the SCM.
>
> Kind regards
>
> --
> Bernard Ngara
>
> Biostatistician
> Harare
> Zimbabwe
> +263 776 971 400
>