similar to: MLE in R

Displaying 20 results from an estimated 1000 matches similar to: "MLE in R"

2009 Dec 06
5
optim with constraints
Hi, dear R users I am a newbie in R and I wantto use the method of meximum likelihood to fit a Weibull distribution to my survival data. I use "optim" as follows: optim(c(1, 0.25),weibull.like,mydata=mydata,method="L-BFGS-B",hessian = TRUE) My question is: how do I setup the constraints so that the two parametrs of Weibull to be pisotive? Or should I use other function
1999 Dec 09
1
nlm() problem or MLE problem?
I am trying to do a MLE fit of the weibull to some data, which I attach. fitweibull<-function() { rt<-scan("r/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)
2010 Jul 23
1
Survival analysis MLE gives NA or enormous standard errors
Hi, I am trying to fit the following model: sr.reg.s4.nore <- survreg(Surv(age_sym4,sym4), as.factor(lifedxm), data=bip.surv) Where age_sym4 is the age that a subject develops clinical thought problems; sym4 is whether they develop clinical thoughts problems (0 or 1); and lifedxm is mother's diagnosis: BIPOLAR, MAJOR DEPRESSION, or CONTROL. I am interested in whether or not
2006 Jun 02
2
Problem with mle
R 2.3.0 Linux, SuSE 10.0 Hi I have two problems with mle - probably I am using it the wrong way so please let me know. I want to fit different distributions to an observed count of seeds and in the next step use AIC or BIC to identify the best distribution. But when I run the script below (which is part of my original script), I get one error message for the first call of mle: Error in
2012 Apr 22
1
Survreg
Hi all, I am trying to run Weibull PH model in R. Assume in the data set I have x1 a continuous variable and x2 a categorical variable with two classes (0= sick and 1= healthy). I fit the model in the following way. Test=survreg(Surv(time,cens)~ x1+x2,dist="weibull") My questions are 1. Is it Weibull PH model or Weibull AFT model? Call: survreg(formula = Surv(time, delta) ~ x1
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
2005 Nov 24
4
Survreg Weibull lambda and p
Hi All, I have conducted the following survival analysis which appears to be OK (thanks BRipley for solving my earlier problem). > surv.mod1 <- survreg( Surv(timep1, relall6)~randgrpc, data=Dataset, dist="weibull", scale = 1) > summary(surv.mod1) Call: survreg(formula = Surv(timep1, relall6) ~ randgrpc, data = Dataset, dist = "weibull", scale = 1)
2005 Aug 27
1
survival parametric question
Hi to all, I am working on design package using survival function. First using PSM and adopting a weibull specification for the baseline hazard , I have got the following results(since weibull has both PH and AFT propreties ,in addition I have used the PPHSm command): Value Std. Error z p (Intercept) 1.768 1.0007 1.77 7.73e-02 SIZE -0.707 0.0895 -7.90 2.80e-15
2012 Feb 21
3
HELP ERROR Weibull values must be > 0
GUYS, I NEED HELP WITH ERROR: library(MASS) > dados<-read.table("mediaRGinverno.txt",header=FALSE) > vento50<-fitdistr(dados[[1]],densfun="weibull") Erro em fitdistr(dados[[1]], densfun = "weibull") : Weibull values must be > 0 WHY RETURN THIS ERROR? WHAT CAN I DO? BEST REGARDS [[alternative HTML version deleted]]
2002 Jan 17
1
weibull in R
Hi all I try to make a weibull survival analysis on R. I know make this on GLIM, and now I try to make the GLIM exercice GLEX8 on R to learning and compare the test. The variables are: time censor group bodymass In GLIM I make: $calc %s=1 $ to fit weibull rather than exponential $input %pcl weibull $ $macro model group*bodymass $endmac$ $use weibull t w %s $ Then, GLIM estimate an alpha for the
2009 Mar 08
2
survreg help in R
Hey all, I am trying to use the survreg function in R to estimate the mean and standard deviation to come up with the MLE of alpha and lambda for the weibull distribution. I am doing the following: times<-c(10,13,18,19,23,30,36,38,54,56,59,75,93,97,104,107,107,107) censor<-c(1,0,0,1,0,1,1,0,0,0,1,1,1,1,0,1,0,0) survreg(Surv(times,censor),dist='weibull') and I get the following
2005 Nov 22
3
Weibull and survival
Hi I have been asked to provide Weibull parameters from a paper using Kaplan Meir survival analysis. This is something I am not familiar with. The survival analysis in R works nicely and is the same as commercial software (only the graphs are superior in R). The Weibull does not and produces an error (see below). Any ideas why this error should occur? My approach may be spurious.
2005 Jun 09
2
Weibull survival modeling with covariate
I was wondering if someone familiar with survival analysis can help me with the following. I would like to fit a Weibull curve, that may be dependent on a covariate, my dataframe "labdata" that has the fields "cov", "time", and "censor". Do I do the following? wieb<-survreg(Surv(labdata$time, labadata$censor)~labdata$cov,
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
2010 Jan 28
4
Problems with fitdistr
Hi, I want to estimate parameters of weibull distribution. For this, I am using fitdistr() function in MASS package.But when I give fitdistr(c,"weibull") I get a Error as follows:- Error in optim(x = c(4L, 41L, 20L, 6L, 12L, 6L, 7L, 13L, 2L, 8L, 22L, : non-finite value supplied by optim Any help or suggestions are most welcomed -- View this message in context:
2011 Oct 28
1
weibull fitdistr problem: optimization failed
I'm getting errors when running what seems to be a simple Weibull distribution function: This works: x <- c(23,19,37,38,40,36,172,48,113,90,54,104,90,54,157,51,77,78,144,34,29,45,16,15,37,218,170,44,121) rate <- c(.01,.02,.04,.05,.1,.2,.3,.4,.5,.8,.9) year <- c(100,50,25,20,10,5,3.3,2.5,2,1.2,1.1) library(MASS) x <- sort(x) tryCatch( f<-fitdistr(x, 'weibull'), error
2009 Apr 30
1
finite mixture model (2-component Weibull): plotting Weibull components?
Dear Knowledgeable R Community Members, Please excuse my ignorance, I apologize in advance if this is an easy question, but I am a bit stumped and could use a little guidance. I have a finite mixture modeling problem -- for example, a 2-component Weibull mixture -- where the components have a large overlap, and I am trying to adapt the "mclust" package which concern to normal
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,
2010 Nov 15
1
interpretation of coefficients in survreg AND obtaining the hazard function
1. The weibull is the only distribution that can be written in both a proportional hazazrds for and an accelerated failure time form. Survreg uses the latter. In an ACF model, we model the time to failure. Positive coefficients are good (longer time to death). In a PH model, we model the death rate. Positive coefficients are bad (higher death rate). You are not the first to be confused
2012 Jan 26
1
3-parametric Weibull regression
Hello, I'm quite new to R and want to make a Weibull-regression with the survival package. I know how to build my "Surv"-object and how to make a standard-weibull regression with "survreg". However, I want to fit a translated or 3-parametric weibull dist to account for a failure-free time. I think I would need a new object in survreg.distributions, but I don't know how