Dear R users, I have been trying to understand what the Weights arguments is doing in the estimation of the parameters when using the Surreg function. I looked through the function's code but I am not sure if I got it or not. For example, if I inclue the Surv function in it: survreg(Surv(vector, status)~1,weights=vector2,dist="Weibull") will it try to maximize the likelihood with a weight on each density function f (when non-censored) and 1-distribution, 1-F (censored case)? Can anyone tell me if I'm in the right way? Thank you very much, Boris [[alternative HTML version deleted]]
The survreg function uses case weights. That is, if a subject is given a weight of 2, the result is the same as if there were a second observation (exactly the same). Early in my career data sets that contained only categorical variables were often collapsed in just this way, in order to save on computer memory and allow the analysis of larger problems. (Continuous variables such as age might be turned into categorical to facilitate the collapse). Long, long ago in computer time... Terry Therneau
Thank you for your reply, it has been helpful. Do you know if the parameters estimators are MLE estimators? One more question: In my case study I have failures that occured on different objects that have different age and length, could I use weight to find the estimates of a weibull law and so to find the probabilty of failure per unit of length for example? Thank you very much again for your help, Boris -- View this message in context: http://r.789695.n4.nabble.com/Weights-using-Survreg-tp3781803p3785931.html Sent from the R help mailing list archive at Nabble.com.
Survreg produces MLE estimates. For your second question, don't know what you are asking. Can you be more specific and detailed? ---begin included message -- Do you know if the parameters estimators are MLE estimators? One more question: In my case study I have failures that occured on different objects that have different age and length, could I use weight to find the estimates of a weibull law and so to find the probabilty of failure per unit of length for example?
Sorry when we talk about about MLE estimates does that mean WLE?I am trying to understand if the survreg function is allowing a weight for each density function when calculating the likelihood. In my second question I was trying to explain that my problem is that I have pipes of different length and I want to know their probability to break per metre. My idea was to weight each of my observations to get estimate probabilities per metre.Does that sound realistic? Thank you very much, Boris -- View this message in context: http://r.789695.n4.nabble.com/Weights-using-Survreg-tp3781803p3793462.html Sent from the R help mailing list archive at Nabble.com.
You mean like the examples in help("heatmap") ? On Tue, Sep 6, 2011 at 1:20 PM, Jinrui Xu <jinruixu at umich.edu> wrote:> Hi everyone, > > I have three numerica vectors: x, y, z. I want to plot a heatmap or surface > plot of z against x and y. Is there any package for this? If possible, > please drop me several lines of example code. Thanks! > > jinrui, >-- Sarah Goslee http://www.functionaldiversity.org
Hi Sarah, To me, the heatmap function calculates "density value" for each grid of the heatmap automatically from the input matrix. In my case, I already got the "density value" as a vector, say Z. I want to plot a heat map with x and y as is axsis and z values as the "density" of grid. I am not familiar with R code, so I am writting to ask how to. Thanks! jinrui, Quoting Sarah Goslee <sarah.goslee at gmail.com>:> You mean like the examples in help("heatmap") ? > > On Tue, Sep 6, 2011 at 1:20 PM, Jinrui Xu <jinruixu at umich.edu> wrote: >> Hi everyone, >> >> I have three numerica vectors: x, y, z. I want to plot a heatmap or surface >> plot of z against x and y. Is there any package for this? If possible, >> please drop me several lines of example code. Thanks! >> >> jinrui, >> > > -- > Sarah Goslee > http://www.functionaldiversity.org > > >-- Ph.D Student, Bioinformatics Program Center for Computational Medicine and Bioinformatics (CCMB) The University of Michigan 100 Washtenaw Avenue Ann Arbor, MI 48109-2218 1075 Natural Science Building 830 North University Avenue Ann Arbor, MI 48109-1048 Tel (lab): 734-763-0514 http://www-personal.umich.edu/~jinruixu/