search for: rweibul

Displaying 20 results from an estimated 84 matches for "rweibul".

Did you mean: rweibull
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 > .Rando...
2007 Oct 29
3
using survfit
...t2<-array(2,c(n1)) treatgrp=matrix(c(t1,t2)) st11<-array(1,c(n2)) st12<-array(2,c(n2)) st21<-array(1,c(n2)) st22<-array(2,c(n2)) strata=matrix(c(st11,st12,st21,st22)) time11=array(rweibull(n2,a11,1)) time12=array(rweibull(n2,a11,1)) time21=array(rweibull(n2,a21,1)) time22=array(rweibull(n2,a22,1)) time=matrix(c(time11, time12, time21, time22)) censorTime=runif(n,0,3) m=cbind(treatgrp,strata,time,censorTime) colnames(m)=c(“...
2007 Oct 18
1
programming question
...t2<-array(2,c(n1)) treatgrp=matrix(c(t1,t2)) st11<-array(1,c(n2)) st12<-array(2,c(n2)) st21<-array(1,c(n2)) st22<-array(2,c(n2)) strata=matrix(c(st11,st12,st21,st22)) time11=array(rweibull(n2,a11,1)) time12=array(rweibull(n2,a12,1)) time21=array(rweibull(n2,a21,1)) time22=array(rweibull(n2,a22,1)) time=matrix(c(time11, time12, time21, time22)) censorTime=runif(n,0,1) m=cbind(treatgrp,strata,time,censorTime) . colnames(m)=c...
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(...
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
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)) names(weib.test)<-c('site','wind_speed') fitted<-weib.test[,fitdistr(wind_speed,'weibull'),by=site] Error in class(ans[[length(byval) + jj]]) = class(testj[[jj]]) : invalid to set the class to...
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
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 return(cbind(time,event,T,C)) And then, I used this datase...
2007 Oct 19
0
calculating power of log rank test
...treatgrp=matrix(c(t1,t2)) st11<-array(1,c(n2)) st12<-array(2,c(n2)) st21<-array(1,c(n2)) st22<-array(2,c(n2)) strata=matrix(c(st11,st12,st21,st22)) time11=array(rweibull(n2,a11,1)) time12=array(rweibull(n2,a12,1)) time21=array(rweibull(n2,a21,1)) time22=array(rweibull(n2,a22,1)) time=matrix(c(time11, time12, time21, time22)) censorTime=runif(n,0,1) m=cbind(treatgrp,strata,time,censorTime)...
2008 Feb 14
0
help in simplyfiying programme
...t2<-array(2,c(n1)) treatgrp=matrix(c(t1,t2)) st11<-array(1,c(n2)) st12<-array(2,c(n2)) st21<-array(1,c(n2)) st22<-array(2,c(n2)) strata=matrix(c(st11,st12,st21,st22)) time11=array(rweibull(20,1,1/12)) time12=array(rweibull(20,1,1/12)) time21=array(rweibull(30,1,0.25)) time22=array(rweibull(30,1,0.25)) time=matrix(c(time11, time12, time21, time22)) censorTime=runif(n,0,2) m=cbind(treatgrp,strata,time,censorTime) colnames(m)=c(“treat”,”strata”,”time”,”cens...
2009 Nov 13
2
survreg function in survival package
Hi, Is it normal to get intercept in the list of covariates in the output of survreg function with standard error, z, p.value etc? Does it mean that intercept was fitted with the covariates? Does Value column represent coefficients or some thing else? Regards, ------------------------------------------------- tmp = survreg(Surv(futime, fustat) ~ ecog.ps + rx, ovarian,
2003 Jul 28
1
Optimization failed in fitting mixture 3-parameter Weibull distri bution using fitdistr()
...tion failed"). The procedures I tested are as following: >w3den <- function(x, a,b,c) {c/b*((x -a)/b)^(c-1)*exp(-((x-a)/b)^c)} # define 3-parameter Weibull density >w3den <- function(x, a,b,c) {c/b*((x -a)/b)^(c-1)*exp(-((x-a)/b)^c)} >set.seed(123) > x3 <- rweibull(100, shape = 4, scale = 100) # Distribution 1 > fitdistr(x3, w3den, start= list(a = 8.8, b = 90.77, c = 3.678)) # Fitting 3-parameter a b c 8.9487415 90.6667712 3.6722124 (15.1462445) (16.0657103) ( 0.7582376) Warning...
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]]
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 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 Guure postgraduate researcher/tutor Institute for Mathematical Research Universiti...
2011 Dec 19
1
Calculating the probability of an event at time "t" from a Cox model fit
...vent at specific time, using scoring scoring dataset which will have only covariates and not the response variables. Here is the sample code: n = 1000 beta1 = 2; beta2 = -1; lambdaT = .02 # baseline hazard lambdaC = .4 # hazard of censoring x1 = rnorm(n,0) x2 = rnorm(n,0) # true event time T = rweibull(n, shape=1, scale=lambdaT*exp(-beta1*x1-beta2*x2)) C = rweibull(n, shape=1, scale=lambdaC) #censoring time time = pmin(T,C) #observed time is min of censored and true event = time==T # set to 1 if event is observed dataphr=data.frame(time,event,x1,x2) library(survival) fit_coxph <- coxph...
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 individual survival times. I am probably missing something completely obvious. Any hints or advice are appreciated. Thanks Sixten > summar...
2009 Jul 16
2
Weibull Prediction?
...pe(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 and Fit Model y<-rweibull(10000,scale=scale,shape=shape) model<-survreg(Surv(y)~1,dist="weibull") ### Exp of coef and predict are the same exp(model$coef) predict(model,type=c("response"))[1] ### Here is the mean and median of the data mean(y) median(y) ### Fitted Mean and Median from survreg fitS...
2010 Sep 20
1
Removing slected values from original vector and definning new vector with the rest?
sampleSize <- 20 shape.true <- 1.82 scale.true <- 987 sampWB <- rweibull(sampleSize, shape=shape.true, scale=scale.true) print(sampWB) censidx <- sample(1:length(sampWB), length(sampWB)*0.3) Censored.data <- sampWB[censidx] noncensidx <- defines the rest values of the vector which is not included at Censored.data? [[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