Re: [R] Error survreg: Density function returned an an invalid matrix

2015-11-16 Thread Israel Ortiz
Thanks Terry, I use the following formula for density: [image: f_X(x)= \begin{cases} \frac{\alpha x_\mathrm{m}^\alpha}{x^{\alpha+1}} & x \ge x_\mathrm{m}, \\ 0 & x < x_\mathrm{m}. \end{cases}] Where *x*m is the minimum value for x. I get this fórmula in https://en.wikipedia.org/wiki/Pareto_distri

Re: [R] Error survreg: Density function returned an an invalid matrix

2015-11-16 Thread Therneau, Terry M., Ph.D.
The error message states that there is an invalid value for the density. A long stretch of code is not very helpful in understanding this. What we need are the definition of your density -- as it would be written in a textbook. This formula needs to give a valid response for the range -infini

Re: [R] Error survreg: Density function returned an an invalid matrix

2015-11-13 Thread Israel Ortiz
Thanks Terry but the error persists. See: > library(foreign)> library(survival)> library(VGAM) > mypareto <- > list(name='Pareto',+ init= function(x, weights,parms){+ > alpha <- length(x)/(sum(log(x)))#this is a MLE for alpha+ > c(media <-(

Re: [R] Error survreg: Density function returned an an invalid matrix

2015-11-04 Thread Therneau, Terry M., Ph.D.
Hi, I want to perform a survival analysis using survreg procedure from survival library in R for a pareto distribution for a time variable, so I set the new distribution using the following sintax: library(foreign) library(survival) library(VGAM) mypareto <- list(name='Pareto