[R] koq.q ---- Kent O' Quigley R2

About this list Date view Thread view Subject view Author view Attachment view

From: Antonello Romani (antonello.romani@studenti.unipr.it)
Date: Tue 30 Mar 2004 - 19:14:48 EST


Message-id: <200403301114.48695.antonello.romani@studenti.unipr.it>


Dear R-users,

I apply to your kind attention to know if someone have used the Splus software
koq.q (Kent & O'Quigley's measure of dependence for censored data) in R and
kindly can help me.

I have tried several times to contact the authors Andrej Blejec
(andrej.blejec@uni-lj.si) or Janez Stare (janez.stare@mf.uni-lj.si) but
unfortunately no one answered me.

Following you'll see the function nlminb that i have changed with R-function
optim() and the error that came out when i try to run this software.
As attached file there is the file koq.q

Thanking in advance for what you can do about it

Yours Faithfully

Dr. Antonello Romani
Dipartimento di Medicina Sperimentale
Sezione di Patologia Molecolare e Immunologia
via Volturno 39
43100 Parma
Italy

#-----------------------------------------------------------------------------------------------
find.mu.alfa <- function(theta, theta1, x, ell, which,...)
        {
#
# find theta=c(beta,mu,alfa) which maximize
# Expected Log-Likelihood given by ell
#
# Set lower and upper bounds for mu (-Inf,Inf)
# and alfa (0,Inf)
#
                lower <- c(which, T, 0) * theta
                lower[c(which, T, 0) == T] <- - Inf
                upper <- c(which, T, T) * theta
                upper[c(which, T, T) == T] <- Inf #
                optim(par=theta,fn=ell,method="L-BFGS-B",lower = lower, upper = upper,
 x = x,theta1 =theta1)
                #nlminb(start = theta, objective = ell, x = x,lower = lower, upper = upper,
theta1 = theta1, ...)
        }
#
#----------------------------------------------------------------------------------------------------------

 
fit<-cph(Surv(futime,fustat)~age,data=ovarian,x=T,y=T,surv=T,method="breslow",type="kaplan-meier")
> fit
Cox Proportional Hazards Model

cph(formula = Surv(futime, fustat) ~ age, data = ovarian, method = "breslow",
    x = T, y = T, surv = T, type = "kaplan-meier")

       Obs Events Model L.R. d.f. P Score Score P
        26 12 14.29 1 2e-04 12.26 5e-04
        R2
     0.454

     coef se(coef) z p
age 0.162 0.0497 3.25 0.00116

>koq(fit)
Beta = 0
Beta1 = 0.1616199
Error in ELL(theta = theta0, theta1 = theta1, x = x) :
        only 0's may mix with negative subscripts
In addition: Warning message:
Replacement length not a multiple of the elements to replace in matrix(...)






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


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Fri 23 Apr 2004 - 18:36:44 EST