Displaying 13 results from an estimated 13 matches for "chris_kelvin2001".
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 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)
2012 May 03
2
How to replace NA with zero (0)
Hello,
?When i generate data with the code below there appear NA as part of the generated data, i prefer to have zero (0) instead of NA on my data.
Is there a command i can issue to replace the NA with zero (0) even if it is after generating the data??
Thank you
library(survival)
p1<-0.8;b<-1.5;rr<-1000
for(i in 1:rr){
r<-runif(45,min=0,max=1)
t<-rweibull(45,p1,b)
2012 Apr 14
0
R-help: Censoring data (actually an optim issue
...lt methods. When I tried "all.methods", one (uobyqa) seemed
to lock up. This is a fairly ill-conditioned problem.
Best, JN
On 04/14/2012 06:00 AM, r-help-request at r-project.org wrote:
> Message: 13
> Date: Fri, 13 Apr 2012 03:54:43 -0700 (PDT)
> From: Christopher Kelvin <chris_kelvin2001 at yahoo.com>
> To: "r-help at r-project.org" <r-help at r-project.org>
> Subject: [R] R-Help: Censoring data
> Message-ID:
> <1334314483.27693.YahooMailNeo at web65408.mail.ac4.yahoo.com>
> Content-Type: text/plain; charset=iso-8859-1
>
> Hello,
>...
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 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]]
2012 Jan 29
1
r-help; weibull distribution
Please, Help me,
How do I generate data from the weibull distribution if the data contain both failure and interval censored,
For example, I want to generate n=100, shape=2 and scale =4 with 30% interval censored.
What about right censoring
Thank you
[[alternative HTML version deleted]]
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")
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 Apr 11
1
R-help; Censoring
Hello,
I wish to?censor 10% of my sample units of 50 from a Weibull distribution. Below is the code for it.
I will need to know whether what i have done is correct and if not, can i have any suggestion to improve it?
Thank you
?p=2;b=120
n=50
r=45
t<-rweibull(r,shape=p,scale=b)
meantrue<-gamma(1+(1/p))*b
meantrue
cen<- runif(n-r,min=0,max=meantrue)
cen
Chris Guure
Researcher,
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 Aug 28
1
Optim Problem
Hello,
I want to estimate the exponential parameter by using?optim?with the following input, where t contains 40% of the data and q contains 60% of the data within an interval. In implementing the code command for optim i want it to contain both the t and q data so i can obtain the correct estimate. Is there any suggestion as to how this can be done. I have tried h<-c(t,q) but it is not working
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