[R] Frailty with a Weibull PH Model

2005-12-13 Thread Singh, Jatinder
Hi,

I am trying to fit a Weibull PH model with a gaussian frailty term
(kidney data). Is the following approach correct?

1. Fit the model using survReg with the frailty term added in.

Kidn1-survreg(formula = Surv(rtime, event)~
age+sex+gn+an+pkn+frailty.gaussian(patient), data=kidney,
dist='weibull')

2. Based on Venables and Ripley (350-353), divide the negative of the
coefficients by the scale parameter to obtain the Weibull PH model
coefficients.

Jindi


Jatinder Singh
Senior Manager, Analysis and Reporting
PRA International
300-730 View Street
Victoria, B.C. V8W 3Y7
Tel: 250-483-4416
Fax: 250 483 4588
http://www.prainternational.com 
e-mail: [EMAIL PROTECTED]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Converting PROC NLMIXED code to NLME

2005-10-14 Thread Singh, Jatinder
Hi Peter,

Apologies - I ran the script using S-Plus 6.2. I am happy to run it in R, but 
my feeling is that there may be something wrong with the code itself. I have 
included the dataset and script, in case you can help.

Jindi Singh. 


Jatinder Singh
Senior Manager, Analysis and Reporting
PRA International
300-730 View Street
Victoria, B.C. V8W 3Y7
Tel: 250-483-4416
Fax: 250 483 4588
http://www.prainternational.com 
e-mail: [EMAIL PROTECTED]

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Peter Dalgaard
Sent: Saturday, October 08, 2005 1:29 AM
To: Singh, Jatinder
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] Converting PROC NLMIXED code to NLME

Singh, Jatinder [EMAIL PROTECTED] writes:

 Hi,
 
 I am trying to convert the following NLMIXED code to NLME, but am 
 running into problems concerning 'Singularity in backsolve'. As I am 
 new to R/S-Plus, I thought I may be missing something in the NLME code.

Which version of R and NLME? R 2.2.0 ships with a version where the internal 
optimizer is changed to nlminb(). As I understand it, this was in response to 
reports where code that worked in S-PLUS refused to work in R.

 
 NLMIXED
 ***
 proc nlmixed data=kidney.kidney;
 parms delta=0.03 gamma=1.1 b1=-0.003 b2=-1.2 b3=0.09 b4=0.35 b5=-1.43 
 varu=0.5; eta=b1*age+b2*sex+b3*gn+b4*an+b5*pkn+u;
 hazard=eta+log(delta)+log(gamma)+(gamma-1)*log(rtime);
 survivor=(-exp(eta))*delta*(rtime**gamma);
 ll=(event*hazard)+survivor;
 model rtime ~ general(ll);
 random u~normal(0,varu) subject=patient out=frailty; run;
 
 NLME
 
 kidney.nlme-nlme(model=rtime~
 (event*
 ((b1*age+b2*sex+b3*gn+b4*an+b5*pkn+u)+log(delta)+log(gamma)+(gamma-1)*
 lo
 g(rtime))
 +((-exp(b1*age+b2*sex+b3*gn+b4*an+b5*pkn+u))*delta*(rtime**gamma))
 ),
 fixed=list(delta~1,gamma~1,b1~1,b2~1,b3~1,b4~1,b5~1),
 random=u~1|patient,
 start=c(delta=0.03,gamma=1.1,b1=-0.003,b2=-1.2,b3=0.09,b4=0.35,b5=-1.4
 3)
 ,
 data=(kidney),
 method=ML,
 na.action=na.include
 )
 
 Error in NLME
 *
  traceback()
 11: eval(action, sys.parent())
 10: doErrorAction(Problem in .C(\fit_nlme\,: Singularity in 
 backsolve, 1000)
 9: .C(fit_nlme,
 8: nlme(model = rtime ~ (event * ((b1 * age + b2 * sex + b3 * gn + b4 
 * an + b5 *
 7: NULL
 6: nlme.formula(model = rtime ~ (event * ((b1 * age + b2 * sex + b3 * 
 gn
 + b4 *
 5: eval(i, local)
 4: source(auto.print = auto.print, exprs = substitute(exprs.literal))
 3: script.run(exprs.literal = {
 2: eval(expression(script.run(exprs.literal = {
 1: 
 Message: Problem in .C(fit_nlme,: Singularity in backsolve
 
 I am actually trying to fit a parametric model to the kidney catheter 
 data and compare NLMIXED with NLME. I am aware that COXPH and SURVREG 
 are also available with a frailty element added in, but wanted to fit 
 the likelihood model as above for a direct comparison.
 
 Cheers,
 
 Jindi
 
   [[alternative HTML version deleted]]
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 

-- 
   O__   Peter Dalgaard Ă˜ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark  Ph:  (+45) 35327918
~~ - ([EMAIL PROTECTED])  FAX: (+45) 35327907
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

[R] Converting PROC NLMIXED code to NLME

2005-10-07 Thread Singh, Jatinder
Hi,

I am trying to convert the following NLMIXED code to NLME, but am
running into problems concerning 'Singularity in backsolve'. As I am new
to R/S-Plus, I thought I may be missing something in the NLME code.

NLMIXED
***
proc nlmixed data=kidney.kidney;
parms delta=0.03 gamma=1.1 b1=-0.003 b2=-1.2 b3=0.09 b4=0.35 b5=-1.43
varu=0.5;
eta=b1*age+b2*sex+b3*gn+b4*an+b5*pkn+u;
hazard=eta+log(delta)+log(gamma)+(gamma-1)*log(rtime);
survivor=(-exp(eta))*delta*(rtime**gamma);
ll=(event*hazard)+survivor;
model rtime ~ general(ll);
random u~normal(0,varu) subject=patient out=frailty;
run;

NLME

kidney.nlme-nlme(model=rtime~
(event*
((b1*age+b2*sex+b3*gn+b4*an+b5*pkn+u)+log(delta)+log(gamma)+(gamma-1)*lo
g(rtime))
+((-exp(b1*age+b2*sex+b3*gn+b4*an+b5*pkn+u))*delta*(rtime**gamma))
),
fixed=list(delta~1,gamma~1,b1~1,b2~1,b3~1,b4~1,b5~1),
random=u~1|patient,
start=c(delta=0.03,gamma=1.1,b1=-0.003,b2=-1.2,b3=0.09,b4=0.35,b5=-1.43)
,
data=(kidney),
method=ML,
na.action=na.include
)

Error in NLME
*
 traceback()
11: eval(action, sys.parent())
10: doErrorAction(Problem in .C(\fit_nlme\,: Singularity in
backsolve, 1000)
9: .C(fit_nlme,
8: nlme(model = rtime ~ (event * ((b1 * age + b2 * sex + b3 * gn + b4 *
an + b5 *
7: NULL
6: nlme.formula(model = rtime ~ (event * ((b1 * age + b2 * sex + b3 * gn
+ b4 *
5: eval(i, local)
4: source(auto.print = auto.print, exprs = substitute(exprs.literal))
3: script.run(exprs.literal = {
2: eval(expression(script.run(exprs.literal = {
1: 
Message: Problem in .C(fit_nlme,: Singularity in backsolve 

I am actually trying to fit a parametric model to the kidney catheter
data and compare NLMIXED with NLME. I am aware that COXPH and SURVREG
are also available with a frailty element added in, but wanted to fit
the likelihood model as above for a direct comparison.

Cheers,

Jindi

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html