similar to: Generate a Weibull regression data

Displaying 20 results from an estimated 3000 matches similar to: "Generate a Weibull regression data"

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
2003 Jul 28
1
Optimization failed in fitting mixture 3-parameter Weibull distri bution using fitdistr()
Dear All; I tried to use fitdistr() in the MASS library to fit a mixture distribution of the 3-parameter Weibull, but the optimization failed. Looking at the source code, it seems to indicate the error occurs at if (res$convergence > 0) stop("optimization failed"). The procedures I tested are as following: >w3den <- function(x, a,b,c)
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
2009 Jul 16
2
Weibull Prediction?
I am trying to generate predictions from a weibull survival curve but it seems that the predictions assume that the shape(scale for survfit) parameter is one(Exponential but with a strange rate estimate?). Here is an examle of the problem, the smaller the shape is the worse the discrepancy. ### Set Parameters scale<-10 shape<-.85 ### Find Mean scale*gamma(1 + 1/shape) ### Simulate Data
2012 Jan 29
1
r-help; weibull parameter estimate
Hello, If i write a function as below using log of weibull distribution i do not get the required results in estimating the parameters what do i do, please a/b * (t/b)^a-1 * exp(-t/b)^a n=500 x<-rweibull(n,2,2) z<-function(p) {(-n*log(p[1])+n*log(p[2])- (p[1]-1)*sum(log(x))+(p[1]-1)*log(p[2])+(sum(x/p[2])^(p[1]))  )} zz<-optim(c(0.5,0.5),z) zz [[alternative HTML version deleted]]
2014 Sep 03
3
Simulating from a Weibull distribution
Hi, I wish to simulate some data from a Weibull distribution. The rweibull function in R uses the parameterisation 'with shape parameter a and scale parameter b has density given by f(x) = (a/b) (x/b)^(a-1) exp(- (x/b)^a)'. However, it would be much more useful for me to simulate data using a different parameterisation of the Weibull, with shape a1 and scale b1, namely f(x) =
2008 Oct 07
3
Fitting weibull, exponential and lognormal distributions to left-truncated data.
Dear All, I have two questions regarding distribution fitting. I have several datasets, all left-truncated at x=1, that I am attempting to fit distributions to (lognormal, weibull and exponential). I had been using fitdistr in the MASS package as follows: fitdistr<-(x,"weibull") However, this does not take into consideration the truncation at x=1. I read another posting in this
2012 Jan 30
0
r-help; parameter estimate
I need help, the codes below estimates the weibull parameters with complete failure, my question is how do i change the state to include some censoring (may be right, type-I or type-II) to generate and estimate the parameters. thank you x=rweibull(10,2,2) library(survival) d<-data.frame(ob=c(x),state=1) s <- Surv(d$ob,d$state) sr <- survreg(s~1,dist="weibull")
2008 Oct 22
2
Weibull parameter estimation
Dear R-users I would like to fit weibull parameters using "Method of moments" in order to provide the inital values of the parameter to de function 'fitdistr' . I don`t have much experience with maths and I don't know how to do it. Can anyone please put me in the rigth direction? Borja [[alternative HTML version deleted]]
2001 Aug 28
2
Estimating Weibull Distribution Parameters - very basic question
Hello, is there a quick way of estimating Weibull parameters for some data points that are assumed to be Weibull-distributed? I guess I'm just too lazy to set up a Maximum-Likelihood estimation... ...but maybe there is a simpler way? Thanks for any hint (and yes, I've read help(Weibull) ;) Kaspar Pflugshaupt -- Kaspar Pflugshaupt Geobotanical Institute ETH Zurich, Switzerland
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]]
2011 Sep 14
2
Weibull point process
Dear list, I'm looking for a function to generate (simulate) a random Weibull point process. Can anyone help? Cheers, Torbj?rn Ergon, University of Oslo
2006 Sep 21
1
survival function with a Weibull dist
Hi I am using R to fit a survival function to my data (with a weibull distribution). Data: Survival of individuals in relation to 4 treatments ('a','b','c','g') syntax: ---- > survreg(Surv(date2)~males2, dist='weibull') But I have some problems interpreting the outcome and getting the parameters for each curve. --------- Value Std.
2009 Dec 13
1
Non-linear Weibull model for aggregated parasite data
Hi, I am trying to fit a non-linear model for a parasite dataset. Initially, I tried log-transforming the data and conducting a 2-way ANCOVA, and found that the equal variance of populations and normality assumptions were violated. Gaba et al. (2005) suggests that the Weibull Distribution is best for highly aggregated parasite distributions, and performs better (lower type 1 and 2 error rates)
2011 Apr 27
3
MASS fitdistr with plyr or data.table?
I am trying to extract the shape and scale parameters of a wind speed distribution for different sites. I can do this in a clunky way, but I was hoping to find a way using data.table or plyr. However, when I try I am met with the following: set.seed(144) weib.dist<-rweibull(10000,shape=3,scale=8) weib.test<-data.table(cbind(1:10,weib.dist))
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 Nov 10
3
sample mean, variance and SD
hi could you help me to solve this issue Question: Using command rweibull(100,8,15), simulate n = 100 realizations from Weibull(8; 15) distribution. Using the simulated sample, compute the sample mean, variance and standard deviation of these observations. I am trying like this sim<-rweibull(100,8,15) # simulated sample SM<-mean(sim) # simulated sample mean var(sim) # variance
2004 Jul 28
2
Simulation from a model fitted by survreg.
Dear list, I would like to simulate individual survival times from a model that has been fitted using the survreg procedure (library survival). Output shown below. My plan is to extract the shape and scale arguments for use with rweibull() since my error terms are assumed to be Weibull, but it does not make any sense. The mean survival time is easy to predict, but I would like to simulate
2011 Jun 23
2
Confidence interval from resampling
Dear R gurus, I have the following code, but I still not know how to estimate and extract confidence intervals (95%CI) from resampling. Thanks! ~Adriana #data penta<-c(770,729,640,486,450,410,400,340,306,283,278,260,253,242,240,229,201,198,190,186,180,170,168,151,150,148,147,125,117,110,107,104,85,83,80,74,70,66,54,46,45,43,40,38,10) x<-log(penta+1) plot(ecdf(x),
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