Displaying 4 results from an estimated 4 matches for "inftime".
Did you mean:
iftime
2011 Apr 01
2
Cox Proportional Hazards model with a time-varying covariate
Hello Everyone,
I'm learning how to perform various statistical analyses in R. I'm checking my understanding by replicating examples from my SAS books. Below is an attempt to replicate a Cox Proportional Hazards model with a time-varying covariate. I think I'm doing this correctly but am not completely sure. I would appreciate it if someone could double-check my results. In case
2011 Nov 29
3
Problem in log
Hi all I have a function of log defined by y = log(1- exp(-a)), when
exp(-a) is greater, 1, it produce NaN. How can I remove this in R?
[[alternative HTML version deleted]]
2011 Nov 16
2
Error in random walk Metroplis-hasting
Hi R community,
I have some data set and construct the likelihood as follows
likelihood <- function(alpha,beta){
lh<-1
d<-0
p<-0
k<-NULL
data<-read.table("epidemic.txt",header = TRUE)
attach(data, warn.conflicts = F)
k <-which(inftime==1)
d <- (sqrt((x-x[k])^2+(y-y[k])^2))^(-beta)
p<-1 - exp(-alpha*d)
for(i in 1:100){
if(i!=k){
if(inftime[i]==0){
lh<-lh*(1-p[i])
}
if(inftime[i]==2){
lh<-lh*p[i]
}
}
}
re...
2011 Jun 13
0
Setting up counting process data for survival analysis
Hello Everyone,
I'm learning to do survival analysis in R using a time-varying covariate. I've managed to set up my data correctly using SAS and then to get the correct result using R.
What I'd like help with is getting the data set up correctly in R without having to resort to using SAS. Below are two datasets. The first is the raw data I'm starting out with. The second is set