similar to: R-help; Censoring

Displaying 20 results from an estimated 2000 matches similar to: "R-help; Censoring"

2012 Apr 16
1
R: Help; error in optim
Hello, When i run the code below from Weibull distribution with 30% censoring by using optim i get an error form R, which states that Error in optim(start, fn = z, data = q, hessian = T) :? ? objective function in optim evaluates to length 25 not 1 can somebody?help me remove this error. Is my censoring approach correct. n=25;rr=1000 p=1.5;b=1.2 for (i in 1:rr){ q<-c(t,cen)
2012 Apr 14
0
R-help: Censoring data (actually an optim issue
Your function is giving NaN's during the optimization. The R-forge version of optimx() has functionality specifically intended to deal with this. NOTE: the CRAN version does not, and the R-forge version still has some glitches! However, I easily ran the code you supplied by changing optim to optimx in the penultimate line. Here's the final output. KKT condition testing Number of
2012 Apr 11
1
R-help; generating censored data
Hello, ?can i implement this as 10% censored data where t gives me failure and x censored. Thank you p=2;b=120 n=50 set.seed(132); r<-sample(1:50,45) t<-rweibull(r,shape=p,scale=b) t set.seed(123);? cens <- sample(1:50, 5)? x<-runif(cens,shape=p,scale=b)? x Chris Guure Researcher, Institute for Mathematical Research UPM
2012 Sep 20
3
Problem with Newton_Raphson
Hello, I have being trying to estimate the parameters of the?generalized?exponential distribution. The random number generation for the GE distribution is?x<-(-log(1-U^(1/p1))/b), where U stands for uniform dist. The data i have generated to estimate the parameters is right censored and the code is given below; The problem is that, the newton-Raphson approach isnt working and i do not know what
2012 Feb 05
1
R- Fisher Information
Dear All, Can you help me, with the code below how do I obtain the fisher information from it. Is my q<-replicate(1000,x) the right way to do simulation. thank you. x<-rweibull(100,0.8,1.5) q<-replicate(1000,x) z<-function(p){ beta<-p[1] eta<-p[2] log1<-(n*log(beta)-n*beta*log(eta)+(beta-1)*sum(log(x))-sum((x/eta)^beta)) return(-log1) } zz<-optim(c(0.5,0.5),z) zz Chris
2012 Feb 05
2
R-Censoring
Hi there, can somebody give me a guide as to how to generate data from weibull distribution with censoring for example, the code below generates only failure data, what do i add to get the censored data, either right or interval censoring q<-rweibull(100,2,10). Thank you Grace Kam student, University of Ghana [[alternative HTML version deleted]]
2012 Aug 31
3
fitting lognormal censored data
Hi , I am trying to get some estimator based on lognormal distribution when we have left,interval, and right censored data. Since, there is now avalible pakage in R can help me in this, I had to write my own code using Newton Raphson method which requires first and second derivative of log likelihood but my problem after runing the code is the estimators were too high. with this email ,I provide
2006 Jun 14
3
A question about stepwise procedures: step function
Dear all, I tried to use "step" function to do model selection, but I got an error massage. What I don't understand is that data as data.frame worked well for my other programs, how come I cannot make it run this time. Could you please tell me how I can fix it? ***************************************************************************************************
2005 Oct 05
1
how do I write Rd file for this?
Dear R-devel, I'm working on Prof. Loader's new version of locfit to try to get it pass R CMD check. I'm almost there, but I have a problem with some Rd files that I hope some one can help me resolve. Here's an example: In the package there's a function called locfit.censor(). This function can be used in a few different ways: locfit.censor(x, y, cens, ...)
2008 Oct 28
2
Fitting weibull and exponential distributions to left censoring data
Dear R-users I have some datasets, all left-censoring, and I would like to fit distributions to (weibull,exponential, etc..). I read one solution using the function survreg in the survival package. i.e survreg(Surv(...)~1, dist="weibull") but it returns only the scale parameter. Does anyone know how to successfully fit the exponential, weibull etc... distributions to left-censoring
2002 Jul 30
1
Optim() returns wrong maximum
Dear R-devel During the last half a year I have several times encountered the following problem with optim() when using method= "L-BFGS-B". The function return a value which is clearly not the maximum (seen from printing the value each time the function is called). Some output is shown below. A few things I have observed (as I remember it): a. The problem seems to occur when the
2007 Oct 29
3
using survfit
hie when i use plot.survfit to plot more than one graph why I only see the last graph how do i see the other graphs.for example n=20 n1=n/2 n2=n/4 a11=4;a12=4 ;a21=4 ;a22=4 t1<-array(1,c(n1)) t2<-array(2,c(n1)) treatgrp=matrix(c(t1,t2))
2007 Oct 18
1
programming question
hie i'm tryimg to generate two survival data using the following code (I know its ugly ) but it seems to repeat two of the variables can any one tell me whats the porblem. n=20 n1=n/2 n2=n/4 a11=1 ;a12=1.4 ;a21=16 ;a22=a12 * a21 t1<-array(1,c(n1)) t2<-array(2,c(n1)) treatgrp=matrix(c(t1,t2))
2013 Apr 15
2
regression with paired left-censored data
HI I am trying to analyse data which is left-censored (i.e. has values below the detection limit). I have been using the NADA package of R to derive summary statistics and do some regression. I am now trying to carry out regression on paired data where both my X and Y have left-censored data within them. I have tried various commands in R: rega = cenreg(Cen(conc, cens_ind) ~ Gp_ident))? with
2012 Mar 29
2
matrix with Loop
Hello! I got something to ask..whether you can help me with the R program...i got this for example 5x4 matrix..and i want to find: ?i) mean for each row of the matrix ii) median for each column of the matrix and i need to do this using a loop function...below is my program..u try to check it for me as the output that i got is not what i desired...thanks.. data<-rnorm(20,0,1)
2007 Jun 18
1
psm/survreg coefficient values ?
I am using psm to model some parametric survival data, the data is for length of stay in an emergency department. There are several ways a patient's stay in the emergency department can end (discharge, admit, etc..) so I am looking at modeling the effects of several covariates on the various outcomes. Initially I am trying to fit a survival model for each type of outcome using the psm
1999 Aug 30
1
rexp and rweibull
In splus rexp() and rweibull() are related: > set.seed(153) > rexp(1) [1] 0.0493267 > set.seed(153) > rweibull(1, shape=1) [1] 0.0493267 (you can also try shape =2, then rweibull = sqrt(rexp) ) However, in rw0.64.1 (on Win NT) they are different > .Random.seed <- 1:4 > rexp(1) [1] 1.412030 > .Random.seed <- 1:4 > rweibull(1, shape=1) [1] 2.054032 May be rweibull
2008 Jun 17
2
R error using Survr function with gcmrec
Would someone be able to help with this question? I'm using the Gcmrec, Survrec, and Design packages to do a power analysis on simulated data. I'm receiving an error after using the Survr function that all data must have a censoring time even after using the gcmrec function: newdata<-addCenTime(olddata). My program is below. I'd greatly appreciate any help!
2012 May 30
5
problem with ifelse
Dear all, ?The code below is used to generate interval censored data but unfortunately there is an error with the ifelse which i am not able to rectify. ?Can somebody help correct it for me. Thank you t<-rexp(20,0.2)? v<-c(0,m,999)? y<-function(t,v){ ? z<-numeric(length(t (( ? ? s<-numeric(length(t (( ? ? ? for(i in 1:length(t)){ ? ? ? ? for(j in 1:length(v-1))? ? ? ? ? { ifelse
2012 Mar 06
1
Scale parameter in Weibull distribution
Hi all, I'm trying to generate a Weibull distribution including four covariates in the model. Here is the code I used: T = rweibull(200, shape=1.3, scale=0.004*exp(-(-2.5*b1+2.5*b2+0.9*x1-1.3*x2)/1.3)) C = rweibull(n, shape=1.5, scale=0.008) #censoring time time = pmin(T,C) #observed time is min of censored and true event = time==T # set to 1 if event is observed