Skip to content
Prev 325268 / 398503 Next

survreg with measurement uncertainties

Hi Terry,

Thanks for your quick reply.  I am talking about uncertainty in the
response.  I have 2 follow up questions:

1) my understanding from the documentation is that 'id' in cluster(id)
should be the same when the predictors are not independent.  Is this
correct?  (To be more concrete: my data are brightnesses at different
wavelengths.  Each brightness is an independent measurement, so the
elements of id should all be different?)

2) I tested survreg with uncertainties on an example where I already
know the answer (and where I am not using limits), and it does not
converge.  Below is the code I used, does anything jump out as
incorrect?

data = c(144.53, 1687.68, 5397.91)
err = c(8.32, 471.22, 796.67)
model = c(71.60, 859.23, 1699.19)
id = c(1, 2, 3)

This works (2.9 is the answer from simple chi_sq fitting):

survreg(Surv(time = data, event = c(1,1,1))~model-1, dist='gaussian',
init=c(2.9))

This does not converge (2.1 is the answer from chi_sq fitting):

survreg(Surv(time = data, event = c(1,1,1))~model-1+cluster(id),
weights=1/(err^2), dist='gaussian', init=c(2.1))

And this does, but the answer it returns is wonky:

data[2] = 3*err[2] # data[2] is very close to 3*err[2] already
survreg(Surv(time = data, event = c(1,2,1))~model-1+cluster(id),
weights=1/(err^2), dist='gaussian', init=c(2.1))

Thanks,

Kyle
On Wed, Jun 12, 2013 at 6:51 AM, Terry Therneau <therneau at mayo.edu> wrote: