search for: pweibul

Displaying 20 results from an estimated 62 matches for "pweibul".

Did you mean: pweibull
2002 May 11
4
Is this a bug of pweibull()?
In rw1050, I found that > pweibull(3:10, 2) [1] 0.9998766 0.9999999 1.0000000 1.0000000 NaN NaN [7] NaN NaN Warning message: NaNs produced in: pweibull(q, shape, scale, lower.tail, log.p) more surprisingly, > pweibull(3:10, 2.1) [1] 0.9999566 1.0000000 1.0000000 -Inf NaN NaN [7]...
2008 Feb 08
2
Catching NaNs from pweibull()
Hello, I am working with the nls() function and inserting a formula into it that uses the pweibull function. However the pweibull function is annoyingly producing NaNs, which nls() refuses to handle. I have put a sample of the code below. Is there a way to prevent these NaNs from interfering, for example a method to catch them? I get the following error when I try to run the code: res.nls &lt...
2002 May 12
2
Is this a bug of pweibull()? (Follow up)
Please allow me to add just a little more about this: nothing wrong with pweibull(), namely, the two cases I reported: pweibull(3:10, 2) and pweibull(3:10, 2.1), in rw1041 and earlier version. I wonder this might just due to the change from rw1041 to rw1050, however, I can't find anything relevant (seems to me) in the News or Readme. Thanks Sundar for the suggestion of us...
2013 Mar 03
1
distribution functions and lists
Hello everyone, I have a quick question but I am stuck with it and I do not know how to solve it. Imagine I need the distribution function of a Weibull(1,1) at t=3, then I will write pweibull(3,1,1). I want to keep the shape and scale parameters in a list (or a vector or whatever). Then I have parameters<-list(shape=1,scale=1) but when I write pweibull(3,parameters) I get the following error: Error in pweibull(q, shape, scale, lower.tail, log.p) : Non-numeric argument to mathem...
2008 Nov 26
1
survreg and pweibull
Dear all - I have followed the thread the reply to which was lead by Thomas Lumley about using pweibull to generate fitted survival curves for survreg models. http://tolstoy.newcastle.edu.au/R/help/04/11/7766.html Using the lung data set, data(lung) lung.wbs <- survreg( Surv(time, status)~ 1, data=lung, dist='weibull') curve(pweibull(x, scale=exp(coef(lung.wbs)), shape=1/lung.wbs $s...
2002 Feb 28
1
pweibull.c (PR#1334)
Full_Name: M Welinder Version: 1.4 OS: (src) Submission from: (NULL) (192.5.35.38) It seems to me that pweibull can be improved in the lower_tail=TRUE and log_p=FALSE case by using expm1. Something like -expm1(-pow(x / scale, shape)), I think. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send...
2010 May 26
2
Survival analysis extrapolation
...to 360, 0 represents a withdrawal and 1 represents a failure. The code I've tried is as follows: survdata<-read.csv("Data.csv") WeiModel<-survreg(Surv(survdata$Time,survdata$Status)~survdata$Treatment) summary(WeiModel) n<-seq(0, 1080, 30 ) ##Compute Weibull CDF A<-pweibull(n, scale=exp(WeiModel$coef[1]), shape=1/WeiModel$scale) B<-pweibull(n, scale=exp(WeiModel$coef[1]+WeiModel$coef[2]),shape=1/WeiModel$scale) ##Transform into survivor function ACurv<-1-A BCurv<-1-B The problem is, that the Weibull curve is predicting a survival probability for treatme...
2003 May 04
0
R-1.7.0 build feedback: NetBSD 1.6 (PR#2837): final report
...in/R, it works, and passes all but the base-Ex test. Brian Ripley responds to the reg-tests-1.Rout.fail file found in the working build: >> ... >> The error will be in the last command line, so >> only the last few lines of the file are relevant: to wit >> >> > ## pweibull(large, log=T): >> > stopifnot(pweibull(seq(1,50,len=1001), 2,3, log = TRUE) < 0) >> Error: pweibull(seq(1, 50, len = 1001), 2, 3, log = TRUE) < 0 is not TRUE >> >> for which you would need to investigate the output of >> >> pweibull(seq(1, 50, len = 100...
2011 Oct 20
1
R code Error : Hybrid Censored Weibull Distribution
...t. I'm sending the code : ######################################################################################### f3<-function(t,r){ #calculation for t1 fb1<-function(t,r){ v1<-numeric(0) for(j in 1:r){ int1<-function(x1){ int_1<- (1/p+log(x1/lamda))^2 * j * choose(n,j) * (pweibull(x1,shape=p,scale=lamda))^(j-1) * (1 - pweibull(x1,shape=p,scale=lamda))^(n-j) * dweibull(x1,shape=p,scale=lamda) int_1 } v1[j]<-integrate(int1,lower=0,upper=t)$value } sum(v1) } #calculation for t2 fb2<-function(t,r){ v2<-numeric(0) for(j in 1:r){ int2<-function(x2){ int_2<- (1/p...
2011 Jun 23
2
Confidence interval from resampling
...;weibull") x.wei shape scale 6.7291685 5.3769965 (0.7807718) (0.1254696) xwei.shape <- x.wei$estimate[[1]] xwei.scale <- x.wei$estimate[[2]] x.wei<-fitdistr(x,"weibull") x.wei xwei.shape <- x.wei$estimate[[1]] xwei.scale <- x.wei$estimate[[2]] curve(pweibull(x, shape=xwei.shape, scale = xwei.scale,lower.tail=TRUE, log.p=FALSE), add=TRUE,col='green',lwd=3) #draw random numbers from a weibull distribution 100 times with shape=xwei.shape, scale = xwei.scale draw <- lapply(1:100, function(.x){ out<-rweibull(x, shape=xwei.shape, scale = xwei...
2004 Apr 22
1
slower execution in R 1.9.0
...perations under 1.9.0 self.time self.pct total.time total.pct $<-.data.frame 110.64 93.3 110.68 93.3 FMD 5.38 4.5 118.60 100.0 DIRinf 0.54 0.5 11.82 10.0 INDinf 0.46 0.4 9.78 8.2 pweibull 0.38 0.3 0.38 0.3 top 5 operations under 1.7.1 self.time self.pct total.time total.pct pweibull 2.62 55.7 2.62 55.7 ^ 0.76 16.2 0.76 16.2 CalcDistance 0.1...
2008 Mar 02
1
Problem plotting curve on survival curve (something silly?)
...very nice so far. The I followed bits and pieces of other peoples posts in the past to plot on a weibull regression... > my_curve.Plac <- survreg( Surv(Survival, Censored==0)~ TreatmentGroup, subset=TreatmentGroup=="Placebo", data=TestData, dist='weibull') > curve(pweibull(x, scale=exp(coef(my_curve.Plac)), shape=1/my_curve.Plac$scale, lower.tail=FALSE),from=0, col="black", to=max(TestData$Survival), add=TRUE) > my_curve.Pred <- survreg( Surv(Survival, Censored==0)~ TreatmentGroup, subset=TreatmentGroup=="Prednisolone", data=TestData,...
2004 Nov 23
6
Weibull survival regression
Dear R users, Please can you help me with a relatively straightforward problem that I am struggling with? I am simply trying to plot a baseline survivor and hazard function for a simple data set of lung cancer survival where `futime' is follow up time in months and status is 1=dead and 0=alive. Using the survival package: lung.wbs <- survreg( Surv(futime, status)~ 1, data=lung,
2008 Aug 21
1
pnmath compilation failure; dylib issue?
...2.o ftrunc.o gamma.o gamma_cody.o i1mach.o imax2.o imin2.o lbeta.o lgamma.o lgammacor.o mlutils.o pbeta.o pbinom.o pcauchy.o pchisq.o pexp.o pf.o pgamma.o pgeom.o phyper.o plnorm.o plogis.o pnbeta.o pnbinom.o pnchisq.o pnf.o pnmath.o pnorm.o pnt.o polygamma.o ppois.o pt.o ptukey.o punif.o pweibull.o qbeta.o qbinom.o qcauchy.o qchisq.o qexp.o qf.o qgamma.o qgeom.o qhyper.o qlnorm.o qlogis.o qnbeta.o qnbinom.o qnchisq.o qnf.o qnorm.o qnt.o qpois.o qt.o qtukey.o qunif.o qweibull.o sign.o stirlerr.o toms708.o -lgomp -F/Library/Frameworks/R.framework/.. - framework R -Wl,-framework -Wl,C...
2006 Nov 11
1
Fitting a survival curve
I am new to R and am trying to fit a survival curve with a weibull hazard function to a set of data giving the probability of survival to age x, given the year of birth, in the form: Probability of survival: Birth year 1980 1981 ... 2003 .2 0.90 0.89 ... 0.87 1 0.80 0.81 ... 0.79 age 2 0.75 0.74 ... 0.73 3 0.70 0.69 ... 0.68 5 0.50 0.49 ... 0.43 10 0.30 0.31 ... 0.26 I would like to be
2008 Apr 15
1
Weibull
Dear R users, This is a basic question. I want to fit a Weibull distribution. fitdistr(data, "weibull") works and it is a maximum likelihood fitting. Is it a good method ? Or is it better to write a function for the log-likelihood and the gradient and to use a numerical routine ? Fitdistr works for uncensored data, but what can I use for censored (and uncensored) data ? Thank you
2010 Mar 01
1
Fitting chi-squared distribution
Dear all, I have a question regarding performing test if the data fits chi-squared distribution. For example, using ks.test() I found in the examples how to fit it to gamma or weibull x<-rnorm(100) ks.test(x, "pweibull", shape=2,scale=1) for the gamma, pgamma can be used But I cannot find the value of this second parameter for the chi-squared distribution. Maybe someone experienced the similar problem? Thanks a lot! [[alternative HTML version deleted]]
2012 Jan 04
1
KS and AD test for Generalized PAreto and Generalized Extreme value
Dear R helpers, I need to use KS and AD test for Generalized Pareto and Generalized extreme value. E.g. if I need to use KS for Weibull, I have teh syntax ks.test(x.wei,"pweibull", shape=2,scale=1) Similarly, for AD I use ad.test(x, distr.fun, ...) My problem is fir given data, I have estimated the parameters of GPD and GEV using lmom. But I am not able to find out the distribution name I should be use for these distributions if I wish to use these tests. E.g, fo...
2010 Sep 21
2
Survival curve mean adjusted for covariate: NEED TO DO IN NEXT 2 HOURS, PLEASE HELP
...fit to a data set, adjusted for a categorical covariate , gender (0=male,1=female). Here is my code: library(survival) survdata<-read.csv("data.csv") ##Fit Weibull model to data WeiModel<-survreg(Surv(survdata$Time,survdata$Status)~survdata$gender) summary(WeiModel) P<-pweibull(n, scale=exp(WeiModel$coef[1]), shape=1/WeiModel$scale) ##Return mean scale<-exp(WeiModel$coef[1]) shape<-1/WeiModel$scale mean <- scale*gamma(1+1/shape) mean The problem is that the mean is based on the baseline coefficient which assumes the population is male (= 0). I want an...
1999 Dec 09
1
nlm() problem or MLE problem?
...rt/data2/triam1.dat") rt<-sort(rt) plot(rt,ppoints(rt)) a<-9 b<-.27 fn<-function(p) -sum( log(dweibull(rt,p[1],p[2])) ) cat("starting -log like=",fn(c(a,b)),"\n") out<-nlm(fn,p=c(a,b), hessian=TRUE) xfit<-seq(min(rt),max(rt),(max(rt)-min(rt))/100) yfit<-pweibull(xfit,out$estimate[1], out$estimate[2]) lines(xfit,yfit,lty=2) yfit2<-pweibull(xfit,a, b) lines(xfit,yfit2) list(out=out) } I got the starting values a=9, b=.27 from fitting the Weibull CDF by eye to a quantile plot of the data. The final values fitted by nlm() are a= 4.8299357, b= 0.2753897 I...