Cumulative baseline hazard can be estimated non-parametrically through a Breslow estimator. Must take note that we are assuming a semimarkov process in these transitions.
if(no_mostrar==1){
for(i in c(1:3)){
print(survdiff(Surv(time,status==1)~tipo_de_programa_2,data=subset(ms_d_match_surv, trans == i)))
}
for(i in c(1:5)){
print(survdiff(Seurv(time,status==1)~tipo_de_programa_2,data=subset(ms_d_match_surv, trans == i)))
}
}
#We consider first the model without any proportionality assumption on the baseline hazards; this is achieved by adding strata(trans) to the formula, which estimates separate baseline hazards for different values of trans (the transitions).
pr0 <- subset(ms_d_match_surv, tipo_de_plan_res_1==0)
pr1 <- subset(ms_d_match_surv, tipo_de_plan_res_1==1)
attr(pr0, "trans") <- trans_matrix
attr(pr1, "trans") <- trans_matrix
#Since there are tied event times, we need to specify ties="breslow" in order to obtain the Aalen-Johansen estimator of
#the transition probability
#If we only want the cumulative hazard for the relapse → death transition, we can
#select the rows that refer to transition 3.
#The stacked format allows to calculate all cumulative hazards via the basic coxph function.
c0 <- survival::coxph(Surv(time, status) ~ strata(trans), #Surv(time, status) ~ strata(trans)
data = pr0, method = "breslow")
c1 <- survival::coxph(Surv(time, status) ~ strata(trans),
data = pr1, method = "breslow")
cx0 <- coxph(Surv(Tstart,Tstop,status)~strata(trans),
data=pr0,method="breslow")
cx1 <- coxph(Surv(Tstart,Tstop,status)~strata(trans),
data=pr1,method="breslow")
#The value of time is equal to Tstop−Tstart; it is of use in ’clock reset’-models, where the time t refers to the time spent in the current state
#The alternative is to first apply the msfit function, which we also need when computing the transition
#probabilities
# piece-wise constant estimates - because is cox
msf0 <- mstate::msfit(object = c0, trans = trans_matrix, vartype ="aalen")
msf1 <- mstate::msfit(object = c1, trans = trans_matrix, vartype ="aalen")
msfx0 <- mstate::msfit(object = cx0, trans = trans_matrix, vartype ="aalen")
msfx1 <- mstate::msfit(object = cx1, trans = trans_matrix, vartype ="aalen")
#Haz contains the estimated cumulative hazard for each of the transitions for the particular patient
#specified in newd, while varHaz contains the estimated variances of these cumulative hazards,
#as well as the covariances for each combination of two transitions. All are evaluated at the
#time points for which any event in any transition occurs, possibly augmented with the largest
#(non-event) time point in the data. The summary method for msfit objects is most conveniently
#used for a summary. If we also would like to have a look at the covariances, we could set the
#argument variance equal to TRUE.
#This is a list with elements Haz (with the estimated cumulative hazard values at all event
#times), varHaz (with the covariances of each pair of estimated cumulative hazards at each
#event time point, i.e., cov( c Abgh(t), Abkl(t))), and trans, in which the transition matrix is stored
#for further use. The (co)variances of the estimated cumulative hazards may be computed in
#two different ways: by means of the Aalen estimator or by means of the Greenwood estimator.
#An advantage of the Greenwood estimator is the fact that it yields exact multinomial standard
#errors for the transition probabilities when there is no censoring. The two estimators give
#almost equal results in all practical applications.
newtime0 = seq(from=round(min(ms_d_match_surv$time),0), to= round(max(ms_d_match_surv$time),0))
msf0_plot<-
plot(msf0,
#cols=c()
type="single",
use.ggplot = TRUE)+
ggtitle("")+
ylim(0,1.5)+
theme_bw()+
scale_x_continuous("",breaks=seq(0,max(newtime0,na.rm=T),by=365.25), labels=(1:length(seq(0,max(newtime0,na.rm=T),by=365.25))-1)) +
theme(legend.position = "bottom")+
scale_y_continuous(breaks=seq(0,1.5,by=1.5/10),limits=c(0,1.5))
## Scale for 'y' is already present. Adding another scale for 'y', which will
## replace the existing scale.
msf1_plot<-
plot(msf1,
#cols=c()
type="single",
use.ggplot = TRUE)+
ggtitle("")+
ylim(0,1.5)+
theme_bw()+
scale_x_continuous("",breaks=seq(0,max(newtime0,na.rm=T),by=365.25), labels=(1:length(seq(0,max(newtime0,na.rm=T),by=365.25))-1)) +
theme(legend.position = "bottom")+
scale_y_continuous(breaks=seq(0,1.5,by=1.5/10),limits=c(0,1.5))
## Scale for 'y' is already present. Adding another scale for 'y', which will
## replace the existing scale.
ggarrange(msf0_plot,msf1_plot,
labels = c("Ambulatory", "Residential"),
common.legend = TRUE,
#label.y="Cumulative Baseline Hazards",
# label.x="Years",
legend = "bottom")
Figure 1a. Estimate of Cumulative Hazards (Semimarkov), Stratified by Setting
jpg_path<-rstudioapi::getSourceEditorContext()$path
if (grepl("CISS Fondecyt",jpg_path)==T){
jpg_path<-paste0("C:/Users/CISS Fondecyt/Mi unidad/Alvacast/SISTRAT 2019 (github)/")
} else if (grepl("andre",jpg_path)==T){
jpg_path<-paste0('C:/Users/andre/Desktop/SUD_CL/')
} else if (grepl("E:",jpg_path)==T){
jpg_path<-paste0("E:/Mi unidad/Alvacast/SISTRAT 2019 (github)/")
} else {
jpg_path<-paste0("~/")
}
if(no_mostrar==1){
jpeg(paste0(jpg_path,"_mult_state_ags/Cum_haz_markov_set_apr22.jpg"), height=14, width= 12, res= 320, units = "in")
ggarrange(msf0_plot,msf1_plot,
labels = c("Ambulatory", "Residential"),
common.legend = TRUE,
#label.y="Cumulative Baseline Hazards",
# label.x="Years",
legend = "bottom")
dev.off()
}
if(no_mostrar==1){
for(i in c(1:3)){
print(survdiff(Surv(time,status==1)~tipo_de_programa_2,data=subset(ms_d_match_surv_oct_2022, trans == i)))
}
for(i in c(1:5)){
print(survdiff(Seurv(time,status==1)~tipo_de_programa_2,data=subset(ms_d_match_surv_oct_2022, trans == i)))
}
}
pr0_9s <- subset(ms_d_match_surv_oct_2022, tipo_de_plan_res_1==0)
pr1_9s <- subset(ms_d_match_surv_oct_2022, tipo_de_plan_res_1==1)
attr(pr0_9s, "trans") <- trans_matrix2
attr(pr1_9s, "trans") <- trans_matrix2
c0_9s <- survival::coxph(Surv(time, status) ~ strata(trans), #Surv(time, status) ~ strata(trans)
data = pr0_9s, method = "breslow")
c1_9s <- survival::coxph(Surv(time, status) ~ strata(trans),
data = pr1_9s, method = "breslow")
cx0_9s <- coxph(Surv(Tstart,Tstop,status)~strata(trans),
data=pr0_9s,method="breslow")
cx1_9s <- coxph(Surv(Tstart,Tstop,status)~strata(trans),
data=pr1_9s,method="breslow")
msf0_9s <- mstate::msfit(object= c0_9s, trans= trans_matrix2,vartype ="aalen")
msf1_9s <- mstate::msfit(object= c1_9s, trans= trans_matrix2,vartype ="aalen")
msfx0_9s <- mstate::msfit(object= cx0_9s, trans= trans_matrix2,vartype ="aalen")
msfx1_9s <- mstate::msfit(object= cx1_9s, trans= trans_matrix2,vartype ="aalen")
newtime0_9s = seq(from=round(min(ms_d_match_surv_oct_2022$time),0), to= round(max(ms_d_match_surv_oct_2022$time),0))
msf0_plot_9s<-
plot(msf0_9s,
#cols=c()
type="single",
use.ggplot = TRUE)+
ggtitle("")+
ylim(0,1.5)+
theme_bw()+
scale_x_continuous("",breaks=seq(0,max(newtime0,na.rm=T),by=365.25), labels=(1:length(seq(0,max(newtime0,na.rm=T),by=365.25))-1)) +
theme(legend.position = "bottom")+
scale_y_continuous(breaks=seq(0,1.5,by=1.5/10),limits=c(0,1.5))
## Scale for 'y' is already present. Adding another scale for 'y', which will
## replace the existing scale.
msf1_plot_9s<-
plot(msf1_9s,
#cols=c()
type="single",
use.ggplot = TRUE)+
ggtitle("")+
ylim(0,1.5)+
theme_bw()+
scale_x_continuous("",breaks=seq(0,max(newtime0,na.rm=T),by=365.25), labels=(1:length(seq(0,max(newtime0,na.rm=T),by=365.25))-1)) +
theme(legend.position = "bottom")+
scale_y_continuous(breaks=seq(0,1.5,by=1.5/10),limits=c(0,1.5))
## Scale for 'y' is already present. Adding another scale for 'y', which will
## replace the existing scale.
msf01_9s<-
rbind.data.frame(cbind(res=0,msf0_plot_9s$data),cbind(res=1,msf1_plot_9s$data)) %>%
dplyr::mutate(res=factor(res, labels=c("Ambulatory", "Residential")))
msf01_9s %>%
#dplyr::mutate(trans=factor(trans, labels=as.character(unique(msf01_9s$trans_name)))) %>%
dplyr::mutate(trans_rec=factor(dplyr::case_when(trans %in% c(1,2)~ "1) Admission to Treatment termination",
trans %in% c(3,4)~ "2) Treatment termination to Readmission",
trans %in% c(5,6)~ "3) First to Second Readmission",
trans %in% c(7,8)~ "4) Second to Third Readmission",T~NA_character_))) %>%
ggplot()+
geom_step(aes(y=Haz, x=time, linetype=res, color=trans_name), size=1)+
facet_wrap(~trans_rec)+
theme_survminer()+
theme(legend.position = "bottom", legend.title = element_text(size = 9), legend.text = element_text(size=8),
legend.box="vertical", legend.margin=margin())+
scale_x_continuous(breaks=seq(0, 11*365.25, by = 365.25), labels=seq(0, 11, by = 1))+
xlab("Time from first admission (in years)")+
ylab("Hazard")+
scale_linetype_manual(values=c("twodash", "dotted"))+
scale_color_manual(values=rep(c('#06283D','#47B5FF'), 4))+
labs(color="Transition", linetype="Treatment Setting")
Figure 1b. Estimate of Cumulative Hazards (Semimarkov), Stratified by Setting (9 states)
if(no_mostrar==1){
jpeg(paste0(jpg_path,"_mult_state_ags/Cum_haz_markov_set_apr22_9s.jpg"), height=14, width= 12, res= 320, units = "in")
msf01_9s %>%
dplyr::mutate(trans_rec=factor(dplyr::case_when(trans %in% c(1,2)~ "1) Admission to Treatment termination",
trans %in% c(3,4)~ "2) Treatment termination to Readmission",
trans %in% c(5,6)~ "3) First to Second Readmission",
trans %in% c(7,8)~ "4) Second to Third Readmission",T~NA_character_))) %>%
ggplot()+
geom_step(aes(y=Haz, x=time, linetype=res, color=trans_name), size=1)+
facet_wrap(~trans_rec)+
theme_survminer()+
theme(legend.position = "bottom", legend.title = element_text(size = 10), legend.text = element_text(size=9),
legend.box="vertical", legend.margin=margin())+
scale_x_continuous(breaks=seq(0, 11*365.25, by = 365.25), labels=seq(0, 11, by = 1))+
xlab("Time from first admission (in years)")+
ylab("Hazard")+
scale_linetype_manual(values=c("twodash", "dotted"))+
scale_color_manual(values=rep(c('#06283D','#47B5FF'), 4))+
labs(color="Transition", linetype="Treatment Setting")
dev.off()
}
trans_for_four_st<-c("Admission -> Readmission","Readmission -> 2nd Readmission","2nd Readmission -> 3rd Readmission","3rd Readmission -> 4th Readmission")
abc_let<-c("A","B","C","D","E")
st_plot<-list()
sum_rest_msf0<-cbind(msf0$Haz$Haz, sqrt(msf0$varHaz$varHaz)*1.96, msf0$Haz$trans)
## Warning in cbind(msf0$Haz$Haz, sqrt(msf0$varHaz$varHaz) * 1.96, msf0$Haz$trans):
## number of rows of result is not a multiple of vector length (arg 1)
sum_rest_msf1<-cbind(msf1$Haz$Haz, sqrt(msf1$varHaz$varHaz)*1.96, msf1$Haz$trans)
## Warning in cbind(msf1$Haz$Haz, sqrt(msf1$varHaz$varHaz) * 1.96, msf1$Haz$trans):
## number of rows of result is not a multiple of vector length (arg 1)
for (i in 1:(length(trans_for_four_st))){
st_plot[[i]]<-
ggplot()+
geom_step(data=msf0$Haz %>% dplyr::filter(trans==i), aes(time, Haz, linetype="dashed"),size=1, alpha=.65) +
geom_step(data=msf1$Haz %>% dplyr::filter(trans==i), aes(time, Haz, linetype="solid"),size=1, alpha=.65) +
# geom_ribbon(data=msf0$varHaz %>% dplyr::mutate(ci_up=Haz+sqrt(msf0$varHaz$varHaz)*1.96 %>% dplyr::filter(trans==i), aes(time, Haz, linetype="solid"),size=1, alpha=.65) +
scale_linetype_manual(name= "Treatment\nsetting",values=c("dashed","solid"), labels=c("Ambulatory","Residential"))+
scale_x_continuous(breaks=seq(0, 11*365.25, by = 365.25), labels=seq(0, 11, by = 1))+
xlab("") +
ylab("") +
theme_minimal()+
theme(axis.title = element_blank())+
theme(legend.position="none",
legend.background = element_rect(fill="white",
size=0.5, linetype="solid",
colour ="black"))+
ggtitle(paste0(abc_let[[i]],") ",trans_for_four_st[[i]]))
}
p3 <- ggplot()+
geom_step(data=msf0$Haz %>% dplyr::filter(trans==i), aes(time, Haz, linetype="dashed"),size=1, alpha=.65) +
geom_step(data=msf1$Haz %>% dplyr::filter(trans==i), aes(time, Haz, linetype="solid"),size=1, alpha=.65) +
scale_linetype_manual(name= "Treatment setting",values=c("dashed","solid"), labels=c("Ambulatory","Residential"))+
lims(x = c(0,0), y = c(0,0))+
theme_void()+
theme(legend.position = c(0.5,0.5),
legend.key.size = unit(1, "cm"),
legend.text = element_text(size = 12),
legend.title = element_text(size = 15, face = "bold"))+
guides(colour = guide_legend(override.aes = list(size=9)))
fig_cox_abcd<-
ggarrange(
st_plot[[1]] + theme(plot.title = element_text(size = 10, face = "bold"))+ylim(0,.8),
st_plot[[2]] + theme(plot.title = element_text(size = 10, face = "bold"))+ylim(0,.8),
st_plot[[3]] + theme(plot.title = element_text(size = 10, face = "bold"))+ylim(0,.8),
st_plot[[4]] + theme(plot.title = element_text(size = 10, face = "bold"))+ylim(0,.8),
common.legend =T, legend="right"
)
## Warning: Removed 131 row(s) containing missing values (geom_path).
fig_cox_abcd_lab<-
annotate_figure(fig_cox_abcd, left = grid::textGrob("Cumulative hazards", rot = 90, vjust = 1, gp = grid::gpar(cex = 1.1)),
bottom = grid::textGrob("Years", gp = grid::gpar(cex = 1.1)))
fig_cox_abcd_lab
Figure 2a. Estimate of Cumulative Hazards (Semi-Markov), Five-states
if(no_mostrar==1){
ggsave(paste0(jpg_path,"_mult_state_ags/","Fig2_alt_apr22.jpg"),
fig_cox_abcd_lab, width = 11.5, height = 9, dpi = 600, units= "in")
ggsave(paste0(jpg_path,"_mult_state_ags/","Fig2_alt_apr22.eps"),
fig_cox_abcd_lab, width = 11.5, height = 9, dpi = 600, units= "in")
ggsave(paste0(jpg_path,"_mult_state_ags/","Fig2_alt_apr22.ps"),
fig_cox_abcd_lab, width = 11.5, height = 9, dpi = 600, units= "in")
ggsave(paste0(jpg_path,"_mult_state_ags/","Fig2_alt_apr22.pdf"),
fig_cox_abcd_lab, width = 11.5, height = 9, dpi = 600, units= "in")
}
trans_for_nine_st<-c("1) Admission to Treatment termination", "2) Treatment termination to Readmission","3) First to Second Readmission","4) Second to Third Readmission")
abc_let_9s<-c("A","B","C","D")
st_plot_9s<-list()
sum_rest_msf0_9s <- cbind.data.frame(msf0_9s$Haz$Haz, dplyr::filter(msf0_9s$varHaz, dplyr::case_when(trans1== trans2~T,T~F))) %>%
dplyr::rename("Haz"=1) %>%
dplyr::mutate(ci_lo= Haz-(sqrt(varHaz)*1.96),ci_up= Haz+(sqrt(varHaz)*1.96)) %>%
dplyr::mutate(trans_rec=factor(dplyr::case_when(trans1 %in% c(1,2)~ "1) Admission to Treatment termination",
trans1 %in% c(3,4)~ "2) Treatment termination to Readmission",
trans1 %in% c(5,6)~ "3) First to Second Readmission",
trans1 %in% c(7,8)~ "4) Second to Third Readmission",T~NA_character_))) %>%
dplyr::mutate(trans1=factor(trans1, labels=as.character(unique(msf01_9s$trans_name))))
sum_rest_msf1_9s <- cbind.data.frame(msf1_9s$Haz$Haz, dplyr::filter(msf1_9s$varHaz, dplyr::case_when(trans1== trans2~T,T~F))) %>%
dplyr::rename("Haz"=1) %>%
dplyr::mutate(ci_lo= Haz-(sqrt(varHaz)*1.96),ci_up= Haz+(sqrt(varHaz)*1.96)) %>%
dplyr::mutate(trans_rec=factor(dplyr::case_when(trans1 %in% c(1,2)~ "1) Admission to Treatment termination",
trans1 %in% c(3,4)~ "2) Treatment termination to Readmission",
trans1 %in% c(5,6)~ "3) First to Second Readmission",
trans1 %in% c(7,8)~ "4) Second to Third Readmission",T~NA_character_))) %>%
dplyr::mutate(trans1=factor(trans1, labels=as.character(unique(msf01_9s$trans_name))))
for (i in 1:(length(trans_for_nine_st))){
st_plot_9s[[i]]<-
ggplot()+
geom_step(data=sum_rest_msf0_9s %>% dplyr::filter(trans_rec==as.character(trans_for_nine_st[[i]])), aes(time, Haz, linetype="dashed", color=trans1, group=trans1),size=1, alpha=.65) +
geom_step(data=sum_rest_msf1_9s %>% dplyr::filter(trans_rec==as.character(trans_for_nine_st[[i]])), aes(time, Haz, linetype="solid", color=trans1, group=trans1),size=1, alpha=.65) +
#geom_ribbon(data=sum_rest_msf0_9s %>% dplyr::filter(trans_rec==as.character(trans_for_nine_st[[i]])), aes(time, ymin=ci_lo, ymax=ci_up, linetype="dashed", color=trans1, group=trans1),size=1, alpha=.65) +
#geom_ribbon(data=sum_rest_msf1_9s %>% dplyr::filter(trans_rec==as.character(trans_for_nine_st[[i]])), aes(time, ymin=ci_lo, ymax=ci_up, linetype="solid", color=trans1, group=trans1),size=1, alpha=.65) +
scale_linetype_manual(name= "Treatment\nsetting",values=c("dashed","solid"), labels=c("Ambulatory","Residential"))+
scale_x_continuous(breaks=seq(0, 11*365.25, by = 365.25), labels=seq(0, 11, by = 1))+
xlab("") +
ylab("") +
theme_minimal()+
theme(axis.title = element_blank())+
labs(color="Transition", linetype="Treatment Setting")+
theme(legend.position="none",
legend.background = element_rect(fill="white",
size=0.5, linetype="solid",
colour ="black"))+
scale_color_manual(values=rep(c('black','grey60'), 4))+
ggtitle(paste0(abc_let_9s[[i]],") ",trans_for_nine_st[[i]]))
}
fig_cox_abcd_9s<-
ggarrange(
st_plot_9s[[1]] + theme(plot.title = element_text(size = 10, face = "bold"))+ylim(0,1.4),
st_plot_9s[[2]] + theme(plot.title = element_text(size = 10, face = "bold"))+ylim(0,1.4),
st_plot_9s[[3]] + theme(plot.title = element_text(size = 10, face = "bold"))+ylim(0,1.4),
st_plot_9s[[4]] + theme(plot.title = element_text(size = 10, face = "bold"))+ylim(0,1.4),
common.legend =T, legend="right"
)
fig_cox_abcd_lab_9s<-
annotate_figure(fig_cox_abcd_9s, left = grid::textGrob("Cumulative hazards", rot = 90, vjust = 1, gp = grid::gpar(cex = 1.1)),
bottom = grid::textGrob("Years", gp = grid::gpar(cex = 1.1)))
fig_cox_abcd_lab_9s
Figure 2b. Estimate of Cumulative Hazards (Semi-Markov), Nine-states
if(no_mostrar==1){
ggsave(paste0(jpg_path,"_mult_state_ags/","Fig2_alt_apr22_9s.jpg"),
fig_cox_abcd_lab_9s, width = 11.5, height = 9, dpi = 600, units= "in")
ggsave(paste0(jpg_path,"_mult_state_ags/","Fig2_alt_apr22_9s.eps"),
fig_cox_abcd_lab_9s, width = 11.5, height = 9, dpi = 600, units= "in")
ggsave(paste0(jpg_path,"_mult_state_ags/","Fig2_alt_apr22_9s.ps"),
fig_cox_abcd_lab_9s, width = 11.5, height = 9, dpi = 600, units= "in")
ggsave(paste0(jpg_path,"_mult_state_ags/","Fig2_alt_apr22_9s.pdf"),
fig_cox_abcd_lab_9s, width = 11.5, height = 9, dpi = 600, units= "in")
}
#Son distintos, por mas que parezcan iguales.
#plot(cumhaz_data_a$time[which(cumhaz_data_a$trans=="Adm -> Ther.Disch")],round(cumhaz_data_a$Haz[which(cumhaz_data_a$trans=="Adm -> Ther.Disch")]-cumhaz_data_b$Haz[which(cumhaz_data_b$trans=="Adm -> Ther.Disch")],3))
library(ggplot2)
transition_label<- plots$title
attr(transition_label,"names")<- plots$trans
plot_comp_mssurvfit2<-
rbind(cbind.data.frame(msf0$Haz,setting="Ambulatory"),
cbind.data.frame(msf1$Haz,setting="Residential")) %>%
ggplot2::ggplot(aes(x = time, y = Haz, col = factor(setting), linetype = factor(setting))) +
geom_line(size=1, alpha=.65) +
facet_wrap(trans~., ncol=1, scales="free_y", labeller = as_labeller(transition_label)) +
scale_color_manual(name = "Type of program", values=c("#061F70","#A68D00"), labels= c("Ambulatory","Residential")) + # "#A65100" #"Cox",
scale_linetype_manual(name= "Type of program",values=c(1,4), labels=c("Ambulatory","Residential")) +
xlab("Years") + ylab("Cumulative hazard") +
theme_minimal()+
scale_x_continuous("",breaks=seq(0,max(newtime0,na.rm=T),by=365.25), labels=(1:length(seq(0,max(newtime0,na.rm=T),by=365.25))-1)) +
theme(legend.position=c(.9,.485),
legend.background = element_rect(fill="white",
size=0.5, linetype="solid",
colour ="black"))
#cumhaz_data_d %>%
# group_by(trans,model) %>% summarise(mean_haz=mean(Haz))
# No sé por qué no resulta que aparaezca, si los estoy viendo.
plot_comp_mssurvfit2
Figure 2c. Estimate of Cumulative Hazards (Semi-Markov), Five-states
if(no_mostrar==1){
jpeg(paste0(jpg_path,"_mult_state_ags/Cum_haz_ten_st_apr22.jpg"), height=20, width= 10, res= 320, units = "in")
plot_comp_mssurvfit2
dev.off()
}
n_iter<-10000
We also want to know the probability to be in each of the three states over time, not only the instantaneous transition rate reflected by the cumulative hazard. We need to create a data frame that represents an individual with Low risk score for reference. We need to compute the probability of readmission after being admitted to a treatment, with or without a therapeutic discharge, for the different periods.
For mstate package, it is possible to use simulation to calculate
transition probabilities through mssample
.
In semi-Markov models, solving the Kolmogorov forward equation numerically is not feasible because the transition is no longer a deterministic function of t, depending on the transition history to estimate differences. Considering the abovementioned, we calculated the transition probabilities not through a deterministic approach, but following a probabilistic one through resamples.
The cumulative hazards obtained are used to simulate the times at which patients transition between health states, that is, state occupancy probabilities with a “clock-reset” model at the times specified by 500 points.
We used a number of 5,000 resamples of trajectories.
#, fig.height=13, fig.width=10, fig.cap="Figure 12a. Aalen-Johansen estimator with confidence intervals", fig.align="center"
#n_iter=1000
time_before_probtrans_ci95<-Sys.time()
#load("C:/Users/andre/Desktop/SUD_CL/mult_state_carla_2.RData")
#For semi-Markov models, mstate provides the function mssample to produce both simulated
#trajectories and transition probability matrices from semi-Markov models, given the estimated
#piecewise-constant cumulative hazards (Fiocco, Putter, and van Houwelingen 2008), produced
#by msfit or msfit.flexsurvreg, though this is generally less efficient than pmatrix.simfs.
#PARA SEMI-MARKOV, PODEMOS SIMULAR TRAYECTORIAS Y MATRICES DE PROBABILIDADES DE TRANSICIÓN,
#DADOS LOS HAZARDS PIECEWISE-CONSTANT DADOS POR MSFIT, AUNQUE ES MENOS EFICIENTE QUE PMATRIX.SIMFS
invisible(c("mssample"))
#The mstate::mssample() function works by sampling survival times from each possible transition from the cumulative hazards. More precisely, the cumulative hazards are used to simulate the (discrete) times at which patients transition between health states using the base R function sample(), which is, in turn, used to count the number of patients in each health state at the times specified by the argument tvec.
#Multi-state models can be simulated using mstate::mssample(), which simulates state occupancy probabilities from predicted cumulative hazards.
#The mstate::mssample() function works by sampling survival times from each possible transition from the cumulative hazards. More precisely, the cumulative hazards are used to simulate the (discrete) times at which patients transition between health states using the base R function sample(), which is, in turn, used to count the number of patients in each health state at the times specified by the argument tvec.
#The function below uses mstate::mssample() to simulate state occupancy probabilities with a “clock-reset” model at the times specified in yr_grid.
#https://www.researchgate.net/publication/303029139_flexsurv_A_Platform_for_Parametric_Survival_Modeling_in_R/fulltext/5735e2f608aea45ee83ca2c0/flexsurv-A-Platform-for-Parametric-Survival-Modeling-in-R.pdf
#Jackson C. H. (2016). flexsurv: A Platform for Parametric Survival Modeling in R. Journal of statistical software, 70, i08. https://doi.org/10.18637/jss.v070.i08
#For semi-Markov models, mstate provides the function mssample to produce both simulated
#trajectories and transition probability matrices from semi-Markov models, given the estimated
#piecewise-constant cumulative hazards
# piece-wise constant estimates
set.seed(1234)
pmatrix_cox_a_0<-
mstate::mssample(msf0$Haz, trans = trans_matrix, clock = "reset", M = n_iter/2, tvec = seq(0,max(c(msf0$Haz$time,msf1$Haz$time),na.rm=T),by=max(c(msf0$Haz$time,msf1$Haz$time),na.rm=T)/500),do.trace=500)
## Replication 500 finished at Tue Oct 25 09:03:28 2022
## Replication 1000 finished at Tue Oct 25 09:03:29 2022
## Replication 1500 finished at Tue Oct 25 09:03:31 2022
## Replication 2000 finished at Tue Oct 25 09:03:32 2022
## Replication 2500 finished at Tue Oct 25 09:03:34 2022
## Replication 3000 finished at Tue Oct 25 09:03:35 2022
## Replication 3500 finished at Tue Oct 25 09:03:37 2022
## Replication 4000 finished at Tue Oct 25 09:03:38 2022
## Replication 4500 finished at Tue Oct 25 09:03:40 2022
## Replication 5000 finished at Tue Oct 25 09:03:41 2022
set.seed(1234)
pmatrix_cox_b_0<-
mstate::mssample(msf1$Haz, trans = trans_matrix, clock = "reset", M = n_iter/2, tvec = seq(0,max(c(msf0$Haz$time,msf1$Haz$time),na.rm=T),by=max(c(msf0$Haz$time,msf1$Haz$time),na.rm=T)/500),do.trace=500)
## Replication 500 finished at Tue Oct 25 09:03:43 2022
## Replication 1000 finished at Tue Oct 25 09:03:45 2022
## Replication 1500 finished at Tue Oct 25 09:03:46 2022
## Replication 2000 finished at Tue Oct 25 09:03:48 2022
## Replication 2500 finished at Tue Oct 25 09:03:50 2022
## Replication 3000 finished at Tue Oct 25 09:03:51 2022
## Replication 3500 finished at Tue Oct 25 09:03:53 2022
## Replication 4000 finished at Tue Oct 25 09:03:54 2022
## Replication 4500 finished at Tue Oct 25 09:03:56 2022
## Replication 5000 finished at Tue Oct 25 09:03:57 2022
#A list with elements state, specifying the starting state(s), time, the starting time(s), and tstate, a numeric vector of length the number of states, specifying at what times states have been visited, if appropriate. The default of tstate is NULL; more information can be found under Details.
#The elements state and time may either be scalars or vectors, in which case different sampled paths may start from different states or at different times. By default, all sampled paths start from state 1 at time 0.
set.seed(1234)
pmatrix_cox_a_0_s2<-
mstate::mssample(msf0$Haz, trans = trans_matrix, clock = "reset", M = n_iter/2, tvec = seq(0,max(c(msf0$Haz$time,msf1$Haz$time),na.rm=T),by=max(c(msf0$Haz$time,msf1$Haz$time),na.rm=T)/500),do.trace=500,
history=list(state = 2, time = 0, tstate = NULL))
## Replication 500 finished at Tue Oct 25 09:03:59 2022
## Replication 1000 finished at Tue Oct 25 09:04:00 2022
## Replication 1500 finished at Tue Oct 25 09:04:01 2022
## Replication 2000 finished at Tue Oct 25 09:04:03 2022
## Replication 2500 finished at Tue Oct 25 09:04:04 2022
## Replication 3000 finished at Tue Oct 25 09:04:06 2022
## Replication 3500 finished at Tue Oct 25 09:04:07 2022
## Replication 4000 finished at Tue Oct 25 09:04:09 2022
## Replication 4500 finished at Tue Oct 25 09:04:10 2022
## Replication 5000 finished at Tue Oct 25 09:04:11 2022
set.seed(1234)
pmatrix_cox_b_0_s2<-
mstate::mssample(msf1$Haz, trans = trans_matrix, clock = "reset", M = n_iter/2, tvec = seq(0,max(c(msf0$Haz$time,msf1$Haz$time),na.rm=T),by=max(c(msf0$Haz$time,msf1$Haz$time),na.rm=T)/500),do.trace=500,
history=list(state = 2, time = 0, tstate = NULL))
## Replication 500 finished at Tue Oct 25 09:04:13 2022
## Replication 1000 finished at Tue Oct 25 09:04:14 2022
## Replication 1500 finished at Tue Oct 25 09:04:16 2022
## Replication 2000 finished at Tue Oct 25 09:04:18 2022
## Replication 2500 finished at Tue Oct 25 09:04:19 2022
## Replication 3000 finished at Tue Oct 25 09:04:20 2022
## Replication 3500 finished at Tue Oct 25 09:04:22 2022
## Replication 4000 finished at Tue Oct 25 09:04:24 2022
## Replication 4500 finished at Tue Oct 25 09:04:25 2022
## Replication 5000 finished at Tue Oct 25 09:04:27 2022
#cens=An independent censoring distribution, given as a data frame with time and Haz
set.seed(1234)
pmatrix_cox_a_0_s3<-
mstate::mssample(msf0$Haz, trans = trans_matrix, clock = "reset", M = n_iter/2, tvec = seq(0,max(c(msf0$Haz$time,msf1$Haz$time),na.rm=T),by=max(c(msf0$Haz$time,msf1$Haz$time),na.rm=T)/500),do.trace=500,
history=list(state = 3, time = 0, tstate = NULL))
## Replication 500 finished at Tue Oct 25 09:04:28 2022
## Replication 1000 finished at Tue Oct 25 09:04:29 2022
## Replication 1500 finished at Tue Oct 25 09:04:31 2022
## Replication 2000 finished at Tue Oct 25 09:04:32 2022
## Replication 2500 finished at Tue Oct 25 09:04:33 2022
## Replication 3000 finished at Tue Oct 25 09:04:35 2022
## Replication 3500 finished at Tue Oct 25 09:04:36 2022
## Replication 4000 finished at Tue Oct 25 09:04:38 2022
## Replication 4500 finished at Tue Oct 25 09:04:39 2022
## Replication 5000 finished at Tue Oct 25 09:04:41 2022
set.seed(1234)
pmatrix_cox_b_0_s3<-
mstate::mssample(msf1$Haz, trans = trans_matrix, clock = "reset", M = n_iter/2, tvec = seq(0,max(c(msf0$Haz$time,msf1$Haz$time),na.rm=T),by=max(c(msf0$Haz$time,msf1$Haz$time),na.rm=T)/500),do.trace=500,
history=list(state = 3, time = 0, tstate = NULL))
## Replication 500 finished at Tue Oct 25 09:04:42 2022
## Replication 1000 finished at Tue Oct 25 09:04:43 2022
## Replication 1500 finished at Tue Oct 25 09:04:45 2022
## Replication 2000 finished at Tue Oct 25 09:04:46 2022
## Replication 2500 finished at Tue Oct 25 09:04:48 2022
## Replication 3000 finished at Tue Oct 25 09:04:49 2022
## Replication 3500 finished at Tue Oct 25 09:04:50 2022
## Replication 4000 finished at Tue Oct 25 09:04:52 2022
## Replication 4500 finished at Tue Oct 25 09:04:53 2022
## Replication 5000 finished at Tue Oct 25 09:04:54 2022
#cens=An independent censoring distribution, given as a data frame with time and Haz
set.seed(1234)
pmatrix_cox_a_0_s4<-
mstate::mssample(msf0$Haz, trans = trans_matrix, clock = "reset", M = n_iter/2, tvec = seq(0,max(c(msf0$Haz$time,msf1$Haz$time),na.rm=T),by=max(c(msf0$Haz$time,msf1$Haz$time),na.rm=T)/500),do.trace=500,
history=list(state = 4, time = 0, tstate = NULL))
## Replication 500 finished at Tue Oct 25 09:04:55 2022
## Replication 1000 finished at Tue Oct 25 09:04:56 2022
## Replication 1500 finished at Tue Oct 25 09:04:57 2022
## Replication 2000 finished at Tue Oct 25 09:04:58 2022
## Replication 2500 finished at Tue Oct 25 09:04:59 2022
## Replication 3000 finished at Tue Oct 25 09:05:00 2022
## Replication 3500 finished at Tue Oct 25 09:05:01 2022
## Replication 4000 finished at Tue Oct 25 09:05:02 2022
## Replication 4500 finished at Tue Oct 25 09:05:03 2022
## Replication 5000 finished at Tue Oct 25 09:05:04 2022
set.seed(1234)
pmatrix_cox_b_0_s4<-
mstate::mssample(msf1$Haz, trans = trans_matrix, clock = "reset", M = n_iter/2, tvec = seq(0,max(c(msf0$Haz$time,msf1$Haz$time),na.rm=T),by=max(c(msf0$Haz$time,msf1$Haz$time),na.rm=T)/500),do.trace=500,
history=list(state = 4, time = 0, tstate = NULL))
## Replication 500 finished at Tue Oct 25 09:05:04 2022
## Replication 1000 finished at Tue Oct 25 09:05:05 2022
## Replication 1500 finished at Tue Oct 25 09:05:06 2022
## Replication 2000 finished at Tue Oct 25 09:05:07 2022
## Replication 2500 finished at Tue Oct 25 09:05:08 2022
## Replication 3000 finished at Tue Oct 25 09:05:09 2022
## Replication 3500 finished at Tue Oct 25 09:05:10 2022
## Replication 4000 finished at Tue Oct 25 09:05:11 2022
## Replication 4500 finished at Tue Oct 25 09:05:12 2022
## Replication 5000 finished at Tue Oct 25 09:05:13 2022
#cens=An independent censoring distribution, given as a data frame with time and Haz
invisible("See cens")
#cens = data.frame(time=c(0,3000),surv=c(1,0))) #Adm censoring at t=3000
#cens=An independent censoring distribution, given as a data frame with time and Haz
#10 states
#, fig.height=13, fig.width=10, fig.cap="Figure 12a. Aalen-Johansen estimator with confidence intervals", fig.align="center"
#n_iter=1000
n_iter<-10000
time_before_probtrans_ci95_9s<-Sys.time()
invisible(c("mssample"))
# piece-wise constant estimates
set.seed(1234)
pmatrix_cox_a_0_9s<-
mstate::mssample(msf0_9s$Haz, trans = trans_matrix2, clock = "reset", M = n_iter/2, tvec = seq(0,1826,length.out=180), do.trace=500)
## Replication 500 finished at Tue Oct 25 09:05:16 2022
## Replication 1000 finished at Tue Oct 25 09:05:20 2022
## Replication 1500 finished at Tue Oct 25 09:05:23 2022
## Replication 2000 finished at Tue Oct 25 09:05:27 2022
## Replication 2500 finished at Tue Oct 25 09:05:30 2022
## Replication 3000 finished at Tue Oct 25 09:05:34 2022
## Replication 3500 finished at Tue Oct 25 09:05:37 2022
## Replication 4000 finished at Tue Oct 25 09:05:40 2022
## Replication 4500 finished at Tue Oct 25 09:05:44 2022
## Replication 5000 finished at Tue Oct 25 09:05:47 2022
set.seed(1234)
pmatrix_cox_b_0_9s<-
mstate::mssample(msf1_9s$Haz, trans = trans_matrix2, clock = "reset", M = n_iter/2, tvec = seq(0,1826,length.out=180), do.trace=500)
## Replication 500 finished at Tue Oct 25 09:05:51 2022
## Replication 1000 finished at Tue Oct 25 09:05:54 2022
## Replication 1500 finished at Tue Oct 25 09:05:58 2022
## Replication 2000 finished at Tue Oct 25 09:06:02 2022
## Replication 2500 finished at Tue Oct 25 09:06:05 2022
## Replication 3000 finished at Tue Oct 25 09:06:09 2022
## Replication 3500 finished at Tue Oct 25 09:06:13 2022
## Replication 4000 finished at Tue Oct 25 09:06:16 2022
## Replication 4500 finished at Tue Oct 25 09:06:20 2022
## Replication 5000 finished at Tue Oct 25 09:06:24 2022
set.seed(1234)
pmatrix_cox_a_0_s2_9s<-
mstate::mssample(msf0_9s$Haz, trans = trans_matrix2, clock = "reset", M = n_iter/2, tvec = seq(0,1826,length.out=180), do.trace=500,
history=list(state = 2, time = 0, tstate = NULL))
## Replication 500 finished at Tue Oct 25 09:06:25 2022
## Replication 1000 finished at Tue Oct 25 09:06:26 2022
## Replication 1500 finished at Tue Oct 25 09:06:28 2022
## Replication 2000 finished at Tue Oct 25 09:06:29 2022
## Replication 2500 finished at Tue Oct 25 09:06:30 2022
## Replication 3000 finished at Tue Oct 25 09:06:32 2022
## Replication 3500 finished at Tue Oct 25 09:06:33 2022
## Replication 4000 finished at Tue Oct 25 09:06:35 2022
## Replication 4500 finished at Tue Oct 25 09:06:36 2022
## Replication 5000 finished at Tue Oct 25 09:06:38 2022
set.seed(1234)
pmatrix_cox_b_0_s2_9s<-
mstate::mssample(msf1_9s$Haz, trans = trans_matrix2, clock = "reset", M = n_iter/2, tvec = seq(0,1826,length.out=180), do.trace=500,
history=list(state = 2, time = 0, tstate = NULL))
## Replication 500 finished at Tue Oct 25 09:06:40 2022
## Replication 1000 finished at Tue Oct 25 09:06:41 2022
## Replication 1500 finished at Tue Oct 25 09:06:43 2022
## Replication 2000 finished at Tue Oct 25 09:06:44 2022
## Replication 2500 finished at Tue Oct 25 09:06:46 2022
## Replication 3000 finished at Tue Oct 25 09:06:48 2022
## Replication 3500 finished at Tue Oct 25 09:06:49 2022
## Replication 4000 finished at Tue Oct 25 09:06:51 2022
## Replication 4500 finished at Tue Oct 25 09:06:52 2022
## Replication 5000 finished at Tue Oct 25 09:06:54 2022
#cens=An independent censoring distribution, given as a data frame with time and Haz
set.seed(1234)
pmatrix_cox_a_0_s3_9s<-
mstate::mssample(msf0_9s$Haz, trans = trans_matrix2, clock = "reset", M = n_iter/2, tvec = seq(0,1826,length.out=180), do.trace=500,
history=list(state = 3, time = 0, tstate = NULL))
## Replication 500 finished at Tue Oct 25 09:06:55 2022
## Replication 1000 finished at Tue Oct 25 09:06:56 2022
## Replication 1500 finished at Tue Oct 25 09:06:58 2022
## Replication 2000 finished at Tue Oct 25 09:06:59 2022
## Replication 2500 finished at Tue Oct 25 09:07:00 2022
## Replication 3000 finished at Tue Oct 25 09:07:02 2022
## Replication 3500 finished at Tue Oct 25 09:07:03 2022
## Replication 4000 finished at Tue Oct 25 09:07:04 2022
## Replication 4500 finished at Tue Oct 25 09:07:06 2022
## Replication 5000 finished at Tue Oct 25 09:07:07 2022
set.seed(1234)
pmatrix_cox_b_0_s3_9s<-
mstate::mssample(msf1_9s$Haz, trans = trans_matrix2, clock = "reset", M = n_iter/2, tvec = seq(0,1826,length.out=180),do.trace=500,
history=list(state = 3, time = 0, tstate = NULL))
## Replication 500 finished at Tue Oct 25 09:07:08 2022
## Replication 1000 finished at Tue Oct 25 09:07:10 2022
## Replication 1500 finished at Tue Oct 25 09:07:11 2022
## Replication 2000 finished at Tue Oct 25 09:07:13 2022
## Replication 2500 finished at Tue Oct 25 09:07:14 2022
## Replication 3000 finished at Tue Oct 25 09:07:16 2022
## Replication 3500 finished at Tue Oct 25 09:07:18 2022
## Replication 4000 finished at Tue Oct 25 09:07:19 2022
## Replication 4500 finished at Tue Oct 25 09:07:20 2022
## Replication 5000 finished at Tue Oct 25 09:07:22 2022
#cens=An independent censoring distribution, given as a data frame with time and Haz
set.seed(1234)
pmatrix_cox_a_0_s4_9s<-
mstate::mssample(msf0_9s$Haz, trans = trans_matrix2, clock = "reset", M = n_iter/2, tvec = seq(0,1826,length.out=180), do.trace=500,
history=list(state = 4, time = 0, tstate = NULL))
## Replication 500 finished at Tue Oct 25 09:07:23 2022
## Replication 1000 finished at Tue Oct 25 09:07:25 2022
## Replication 1500 finished at Tue Oct 25 09:07:26 2022
## Replication 2000 finished at Tue Oct 25 09:07:27 2022
## Replication 2500 finished at Tue Oct 25 09:07:28 2022
## Replication 3000 finished at Tue Oct 25 09:07:30 2022
## Replication 3500 finished at Tue Oct 25 09:07:31 2022
## Replication 4000 finished at Tue Oct 25 09:07:32 2022
## Replication 4500 finished at Tue Oct 25 09:07:33 2022
## Replication 5000 finished at Tue Oct 25 09:07:35 2022
set.seed(1234)
pmatrix_cox_b_0_s4_9s<-
mstate::mssample(msf1_9s$Haz, trans = trans_matrix2, clock = "reset", M = n_iter/2, tvec = seq(0,1826,length.out=180), do.trace=500,
history=list(state = 4, time = 0, tstate = NULL))
## Replication 500 finished at Tue Oct 25 09:07:36 2022
## Replication 1000 finished at Tue Oct 25 09:07:38 2022
## Replication 1500 finished at Tue Oct 25 09:07:39 2022
## Replication 2000 finished at Tue Oct 25 09:07:41 2022
## Replication 2500 finished at Tue Oct 25 09:07:42 2022
## Replication 3000 finished at Tue Oct 25 09:07:43 2022
## Replication 3500 finished at Tue Oct 25 09:07:45 2022
## Replication 4000 finished at Tue Oct 25 09:07:46 2022
## Replication 4500 finished at Tue Oct 25 09:07:48 2022
## Replication 5000 finished at Tue Oct 25 09:07:49 2022
#cens=An independent censoring distribution, given as a data frame with time and Haz
set.seed(1234)
pmatrix_cox_a_0_s5_9s<-
mstate::mssample(msf0_9s$Haz, trans = trans_matrix2, clock = "reset", M = n_iter/2, tvec = seq(0,1826,length.out=180), do.trace=500,
history=list(state = 5, time = 0, tstate = NULL))
## Replication 500 finished at Tue Oct 25 09:07:51 2022
## Replication 1000 finished at Tue Oct 25 09:07:52 2022
## Replication 1500 finished at Tue Oct 25 09:07:53 2022
## Replication 2000 finished at Tue Oct 25 09:07:54 2022
## Replication 2500 finished at Tue Oct 25 09:07:56 2022
## Replication 3000 finished at Tue Oct 25 09:07:57 2022
## Replication 3500 finished at Tue Oct 25 09:07:58 2022
## Replication 4000 finished at Tue Oct 25 09:08:00 2022
## Replication 4500 finished at Tue Oct 25 09:08:01 2022
## Replication 5000 finished at Tue Oct 25 09:08:02 2022
set.seed(1234)
pmatrix_cox_b_0_s5_9s<-
mstate::mssample(msf1_9s$Haz, trans = trans_matrix2, clock = "reset", M = n_iter/2, tvec = seq(0,1826,length.out=180), do.trace=500,
history=list(state = 5, time = 0, tstate = NULL))
## Replication 500 finished at Tue Oct 25 09:08:03 2022
## Replication 1000 finished at Tue Oct 25 09:08:05 2022
## Replication 1500 finished at Tue Oct 25 09:08:06 2022
## Replication 2000 finished at Tue Oct 25 09:08:08 2022
## Replication 2500 finished at Tue Oct 25 09:08:09 2022
## Replication 3000 finished at Tue Oct 25 09:08:10 2022
## Replication 3500 finished at Tue Oct 25 09:08:12 2022
## Replication 4000 finished at Tue Oct 25 09:08:13 2022
## Replication 4500 finished at Tue Oct 25 09:08:14 2022
## Replication 5000 finished at Tue Oct 25 09:08:16 2022
#cens=An independent censoring distribution, given as a data frame with time and Haz
set.seed(1234)
pmatrix_cox_a_0_s6_9s<-
mstate::mssample(msf0_9s$Haz, trans = trans_matrix2, clock = "reset", M = n_iter/2, tvec = seq(0,1826,length.out=180), do.trace=500,
history=list(state = 6, time = 0, tstate = NULL))
## Replication 500 finished at Tue Oct 25 09:08:17 2022
## Replication 1000 finished at Tue Oct 25 09:08:19 2022
## Replication 1500 finished at Tue Oct 25 09:08:20 2022
## Replication 2000 finished at Tue Oct 25 09:08:21 2022
## Replication 2500 finished at Tue Oct 25 09:08:22 2022
## Replication 3000 finished at Tue Oct 25 09:08:24 2022
## Replication 3500 finished at Tue Oct 25 09:08:25 2022
## Replication 4000 finished at Tue Oct 25 09:08:26 2022
## Replication 4500 finished at Tue Oct 25 09:08:27 2022
## Replication 5000 finished at Tue Oct 25 09:08:29 2022
set.seed(1234)
pmatrix_cox_b_0_s6_9s<-
mstate::mssample(msf1_9s$Haz, trans = trans_matrix2, clock = "reset", M = n_iter/2, tvec = seq(0,1826,length.out=180), do.trace=500,
history=list(state = 6, time = 0, tstate = NULL))
## Replication 500 finished at Tue Oct 25 09:08:30 2022
## Replication 1000 finished at Tue Oct 25 09:08:31 2022
## Replication 1500 finished at Tue Oct 25 09:08:33 2022
## Replication 2000 finished at Tue Oct 25 09:08:34 2022
## Replication 2500 finished at Tue Oct 25 09:08:35 2022
## Replication 3000 finished at Tue Oct 25 09:08:36 2022
## Replication 3500 finished at Tue Oct 25 09:08:37 2022
## Replication 4000 finished at Tue Oct 25 09:08:39 2022
## Replication 4500 finished at Tue Oct 25 09:08:40 2022
## Replication 5000 finished at Tue Oct 25 09:08:41 2022
#cens=An independent censoring distribution, given as a data frame with time and Haz
set.seed(1234)
pmatrix_cox_a_0_s7_9s<-
mstate::mssample(msf0_9s$Haz, trans = trans_matrix2, clock = "reset", M = n_iter/2, tvec = seq(0,1826,length.out=180), do.trace=500,
history=list(state = 7, time = 0, tstate = NULL))
## Replication 500 finished at Tue Oct 25 09:08:42 2022
## Replication 1000 finished at Tue Oct 25 09:08:43 2022
## Replication 1500 finished at Tue Oct 25 09:08:44 2022
## Replication 2000 finished at Tue Oct 25 09:08:45 2022
## Replication 2500 finished at Tue Oct 25 09:08:46 2022
## Replication 3000 finished at Tue Oct 25 09:08:47 2022
## Replication 3500 finished at Tue Oct 25 09:08:48 2022
## Replication 4000 finished at Tue Oct 25 09:08:49 2022
## Replication 4500 finished at Tue Oct 25 09:08:51 2022
## Replication 5000 finished at Tue Oct 25 09:08:52 2022
set.seed(1234)
pmatrix_cox_b_0_s7_9s<-
mstate::mssample(msf1_9s$Haz, trans = trans_matrix2, clock = "reset", M = n_iter/2, tvec = seq(0,1826,length.out=180), do.trace=500,
history=list(state = 7, time = 0, tstate = NULL))
## Replication 500 finished at Tue Oct 25 09:08:53 2022
## Replication 1000 finished at Tue Oct 25 09:08:54 2022
## Replication 1500 finished at Tue Oct 25 09:08:55 2022
## Replication 2000 finished at Tue Oct 25 09:08:56 2022
## Replication 2500 finished at Tue Oct 25 09:08:57 2022
## Replication 3000 finished at Tue Oct 25 09:08:58 2022
## Replication 3500 finished at Tue Oct 25 09:08:59 2022
## Replication 4000 finished at Tue Oct 25 09:09:00 2022
## Replication 4500 finished at Tue Oct 25 09:09:01 2022
## Replication 5000 finished at Tue Oct 25 09:09:02 2022
time_after_probtrans_ci95_9s<-Sys.time()
#cens=An independent censoring distribution, given as a data frame with time and Haz
#10 states
#pmatrix_t_a_df_final pmatrix_t_b_df_final pmatrix_4s_t_a_df_final pmatrix_4s_t_b_df_final
states_trans_lab<-paste0(1:5,") ",states_trans)
attr(states_trans_lab,"names")<-1:5
ab_pmatrix<-
pmatrix_cox_a_0 %>%
dplyr::left_join(pmatrix_cox_b_0, by="time", suffix=c("",".w_covs.res.s1")) %>%
dplyr::left_join(pmatrix_cox_a_0_s2, by="time", suffix=c("",".w_covs.out.s2")) %>%
dplyr::left_join(pmatrix_cox_b_0_s2, by="time", suffix=c("",".w_covs.res.s2")) %>%
dplyr::left_join(pmatrix_cox_a_0_s3, by="time", suffix=c("",".w_covs.out.s3")) %>%
dplyr::left_join(pmatrix_cox_b_0_s3, by="time", suffix=c("",".w_covs.res.s3")) %>%
dplyr::left_join(pmatrix_cox_a_0_s4, by="time", suffix=c("",".w_covs.out.s4")) %>%
dplyr::left_join(pmatrix_cox_b_0_s4, by="time", suffix=c("",".w_covs.res.s4")) %>%
dplyr::rename("pstate1.w_covs.out.s1"="pstate1",
"pstate2.w_covs.out.s1"="pstate2",
"pstate3.w_covs.out.s1"="pstate3",
"pstate4.w_covs.out.s1"="pstate4",
"pstate5.w_covs.out.s1"="pstate5") %>%
#pstate1–pstate3 are close to the first rows of the matrices returned by pmatrix.fs
reshape2::melt(id.vars="time") %>% #janitor::tabyl(variable)
dplyr::mutate(start=stri_sub(variable,-1,-1)) %>%
dplyr::mutate(state_to=stringi::stri_match_first_regex(variable, "(.*?)\\.")[,2]) %>%
dplyr::mutate(state_to=gsub("pstate", "", state_to), state_to=as.numeric(state_to)) %>%
dplyr::mutate(setting= dplyr::case_when(grepl(".out",variable)~"Ambulatory",
grepl(".res",variable)~"Residential",
T~NA_character_))
fig_ab_pmatrix<-
#janitor::tabyl(start)
ggplot(ab_pmatrix, aes(time, value, color= factor(state_to), linetype =setting))+
geom_step(size=1, alpha=.65) +
scale_y_continuous(labels = scales::percent_format(accuracy = 2))+
facet_wrap(start~., ncol=1, scales="free_y", labeller = as_labeller(states_trans_lab)) +
#facet_wrap(state~., ncol=1, scales="free_y") + #type_of_program
scale_color_manual(name = "Starting from\nState", values=c("#54478C","#2C699A","#048BA8","#0DB39E",
"#16DB93","#83E377","#EFEA5A","#F1C453","#F29E4C"), labels= as.character(c(1:9))) + # "#A65100" #"Cox",
scale_linetype_manual(name= "Type of\nprogram",values=c(1,4), labels=c("Ambulatory","Residential")) +
scale_x_continuous(breaks=seq(0,max(c(msf0$Haz$time,msf1$Haz$time),na.rm=T),by=max(c(msf0$Haz$time,msf1$Haz$time),na.rm=T)/11),
label=round(seq(0,max(c(msf0$Haz$time,msf1$Haz$time),na.rm=T),by=max(c(msf0$Haz$time,msf1$Haz$time),na.rm=T)/11)/365.25,2))+
xlab("Years") +
ylab("") +
theme_minimal()
fig_ab_pmatrix
Figure 3a. Estimate of State Occupancies at Baseline, Five-states model (simulated approach)
if(no_mostrar==1){
jpeg(paste0(jpg_path,"_mult_state_ags/pmatrix_probtrans_semimark_apr22.jpg"), height=20, width= 10, res= 320, units = "in")
fig_ab_pmatrix
dev.off()
}
#pmatrix_t_a_df_final pmatrix_t_b_df_final pmatrix_4s_t_a_df_final pmatrix_4s_t_b_df_final
states_trans_lab_9s<-paste0(1:9,") ",states_trans2)
attr(states_trans_lab_9s,"names")<-1:9
#seq(0,1826,length.out=180)
ab_pmatrix_9s<-
pmatrix_cox_a_0_9s %>%
dplyr::left_join(pmatrix_cox_b_0_9s, by="time", suffix=c("",".w_covs.res.s1")) %>%
dplyr::left_join(pmatrix_cox_a_0_s2_9s, by="time", suffix=c("",".w_covs.out.s2")) %>%
dplyr::left_join(pmatrix_cox_b_0_s2_9s, by="time", suffix=c("",".w_covs.res.s2")) %>%
dplyr::left_join(pmatrix_cox_a_0_s3_9s, by="time", suffix=c("",".w_covs.out.s3")) %>%
dplyr::left_join(pmatrix_cox_b_0_s3_9s, by="time", suffix=c("",".w_covs.res.s3")) %>%
dplyr::left_join(pmatrix_cox_a_0_s4_9s, by="time", suffix=c("",".w_covs.out.s4")) %>%
dplyr::left_join(pmatrix_cox_b_0_s4_9s, by="time", suffix=c("",".w_covs.res.s4")) %>%
dplyr::left_join(pmatrix_cox_a_0_s5_9s, by="time", suffix=c("",".w_covs.out.s5")) %>%
dplyr::left_join(pmatrix_cox_b_0_s5_9s, by="time", suffix=c("",".w_covs.res.s5")) %>%
dplyr::left_join(pmatrix_cox_a_0_s6_9s, by="time", suffix=c("",".w_covs.out.s6")) %>%
dplyr::left_join(pmatrix_cox_b_0_s6_9s, by="time", suffix=c("",".w_covs.res.s6")) %>%
dplyr::left_join(pmatrix_cox_a_0_s7_9s, by="time", suffix=c("",".w_covs.out.s7")) %>%
dplyr::left_join(pmatrix_cox_b_0_s7_9s, by="time", suffix=c("",".w_covs.res.s7")) %>%
dplyr::rename("pstate1.w_covs.out.s1"="pstate1",
"pstate2.w_covs.out.s1"="pstate2",
"pstate3.w_covs.out.s1"="pstate3",
"pstate4.w_covs.out.s1"="pstate4",
"pstate5.w_covs.out.s1"="pstate5",
"pstate6.w_covs.out.s1"="pstate6",
"pstate7.w_covs.out.s1"="pstate7",
"pstate8.w_covs.out.s1"="pstate8",
"pstate9.w_covs.out.s1"="pstate9") %>%
#pstate1–pstate3 are close to the first rows of the matrices returned by pmatrix.fs
reshape2::melt(id.vars="time") %>% #janitor::tabyl(variable)
dplyr::mutate(start=stri_sub(variable,-1,-1)) %>%
dplyr::mutate(state_to=stringi::stri_match_first_regex(variable, "(.*?)\\.")[,2]) %>%
dplyr::mutate(state_to=gsub("pstate", "", state_to), state_to=as.numeric(state_to)) %>%
dplyr::mutate(setting= dplyr::case_when(grepl(".out",variable)~"Ambulatory",
grepl(".res",variable)~"Residential",
T~NA_character_))
fig_ab_pmatrix_9s<-
#janitor::tabyl(start)
ggplot(ab_pmatrix_9s, aes(time, value, color= factor(state_to), linetype =setting))+
geom_step(size=1, alpha=.65) +
scale_y_continuous(labels = scales::percent_format(accuracy = 2))+
facet_wrap(start~., ncol=1, scales="free_y", labeller = as_labeller(states_trans_lab_9s)) +
#facet_wrap(state~., ncol=1, scales="free_y") + #type_of_program
scale_color_manual(name = "Starting from\nState", values=c("#54478C","#2C699A","#048BA8","#0DB39E",
"#16DB93","#83E377","#EFEA5A","#F1C453","#F29E4C"), labels= as.character(c(1:9))) + # "#A65100" #"Cox",
scale_linetype_manual(name= "Type of\nprogram",values=c(1,4), labels=c("Ambulatory","Residential")) +
scale_x_continuous(breaks=seq(0,1826,length.out=11),
label=round(seq(0,1826,length.out=11)/365.25,2))+
xlab("Years") +
ylab("") +
theme_minimal()
fig_ab_pmatrix_9s
Figure 3b. Estimate of State Occupancies at Baseline, Nine-states model (simulated approach)
if(no_mostrar==1){
jpeg(paste0(jpg_path,"_mult_state_ags/pmatrix_probtrans_semimark_apr22_9s.jpg"), height=20, width= 10, res= 320, units = "in")
fig_ab_pmatrix_9s
dev.off()
}
The observation in a given state at a given time and estimate the state occupation. The idea is to select individuals that are under probabilities within this subset. Landmark approach uses less data than AJ.
#devtools::install_github("hputter/mstate")
invisible(c("For semi-Markov models, mstate provides the function mssample to produce both simulated trajectories and transition probability matrices from semi-Markov models, given the estimated piecewise-constant cumulative hazards (Fiocco et al. 2008), produced by msfit or msfit.flexsurvreg, though this is generally less efficient than pmatrix.simfs. In this example, 1000 samples from mssample give estimates of transition probabilities that are accurate to within around 0.02. However with pmatrix.simfs, greater precision is achieved by simulating 100 times as many trajectories in a shorter time"))
time_before_LMAJ<-Sys.time()
trans_df<-cbind.data.frame(transition_label,trans=1:max(trans_matrix,na.rm=T))
lmaj_df<-data.frame()
for (transo in 1:4){
if(tryCatch({LMAJ(pr0,from=transo,s=1,method="aalen")}, error=function(e) {data.frame()}) %>% data.frame() %>% nrow()>0){
lmaj_df<- rbind.data.frame(lmaj_df,
cbind(pr="out",
LMAJ(pr0, #An "msdata" object, as for instance prepared by link{msprep}
from=transo, ##Either a single state or a set of states in the state space 1,...,S
s=1, #The prediction time point s from which transition probabilities are to be obtained
method ="aalen" #The method for calculating variances, as in probtrans
),transo=transo))
} else if (tryCatch({LMAJ(pr1,from=transo,s=1,method="aalen")}, error=function(e) {data.frame()}) %>% data.frame() %>% nrow()>0){
lmaj_df<- rbind.data.frame(lmaj_df,
cbind(pr="res",
LMAJ(pr1, #An "msdata" object, as for instance prepared by link{msprep}
from=transo, ##Either a single state or a set of states in the state space 1,...,S
s=1, #The prediction time point s from which transition probabilities are to be obtained
method ="aalen" #The method for calculating variances, as in probtrans
),transo=transo))
} else {rep(0,21)
}
}
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(sf0$trans): ningun argumento finito para max; retornando -Inf
## Warning in max(event[who2]): ningun argumento finito para max; retornando -Inf
## Warning in max(event[who2]): ningun argumento finito para max; retornando -Inf
## Warning in max(event[who2]): ningun argumento finito para max; retornando -Inf
## Warning in max(event[who2]): ningun argumento finito para max; retornando -Inf
## Warning in max(event[who2]): ningun argumento finito para max; retornando -Inf
pr0_sel<-pr0[,c("id", "from", "to", "trans", "Tstart", "Tstop", "time", "status", "tipo_de_plan_res_1")]
attr(pr0_sel,"trans")<-trans_matrix
pr1_sel<-pr1[,c("id", "from", "to", "trans", "Tstart", "Tstop", "time", "status", "tipo_de_plan_res_1")]
attr(pr1_sel,"trans")<-trans_matrix
lmaj_out_1<-
LMAJ(pr0_sel, #An "msdata" object, as for instance prepared by link{msprep}
from=1, ##Either a single state or a set of states in the state space 1,...,S
s=90, #The prediction time point s from which transition probabilities are to be obtained
method ="aalen" #The method for calculating variances, as in probtrans
)
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
lmaj_out_2<-
LMAJ(pr0_sel, #An "msdata" object, as for instance prepared by link{msprep}
from=2, ##Either a single state or a set of states in the state space 1,...,S
s=90, #The prediction time point s from which transition probabilities are to be obtained
method ="aalen" #The method for calculating variances, as in probtrans
)
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
lmaj_out_3<-
LMAJ(pr0_sel, #An "msdata" object, as for instance prepared by link{msprep}
from=3, ##Either a single state or a set of states in the state space 1,...,S
s=90, #The prediction time point s from which transition probabilities are to be obtained
method ="aalen" #The method for calculating variances, as in probtrans
)
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
lmaj_out_4<-
LMAJ(pr0_sel, #An "msdata" object, as for instance prepared by link{msprep}
from=4, ##Either a single state or a set of states in the state space 1,...,S
s=90, #The prediction time point s from which transition probabilities are to be obtained
method ="aalen" #The method for calculating variances, as in probtrans
)
## Warning in max(event[who2]): ningun argumento finito para max; retornando -Inf
## Error in coxph(Surv(Tstart, Tstop, status) ~ strata(trans), data = msdatasfrom): No (non-missing) observations
lmaj_res_1<-
LMAJ(pr1_sel, #An "msdata" object, as for instance prepared by link{msprep}
from=1, ##Either a single state or a set of states in the state space 1,...,S
s=90, #The prediction time point s from which transition probabilities are to be obtained
method ="aalen" #The method for calculating variances, as in probtrans
)
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
lmaj_res_2<-
LMAJ(pr1_sel, #An "msdata" object, as for instance prepared by link{msprep}
from=2, ##Either a single state or a set of states in the state space 1,...,S
s=90, #The prediction time point s from which transition probabilities are to be obtained
method ="aalen" #The method for calculating variances, as in probtrans
)
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
lmaj_res_3<-
LMAJ(pr1_sel, #An "msdata" object, as for instance prepared by link{msprep}
from=3, ##Either a single state or a set of states in the state space 1,...,S
s=90, #The prediction time point s from which transition probabilities are to be obtained
method ="aalen" #The method for calculating variances, as in probtrans
)
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningun argumento finito para max; retornando -Inf
lmaj_res_4<-
LMAJ(pr1_sel, #An "msdata" object, as for instance prepared by link{msprep}
from=4, ##Either a single state or a set of states in the state space 1,...,S
s=90, #The prediction time point s from which transition probabilities are to be obtained
method ="aalen" #The method for calculating variances, as in probtrans
)
## Warning in max(event[who2]): ningun argumento finito para max; retornando -Inf
## Error in coxph(Surv(Tstart, Tstop, status) ~ strata(trans), data = msdatasfrom): No (non-missing) observations
#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_
#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_
#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_
lmaj_out_1_365<-
LMAJ(pr0_sel, #An "msdata" object, as for instance prepared by link{msprep}
from=1, ##Either a single state or a set of states in the state space 1,...,S
s=365, #The prediction time point s from which transition probabilities are to be obtained
method ="aalen" #The method for calculating variances, as in probtrans
)
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
lmaj_out_2_365<-
LMAJ(pr0_sel, #An "msdata" object, as for instance prepared by link{msprep}
from=2, ##Either a single state or a set of states in the state space 1,...,S
s=365, #The prediction time point s from which transition probabilities are to be obtained
method ="aalen" #The method for calculating variances, as in probtrans
)
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
lmaj_out_3_365<-
LMAJ(pr0_sel, #An "msdata" object, as for instance prepared by link{msprep}
from=3, ##Either a single state or a set of states in the state space 1,...,S
s=365, #The prediction time point s from which transition probabilities are to be obtained
method ="aalen" #The method for calculating variances, as in probtrans
)
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
lmaj_out_4_365<-
LMAJ(pr0_sel, #An "msdata" object, as for instance prepared by link{msprep}
from=4, ##Either a single state or a set of states in the state space 1,...,S
s=365, #The prediction time point s from which transition probabilities are to be obtained
method ="aalen" #The method for calculating variances, as in probtrans
)
## Error in data.frame(time = sf0$time, Haz = -log(sf0$surv), norisk = norisk, : arguments imply differing number of rows: 1, 0
lmaj_res_1_365<-
LMAJ(pr1_sel, #An "msdata" object, as for instance prepared by link{msprep}
from=1, ##Either a single state or a set of states in the state space 1,...,S
s=365, #The prediction time point s from which transition probabilities are to be obtained
method ="aalen" #The method for calculating variances, as in probtrans
)
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
lmaj_res_2_365<-
LMAJ(pr1_sel, #An "msdata" object, as for instance prepared by link{msprep}
from=2, ##Either a single state or a set of states in the state space 1,...,S
s=365, #The prediction time point s from which transition probabilities are to be obtained
method ="aalen" #The method for calculating variances, as in probtrans
)
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
lmaj_res_3_365<-
LMAJ(pr1_sel, #An "msdata" object, as for instance prepared by link{msprep}
from=3, ##Either a single state or a set of states in the state space 1,...,S
s=365, #The prediction time point s from which transition probabilities are to be obtained
method ="aalen" #The method for calculating variances, as in probtrans
)
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
lmaj_res_4_365<-
LMAJ(pr1_sel, #An "msdata" object, as for instance prepared by link{msprep}
from=4, ##Either a single state or a set of states in the state space 1,...,S
s=365, #The prediction time point s from which transition probabilities are to be obtained
method ="aalen" #The method for calculating variances, as in probtrans
)
## Error in data.frame(time = sf0$time, Haz = -log(sf0$surv), norisk = norisk, : arguments imply differing number of rows: 2, 0
#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_
#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_
#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_
lmaj_out_1_365<-
LMAJ(pr0_sel, #An "msdata" object, as for instance prepared by link{msprep}
from=1, ##Either a single state or a set of states in the state space 1,...,S
s=365, #The prediction time point s from which transition probabilities are to be obtained
method ="aalen" #The method for calculating variances, as in probtrans
)
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
lmaj_out_2_365<-
LMAJ(pr0_sel, #An "msdata" object, as for instance prepared by link{msprep}
from=2, ##Either a single state or a set of states in the state space 1,...,S
s=365, #The prediction time point s from which transition probabilities are to be obtained
method ="aalen" #The method for calculating variances, as in probtrans
)
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
lmaj_out_3_365<-
LMAJ(pr0_sel, #An "msdata" object, as for instance prepared by link{msprep}
from=3, ##Either a single state or a set of states in the state space 1,...,S
s=365, #The prediction time point s from which transition probabilities are to be obtained
method ="aalen" #The method for calculating variances, as in probtrans
)
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
lmaj_out_4_365<-
LMAJ(pr0_sel, #An "msdata" object, as for instance prepared by link{msprep}
from=4, ##Either a single state or a set of states in the state space 1,...,S
s=365, #The prediction time point s from which transition probabilities are to be obtained
method ="aalen" #The method for calculating variances, as in probtrans
)
## Error in data.frame(time = sf0$time, Haz = -log(sf0$surv), norisk = norisk, : arguments imply differing number of rows: 1, 0
lmaj_res_1_365<-
LMAJ(pr1_sel, #An "msdata" object, as for instance prepared by link{msprep}
from=1, ##Either a single state or a set of states in the state space 1,...,S
s=365, #The prediction time point s from which transition probabilities are to be obtained
method ="aalen" #The method for calculating variances, as in probtrans
)
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
lmaj_res_2_365<-
LMAJ(pr1_sel, #An "msdata" object, as for instance prepared by link{msprep}
from=2, ##Either a single state or a set of states in the state space 1,...,S
s=365, #The prediction time point s from which transition probabilities are to be obtained
method ="aalen" #The method for calculating variances, as in probtrans
)
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
lmaj_res_3_365<-
LMAJ(pr1_sel, #An "msdata" object, as for instance prepared by link{msprep}
from=3, ##Either a single state or a set of states in the state space 1,...,S
s=365, #The prediction time point s from which transition probabilities are to be obtained
method ="aalen" #The method for calculating variances, as in probtrans
)
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
lmaj_res_4_365<-
LMAJ(pr1_sel, #An "msdata" object, as for instance prepared by link{msprep}
from=4, ##Either a single state or a set of states in the state space 1,...,S
s=365, #The prediction time point s from which transition probabilities are to be obtained
method ="aalen" #The method for calculating variances, as in probtrans
)
## Error in data.frame(time = sf0$time, Haz = -log(sf0$surv), norisk = norisk, : arguments imply differing number of rows: 2, 0
#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_
#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_
#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_
lmaj_out_1_1095<-
LMAJ(pr0_sel, #An "msdata" object, as for instance prepared by link{msprep}
from=1, ##Either a single state or a set of states in the state space 1,...,S
s=365*3, #The prediction time point s from which transition probabilities are to be obtained
method ="aalen" #The method for calculating variances, as in probtrans
)
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
lmaj_out_2_1095<-
LMAJ(pr0_sel, #An "msdata" object, as for instance prepared by link{msprep}
from=2, ##Either a single state or a set of states in the state space 1,...,S
s=365*3, #The prediction time point s from which transition probabilities are to be obtained
method ="aalen" #The method for calculating variances, as in probtrans
)
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
lmaj_out_3_1095<-
LMAJ(pr0_sel, #An "msdata" object, as for instance prepared by link{msprep}
from=3, ##Either a single state or a set of states in the state space 1,...,S
s=365*3, #The prediction time point s from which transition probabilities are to be obtained
method ="aalen" #The method for calculating variances, as in probtrans
)
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
lmaj_out_4_1095<-
LMAJ(pr0_sel, #An "msdata" object, as for instance prepared by link{msprep}
from=4, ##Either a single state or a set of states in the state space 1,...,S
s=365*3, #The prediction time point s from which transition probabilities are to be obtained
method ="aalen" #The method for calculating variances, as in probtrans
)
## Error in data.frame(time = sf0$time, Haz = -log(sf0$surv), norisk = norisk, : arguments imply differing number of rows: 19, 0
lmaj_res_1_1095<-
LMAJ(pr1_sel, #An "msdata" object, as for instance prepared by link{msprep}
from=1, ##Either a single state or a set of states in the state space 1,...,S
s=365*3, #The prediction time point s from which transition probabilities are to be obtained
method ="aalen" #The method for calculating variances, as in probtrans
)
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
lmaj_res_2_1095<-
LMAJ(pr1_sel, #An "msdata" object, as for instance prepared by link{msprep}
from=2, ##Either a single state or a set of states in the state space 1,...,S
s=365*3, #The prediction time point s from which transition probabilities are to be obtained
method ="aalen" #The method for calculating variances, as in probtrans
)
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
lmaj_res_3_1095<-
LMAJ(pr1_sel, #An "msdata" object, as for instance prepared by link{msprep}
from=3, ##Either a single state or a set of states in the state space 1,...,S
s=365*3, #The prediction time point s from which transition probabilities are to be obtained
method ="aalen" #The method for calculating variances, as in probtrans
)
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
lmaj_res_4_1095<-
LMAJ(pr1_sel, #An "msdata" object, as for instance prepared by link{msprep}
from=4, ##Either a single state or a set of states in the state space 1,...,S
s=365*3, #The prediction time point s from which transition probabilities are to be obtained
method ="aalen" #The method for calculating variances, as in probtrans
)
## Error in data.frame(time = sf0$time, Haz = -log(sf0$surv), norisk = norisk, : arguments imply differing number of rows: 33, 0
#if (nrow(mf) ==0) stop("No (non-missing) observations")
time_after_LMAJ<-Sys.time()
#LMAJ(pr1,from=1,s=90,method="aalen")
paste0("Time in process: ");time_after_LMAJ-time_before_LMAJ
## [1] "Time in process: "
## Time difference of 21.16659 secs
pr0_sel_9s<-pr0_9s[,c("id", "from", "to", "trans", "Tstart", "Tstop", "time", "status", "tipo_de_plan_res_1")]
attr(pr0_sel_9s,"trans")<-trans_matrix2
pr1_sel_9s<-pr1_9s[,c("id", "from", "to", "trans", "Tstart", "Tstop", "time", "status", "tipo_de_plan_res_1")]
attr(pr1_sel_9s,"trans")<-trans_matrix2
LMAJ_mods <-list()
lmaj_mods_pars<-expand.grid(s=c(90,365, 1096, 1826), from=1:7, res=c(0,1))
for (j in 1:nrow(lmaj_mods_pars)) {
paste0("Time ",lmaj_mods_pars[j, "s"],"; From: ",lmaj_mods_pars[j, "from"],"; Setting (res==1)= ",lmaj_mods_pars[j, "res"])
LMAJ_mods[[j]]<-
#tryCatch({assign(paste0("lmaj_",ifelse(lmaj_mods_pars[j, "res"]==1,"res","out"),"_",lmaj_mods_pars[j, "s"] ,"_9s"),
try(LMAJ(get(paste0("pr",lmaj_mods_pars[j, "res"],"_sel_9s")), #An "msdata" object, as for instance prepared by link{msprep}
from= lmaj_mods_pars[j, "from"], ##Either a single state or a set of states in the state space 1,...,S
s= lmaj_mods_pars[j, "s"], #The prediction time point s from which transition probabilities are to be obtained
method ="aalen"), #The method for calculating variances, as in probtrans
silent=F)
#)}, error=function(e){},silent=F)
names(LMAJ_mods)[[j]] <- paste0("lmaj_",ifelse(lmaj_mods_pars[j, "res"]==1,"res","out"),"_",lmaj_mods_pars[j, "s"] ,"_",lmaj_mods_pars[j, "from"],"_9s")
}
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in sqrt(diag(varP)): Se han producido NaNs
## Warning in sqrt(diag(varP)): Se han producido NaNs
## Warning in sqrt(diag(varP)): Se han producido NaNs
## Warning in max(sf0$trans): ningun argumento finito para max; retornando -Inf
## Error in rep(allt, K) : argumento 'times' inválido
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(event[who2]): ningun argumento finito para max; retornando -Inf
## Error in coxph(Surv(Tstart, Tstop, status) ~ strata(trans), data = msdatasfrom) :
## No (non-missing) observations
## Warning in max(sf0$trans): ningun argumento finito para max; retornando -Inf
## Error in rep(allt, K) : argumento 'times' inválido
## Error in data.frame(time = sf0$time, Haz = -log(sf0$surv), norisk = norisk, :
## arguments imply differing number of rows: 5, 0
## Error in data.frame(time = sf0$time, Haz = -log(sf0$surv), norisk = norisk, :
## arguments imply differing number of rows: 15, 0
## Error in rowSums(imat[, 1:3]) :
## 'x' must be an array of at least two dimensions
## Error in data.frame(time = sf0$time, Haz = -log(sf0$surv), norisk = norisk, :
## arguments imply differing number of rows: 15, 0
## Error in data.frame(time = sf0$time, Haz = -log(sf0$surv), norisk = norisk, :
## arguments imply differing number of rows: 63, 0
## Error in data.frame(time = sf0$time, Haz = -log(sf0$surv), norisk = norisk, :
## arguments imply differing number of rows: 54, 0
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(sf0$trans): ningun argumento finito para max; retornando -Inf
## Error in rep(allt, K) : argumento 'times' inválido
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(event[who2]): ningun argumento finito para max; retornando -Inf
## Error in coxph(Surv(Tstart, Tstop, status) ~ strata(trans), data = msdatasfrom) :
## No (non-missing) observations
## Error in data.frame(time = sf0$time, Haz = -log(sf0$surv), norisk = norisk, :
## arguments imply differing number of rows: 2, 0
## Error in data.frame(time = sf0$time, Haz = -log(sf0$surv), norisk = norisk, :
## arguments imply differing number of rows: 21, 0
## Error in data.frame(time = sf0$time, Haz = -log(sf0$surv), norisk = norisk, :
## arguments imply differing number of rows: 30, 0
## Error in data.frame(time = sf0$time, Haz = -log(sf0$surv), norisk = norisk, :
## arguments imply differing number of rows: 1, 0
## Error in data.frame(time = sf0$time, Haz = -log(sf0$surv), norisk = norisk, :
## arguments imply differing number of rows: 29, 0
## Error in data.frame(time = sf0$time, Haz = -log(sf0$surv), norisk = norisk, :
## arguments imply differing number of rows: 91, 0
## Error in data.frame(time = sf0$time, Haz = -log(sf0$surv), norisk = norisk, :
## arguments imply differing number of rows: 64, 0
time_after_LMAJ_9s<-Sys.time()
#LMAJ(pr1,from=1,s=90,method="aalen")
paste0("Time in process: ");time_after_LMAJ-time_before_LMAJ
## [1] "Time in process: "
## Time difference of 21.16659 secs
LMAJ2<-function (msdata, s, from, method = c("aalen", "greenwood"))
{
tmat <- attr(msdata, "trans")
if (is.null(tmat))
stop("msdata object should have a \"trans\" attribute")
K <- nrow(tmat)
if (any(is.na(match(from, 1:K))))
stop("from should be subset of 1:K with K number of states")
xss <- xsect(msdata, s)
infrom <- xss$id[xss$state %in% from]
msdatas <- cutLMms(msdata, LM = s)
msdatasfrom <- msdatas[msdatas$id %in% infrom, ]
c0 <- coxph(Surv(Tstart, Tstop, status) ~ strata(trans),
data = msdatasfrom)
msf0 <- msfit2(c0, trans = tmat)
pt0 <- probtrans(msf0, predt = s, method = method)[from]
if (length(from) == 1)
return(pt0[[1]])
else {
xsss <- xss[xss$state %in% from, ]
xsss$state <- factor(xsss$state, levels = from)
tbl <- table(xsss$state)
p <- tbl/sum(tbl)
varp <- (diag(p) - p %*% t(p))/sum(tbl)
res <- tmp1 <- tmp2 <- 0
for (j in 1:length(from)) {
ptj <- pt0[[j]]
res <- res + p[j] * ptj[, 1 + (1:K)]
tmp2 <- tmp2 + p[j] * (1 - p[j]) * (ptj[, K + 1 +
(1:K)])^2
for (k in 1:length(from)) {
ptk <- pt0[[k]]
tmp1 <- tmp1 + varp[j, k] * ptj[, 1 + (1:K)] *
ptk[, 1 + (1:K)]
}
}
ses <- sqrt(tmp1 + tmp2)
pt <- ptj
pt[, 1 + (1:K)] <- res
pt[, K + 1 + (1:K)] <- ses
return(pt)
}
}
msfit2<-function (object, newdata, variance = TRUE, vartype = c("aalen",
"greenwood"), trans)
{
if (!is.null((object$call)$weights) || !is.null(object$weights))
stop("msfit cannot (yet) compute the result for a weighted model")
Terms <- terms(object)
strat <- attr(Terms, "specials")$strata
cluster <- attr(Terms, "specials")$cluster
if (length(cluster))
stop("cluster terms are not supported")
if (!is.null(attr(object$terms, "specials")$tt))
stop("msfit cannot yet process coxph models with a tt term")
resp <- attr(Terms, "variables")[attr(Terms, "response")]
nvar <- length(object$coefficients)
score <- exp(object$linear.predictors)
vartype <- match.arg(vartype)
if (is.na(vartype))
stop("Invalid variance type specified")
has.strata <- !is.null(attr(object$terms, "specials")$strata)
if (is.null(object$y) || is.null(object[["x"]]) ||
!is.null(object$call$weights) || (has.strata && is.null(object$strata)) ||
!is.null(attr(object$terms, "offset"))) {
mf <- model.frame(object)
}
else mf <- NULL
if (is.null(mf))
y <- object[["y"]]
else {
y <- model.response(mf)
y2 <- object[["y"]]
if (!is.null(y2) && any(dim(y2) != dim(y)))
stop("Could not reconstruct the y vector")
}
if (is.null(object[["x"]]))
x <- model.matrix(object, data = mf)
else x <- object[["x"]]
n <- nrow(y)
if (n != object$n[1] || nrow(x) != n)
stop("Failed to reconstruct the original data set")
type <- attr(y, "type")
if (type == "counting")
lasty <- max(y[, 2])
else if (type == "right")
lasty <- max(y[, 1])
else stop("Cannot handle \"", type, "\" type survival data")
if (is.null(mf))
offset <- 0
else {
offset <- model.offset(mf)
if (is.null(offset))
offset <- 0
}
Terms <- object$terms
if (!has.strata)
strata <- rep(0L, n)
else {
stangle <- untangle.specials(Terms, "strata")
strata <- object$strata
if (is.null(strata)) {
if (length(stangle$vars) == 1)
strata <- mf[[stangle$vars]]
else strata <- strata(mf[, stangle$vars], shortlabel = TRUE)
}
}
if (has.strata) {
temp <- attr(Terms, "specials")$strata
factors <- attr(Terms, "factors")[temp, ]
strata.interaction <- any(t(factors) * attr(Terms, "order") >
1)
if (strata.interaction)
stop("Interaction terms with strata not supported")
}
if (vartype == "greenwood") {
if (missing(trans))
stop("argument trans missing; needed for vartype=\"greenwood\"")
labels <- attr(Terms, "term.labels")
if (length(labels) != 1)
stop("Invalid formula for greenwood, ~strata(trans) needed, no covariates allowed")
if (attr(Terms, "term.labels") != "strata(trans)")
stop("Invalid formula for greenwood, ~strata(trans) needed, no covariates allowed")
sf0 <- summary(survfit(object))
norisk <- sf0$n.risk
noevent <- sf0$n.event
if(is.null(sf0$strata)){
sf0$strata<-rep(max(trans, na.rm = T),length(noevent))
}
length(norisk)
length(noevent)
as.numeric(sf0$strata)
length(as.numeric(sf0$strata))
sf0 <- data.frame(time = sf0$time, Haz = -log(sf0$surv),
norisk = norisk, noevent = noevent, trans = as.numeric(sf0$strata))
allt <- sort(unique(c(sf0$time, lasty)))
nt <- length(allt)
K <- nrow(to.trans2(trans))
Haz <- data.frame(time = rep(allt, K), Haz = NA, trans = rep(1:K,
rep(nt, K)))
if (variance) {
tr12 <- data.frame(trans1 = rep(1:K, rep(K, K)),
trans2 = rep(1:K, K))
tr12 <- tr12[tr12$trans1 <= tr12$trans2, ]
varHaz <- data.frame(time = rep(allt, K * (K + 1)/2),
varHaz = 0, trans1 = rep(tr12$trans1, rep(nt,
K * (K + 1)/2)), trans2 = rep(tr12$trans2,
rep(nt, K * (K + 1)/2)))
}
S <- nrow(trans)
for (s in 1:S) {
trs <- trans[s, ]
trs <- trs[!is.na(trs)]
ntrs <- length(trs)
if (ntrs > 0) {
for (i in 1:ntrs) {
trans1 <- trs[i]
sf1 <- sf0[sf0$trans == trans1, ]
Haz$Haz[(trans1 - 1) * nt + match(sf1$time,
allt)] <- sf1$Haz
Haz$Haz[(trans1 - 1) * nt + 1:nt] <- NAfix2(Haz$Haz[(trans1 -
1) * nt + 1:nt], subst = 0)
if (variance) {
varHaz1 <- cumsum((sf1$norisk - sf1$noevent) *
sf1$noevent/sf1$norisk^3)
varHaz11 <- varHaz[varHaz$trans1 == trans1 &
varHaz$trans2 == trans1, ]
varHaz11$varHaz <- NA
varHaz11$varHaz[match(sf1$time, allt)] <- varHaz1
varHaz11$varHaz <- NAfix2(varHaz11$varHaz,
subst = 0)
varHaz[varHaz$trans1 == trans1 & varHaz$trans2 ==
trans1, ] <- varHaz11
if (i < ntrs) {
for (j in ((i + 1):ntrs)) {
trans2 <- trs[j]
sf2 <- sf0[sf0$trans == trans2, ]
jointt <- intersect(sf1$time, sf2$time)
if (length(jointt) > 0) {
varHazij <- rep(NA, length(jointt))
ik <- match(jointt, sf1$time)
jk <- match(jointt, sf2$time)
varHazij <- cumsum(-sf1$noevent[ik] *
sf2$noevent[jk]/sf1$norisk[ik]^3)
varHaz12 <- varHaz[varHaz$trans1 ==
trans1 & varHaz$trans2 == trans2,
]
varHaz12$varHaz <- NA
varHaz12$varHaz[match(jointt, allt)] <- varHazij
varHaz12$varHaz <- NAfix2(varHaz12$varHaz,
subst = 0)
varHaz[varHaz$trans1 == trans1 & varHaz$trans2 ==
trans2, ] <- varHaz12
}
}
}
}
}
}
}
}
else {
labels <- attr(Terms, "term.labels")
if (length(labels) == 1) {
if (labels == "strata(trans)") {
sf0 <- summary(survfit(object))
norisk <- sf0$n.risk
noevent <- sf0$n.event
if(is.null(sf0$strata)){
sf0$strata<-rep(max(trans, na.rm = T),length(noevent))
}
sf0 <- data.frame(time = sf0$time, Haz = -log(sf0$surv),
norisk = norisk, noevent = noevent, var = sf0$std.err^2/(sf0$surv)^2,
trans = as.numeric(sf0$strata))
allt <- sort(unique(c(sf0$time, lasty)))
nt <- length(allt)
K <- max(sf0$trans)
Haz <- data.frame(time = rep(allt, K), Haz = NA,
trans = rep(1:K, rep(nt, K)))
if (variance) {
tr12 <- data.frame(trans1 = rep(1:K, rep(K,
K)), trans2 = rep(1:K, K))
tr12 <- tr12[tr12$trans1 <= tr12$trans2, ]
varHaz <- data.frame(time = rep(allt, K * (K +
1)/2), varHaz = 0, trans1 = rep(tr12$trans1,
rep(nt, K * (K + 1)/2)), trans2 = rep(tr12$trans2,
rep(nt, K * (K + 1)/2)))
}
for (k in 1:K) {
sfk <- sf0[sf0$trans == k, ]
wht <- match(sfk$time, allt)
Hazk <- Haz[Haz$trans == k, ]
Hazk$Haz[wht] <- sfk$Haz
Hazk$Haz <- NAfix2(Hazk$Haz, subst = 0)
Haz[Haz$trans == k, ] <- Hazk
if (variance) {
varHazkk <- varHaz[varHaz$trans1 == k & varHaz$trans2 ==
k, ]
varHazkk$varHaz <- NA
varHazkk$varHaz[wht] <- sfk$var
varHazkk$varHaz <- NAfix2(varHazkk$varHaz,
subst = 0)
varHaz[varHaz$trans1 == k & varHaz$trans2 ==
k, ] <- varHazkk
}
}
}
}
else {
method <- object$method
if (method == "breslow")
method <- 1
else if (method == "efron")
method <- 2
else stop("Only \"efron\" and \"breslow\" methods for ties supported")
type <- attr(y, "type")
if (type == "counting") {
if (has.strata)
ord <- order(mf[, strat], y[, 2], -y[, 3])
else ord <- order(y[, 2], -y[, 3])
}
else if (type == "right") {
if (has.strata)
ord <- order(mf[, strat], y[, 1], -y[, 2])
else ord <- order(y[, 1], -y[, 2])
miny <- min(y[, 1])
if (miny < 0)
y <- cbind(2 * miny - 1, y)
else y <- cbind(-1, y)
}
else stop("Cannot handle \"", type, "\" type survival data")
if (variance)
x <- x[ord, ]
else x <- 0
if (has.strata)
newstrat <- (as.numeric(mf[, strat]))[ord]
else newstrat <- rep(1, n)
newstrat <- cumsum(table(newstrat))
H <- length(newstrat)
subterms <- function(tt, i) {
dataClasses <- attr(tt, "dataClasses")
predvars <- attr(tt, "predvars")
oldnames <- dimnames(attr(tt, "factors"))[[1]]
tt <- tt[i]
index <- match(dimnames(attr(tt, "factors"))[[1]],
oldnames)
if (length(index) > 0) {
if (!is.null(predvars))
attr(tt, "predvars") <- predvars[c(1,
index + 1)]
if (!is.null(dataClasses))
attr(tt, "dataClasses") <- dataClasses[index]
}
tt
}
if (has.strata) {
temp <- untangle.specials(Terms, "strata")
if (length(temp$vars))
Terms <- subterms(Terms, -temp$terms)
}
Terms2 <- delete.response(Terms)
if (has.strata) {
if (length(attr(Terms2, "specials")$strata))
Terms2 <- subterms(Terms2, -attr(Terms2, "specials")$strata)
if (!is.null(object$xlevels)) {
myxlev <- object$xlevels[match(attr(Terms2,
"term.labels"), names(object$xlevels),
nomatch = 0)]
if (length(myxlev) == 0)
myxlev <- NULL
}
else myxlev <- NULL
mf2 <- model.frame(Terms2, data = newdata, xlev = myxlev)
}
else mf2 <- model.frame(Terms2, data = newdata, xlev = object$xlevels)
offset2 <- 0
if (!missing(newdata)) {
offset2 <- model.offset(mf2)
if (length(offset2) > 0)
offset2 <- offset2 - mean(offset)
else offset2 <- 0
x2 <- model.matrix(Terms2, mf2)[, -1, drop = FALSE]
}
else stop("newdata missing")
if (has.strata & is.null(newdata$strata))
stop("no \"strata\" column present in newdata")
n2 <- nrow(x2)
coef <- ifelse(is.na(object$coefficients), 0, object$coefficients)
newrisk <- exp(c(x2 %*% coef) + offset2 - sum(coef *
object$means))
dimnames(y) <- NULL
storage.mode(y) <- "double"
ndead <- sum(y[, 3])
untimes <- sort(unique(y[, 2][y[, 3] == 1]))
nt <- length(untimes)
surv <- .C("agmssurv", sn = as.integer(n),
sp = as.integer(nvar), svar = as.integer(variance),
smethod = as.integer(method), sH = as.integer(H),
sK = as.integer(n2), snt = as.integer(nt), y = y[ord,
], score = as.double(score[ord]), xmat = as.double(x),
varcov = as.double(object$var), strata = as.integer(c(0,
newstrat)), kstrata = as.integer(newdata$strata),
unt = as.double(untimes), newx = as.double(x2),
newrisk = as.double(newrisk), Haz = double(nt *
n2), varHaz = double(nt * n2 * (n2 + 1)/2),
d = double(3 * nvar), work = double(nt * n2 *
(nvar + 1)))
Haz <- data.frame(time = rep(untimes, n2), Haz = surv$Haz,
trans = rep(1:n2, rep(nt, n2)))
varHaz <- as.vector(t(matrix(surv$varHaz, ncol = nt)))
hlp <- matrix(c(rep(1:n2, rep(n2, n2)), rep(1:n2,
n2)), n2^2, 2)
hlp <- hlp[hlp[, 1] <= hlp[, 2], ]
varHaz <- data.frame(time = rep(untimes, n2 * (n2 +
1)/2), varHaz = varHaz, trans1 = rep(hlp[, 1],
rep(nt, n2 * (n2 + 1)/2)), trans2 = rep(hlp[,
2], rep(nt, n2 * (n2 + 1)/2)))
if (lasty > max(untimes)) {
Hmat <- matrix(Haz$Haz, nrow = nt)
Hmat <- rbind(Hmat, Hmat[nt, ])
vHmat <- matrix(varHaz$varHaz, nrow = nt)
vHmat <- rbind(vHmat, vHmat[nt, ])
untimes <- c(untimes, lasty)
nt <- nt + 1
Haz <- data.frame(time = rep(untimes, n2), Haz = as.vector(Hmat),
trans = rep(1:n2, rep(nt, n2)))
varHaz <- data.frame(time = rep(untimes, n2 *
(n2 + 1)/2), varHaz = as.vector(vHmat), trans1 = rep(hlp[,
1], rep(nt, n2 * (n2 + 1)/2)), trans2 = rep(hlp[,
2], rep(nt, n2 * (n2 + 1)/2)))
}
}
}
if (variance)
res <- list(Haz = Haz, varHaz = varHaz, trans = trans)
else res <- list(Haz = Haz, trans = trans)
class(res) <- "msfit"
return(res)
}
NAfix2 <- function(x, subst=-Inf) {
### Written by Christian Hoffmann; propagate last known non-NA value
### Input:
### x: numeric vector
### subst: scalar inidicating which value should replace NA
### if x starts with a series of NA's
### Output:
### (numeric) vector, with NA's replaced by last known non-NA value,
### or 'subst'
spec <- max(x[!is.na(x)])+1
x <- c(spec,x)
while (any(is.na(x))) x[is.na(x)] <- x[(1:length(x))[is.na(x)]-1]
x[x==spec] <- subst
x <- x[-1]
x
}
#devtools::install_github("hputter/mstate")
invisible(c("For semi-Markov models, mstate provides the function mssample to produce both simulated trajectories and transition probability matrices from semi-Markov models, given the estimated piecewise-constant cumulative hazards (Fiocco et al. 2008), produced by msfit or msfit.flexsurvreg, though this is generally less efficient than pmatrix.simfs. In this example, 1000 samples from mssample give estimates of transition probabilities that are accurate to within around 0.02. However with pmatrix.simfs, greater precision is achieved by simulating 100 times as many trajectories in a shorter time"))
time_before_LMAJ2<-Sys.time()
trans2_df<-cbind.data.frame(transition_label,trans=1:max(trans_matrix,na.rm=T))
lmaj_df2<-data.frame()
for (transo in 1:4){
if(tryCatch({LMAJ2(pr0,from=transo,s=1,method="aalen")}, error=function(e) {data.frame()}) %>% data.frame() %>% nrow()>0){
lmaj_df2<- rbind.data.frame(lmaj_df2,
cbind(pr="out",
LMAJ2(pr0, #An "msdata" object, as for instance prepared by link{msprep}
from=transo, ##Either a single state or a set of states in the state space 1,...,S
s=365*5, #The prediction time point s from which transition probabilities are to be obtained
method ="aalen" #The method for calculating variances, as in probtrans
),transo=transo))
} else if (tryCatch({LMAJ2(pr1,from=transo,s=1,method="aalen")}, error=function(e) {data.frame()}) %>% data.frame() %>% nrow()>0){
lmaj_df2<- rbind.data.frame(lmaj_df2,
cbind(pr="res",
LMAJ2(pr1, #An "msdata" object, as for instance prepared by link{msprep}
from=transo, ##Either a single state or a set of states in the state space 1,...,S
s=365*5, #The prediction time point s from which transition probabilities are to be obtained
method ="aalen" #The method for calculating variances, as in probtrans
),transo=transo))
} else {rep(0,21)
}
}
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(sf0$trans): ningun argumento finito para max; retornando -Inf
## Warning in max(event[who2]): ningun argumento finito para max; retornando -Inf
## Warning in max(event[who2]): ningun argumento finito para max; retornando -Inf
## Warning in max(event[who2]): ningun argumento finito para max; retornando -Inf
## Warning in max(event[who2]): ningun argumento finito para max; retornando -Inf
## Warning in max(event[who2]): ningun argumento finito para max; retornando -Inf
pr0_sel<-pr0[,c("id", "from", "to", "trans", "Tstart", "Tstop", "time", "status", "tipo_de_plan_res_1")]
attr(pr0_sel,"trans")<-trans_matrix
pr1_sel<-pr1[,c("id", "from", "to", "trans", "Tstart", "Tstop", "time", "status", "tipo_de_plan_res_1")]
attr(pr1_sel,"trans")<-trans_matrix
invisible("These are no 9 states, but 5")
LMAJ_mods2 <-list()
lmaj_mods_pars2<-expand.grid(s=c(90,365, 1096, 1826), from=1:7, res=c(0,1))
for (j in 1:nrow(lmaj_mods_pars2)) {
paste0("Time ",lmaj_mods_pars2[j, "s"],"; From: ",lmaj_mods_pars2[j, "from"],"; Setting (res==1)= ",lmaj_mods_pars2[j, "res"])
LMAJ_mods2[[j]]<-
#tryCatch({assign(paste0("lmaj_",ifelse(lmaj_mods_pars[j, "res"]==1,"res","out"),"_",lmaj_mods_pars[j, "s"] ,"_9s"),
try(LMAJ2(get(paste0("pr",lmaj_mods_pars2[j, "res"],"_sel")), #An "msdata" object, as for instance prepared by link{msprep}
from= lmaj_mods_pars2[j, "from"], ##Either a single state or a set of states in the state space 1,...,S
s= lmaj_mods_pars2[j, "s"], #The prediction time point s from which transition probabilities are to be obtained
method ="aalen"), #The method for calculating variances, as in probtrans
silent=F)
#)}, error=function(e){},silent=F)
names(LMAJ_mods2)[[j]] <- paste0("lmaj_",ifelse(lmaj_mods_pars2[j, "res"]==1,"res","out"),"_",lmaj_mods_pars2[j, "s"] ,"_",lmaj_mods_pars2[j, "from"],"_5s")
}
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(event[who2]): ningun argumento finito para max; retornando -Inf
## Error in coxph(Surv(Tstart, Tstop, status) ~ strata(trans), data = msdatasfrom) :
## No (non-missing) observations
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(event[who2]): ningun argumento finito para max; retornando -Inf
## Error in coxph(Surv(Tstart, Tstop, status) ~ strata(trans), data = msdatasfrom) :
## No (non-missing) observations
## Warning in max(event[who2]): ningun argumento finito para max; retornando -Inf
## Error in coxph(Surv(Tstart, Tstop, status) ~ strata(trans), data = msdatasfrom) :
## No (non-missing) observations
## Warning in max(event[who2]): ningun argumento finito para max; retornando -Inf
## Error in coxph(Surv(Tstart, Tstop, status) ~ strata(trans), data = msdatasfrom) :
## No (non-missing) observations
## Warning in max(event[who2]): ningun argumento finito para max; retornando -Inf
## Error in coxph(Surv(Tstart, Tstop, status) ~ strata(trans), data = msdatasfrom) :
## No (non-missing) observations
## Error in LMAJ2(get(paste0("pr", lmaj_mods_pars2[j, "res"], "_sel")), from = lmaj_mods_pars2[j, :
## from should be subset of 1:K with K number of states
## Error in LMAJ2(get(paste0("pr", lmaj_mods_pars2[j, "res"], "_sel")), from = lmaj_mods_pars2[j, :
## from should be subset of 1:K with K number of states
## Error in LMAJ2(get(paste0("pr", lmaj_mods_pars2[j, "res"], "_sel")), from = lmaj_mods_pars2[j, :
## from should be subset of 1:K with K number of states
## Error in LMAJ2(get(paste0("pr", lmaj_mods_pars2[j, "res"], "_sel")), from = lmaj_mods_pars2[j, :
## from should be subset of 1:K with K number of states
## Error in LMAJ2(get(paste0("pr", lmaj_mods_pars2[j, "res"], "_sel")), from = lmaj_mods_pars2[j, :
## from should be subset of 1:K with K number of states
## Error in LMAJ2(get(paste0("pr", lmaj_mods_pars2[j, "res"], "_sel")), from = lmaj_mods_pars2[j, :
## from should be subset of 1:K with K number of states
## Error in LMAJ2(get(paste0("pr", lmaj_mods_pars2[j, "res"], "_sel")), from = lmaj_mods_pars2[j, :
## from should be subset of 1:K with K number of states
## Error in LMAJ2(get(paste0("pr", lmaj_mods_pars2[j, "res"], "_sel")), from = lmaj_mods_pars2[j, :
## from should be subset of 1:K with K number of states
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(event[who2]): ningun argumento finito para max; retornando -Inf
## Error in coxph(Surv(Tstart, Tstop, status) ~ strata(trans), data = msdatasfrom) :
## No (non-missing) observations
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(event[who2]): ningun argumento finito para max; retornando -Inf
## Error in coxph(Surv(Tstart, Tstop, status) ~ strata(trans), data = msdatasfrom) :
## No (non-missing) observations
## Warning in max(event[who2]): ningun argumento finito para max; retornando -Inf
## Error in coxph(Surv(Tstart, Tstop, status) ~ strata(trans), data = msdatasfrom) :
## No (non-missing) observations
## Warning in max(event[who2]): ningun argumento finito para max; retornando -Inf
## Error in coxph(Surv(Tstart, Tstop, status) ~ strata(trans), data = msdatasfrom) :
## No (non-missing) observations
## Warning in max(event[who2]): ningun argumento finito para max; retornando -Inf
## Error in coxph(Surv(Tstart, Tstop, status) ~ strata(trans), data = msdatasfrom) :
## No (non-missing) observations
## Error in LMAJ2(get(paste0("pr", lmaj_mods_pars2[j, "res"], "_sel")), from = lmaj_mods_pars2[j, :
## from should be subset of 1:K with K number of states
## Error in LMAJ2(get(paste0("pr", lmaj_mods_pars2[j, "res"], "_sel")), from = lmaj_mods_pars2[j, :
## from should be subset of 1:K with K number of states
## Error in LMAJ2(get(paste0("pr", lmaj_mods_pars2[j, "res"], "_sel")), from = lmaj_mods_pars2[j, :
## from should be subset of 1:K with K number of states
## Error in LMAJ2(get(paste0("pr", lmaj_mods_pars2[j, "res"], "_sel")), from = lmaj_mods_pars2[j, :
## from should be subset of 1:K with K number of states
## Error in LMAJ2(get(paste0("pr", lmaj_mods_pars2[j, "res"], "_sel")), from = lmaj_mods_pars2[j, :
## from should be subset of 1:K with K number of states
## Error in LMAJ2(get(paste0("pr", lmaj_mods_pars2[j, "res"], "_sel")), from = lmaj_mods_pars2[j, :
## from should be subset of 1:K with K number of states
## Error in LMAJ2(get(paste0("pr", lmaj_mods_pars2[j, "res"], "_sel")), from = lmaj_mods_pars2[j, :
## from should be subset of 1:K with K number of states
## Error in LMAJ2(get(paste0("pr", lmaj_mods_pars2[j, "res"], "_sel")), from = lmaj_mods_pars2[j, :
## from should be subset of 1:K with K number of states
time_after_LMAJ2<-Sys.time()
#LMAJ(pr1,from=1,s=90,method="aalen")
paste0("Time in process: ");time_after_LMAJ2-time_before_LMAJ2
## [1] "Time in process: "
## Time difference of 15.7871 secs
#A data frame containing estimates and associated standard errors of the transition probabilities P(X(t)=k | X(s) in from) with s and from the arguments of the function.
states_transition_label<- paste0(1:5,") ",c("Admission", "Readmission","Second Readmission", "Third Readmission", "Fourth Readmission"))
attr(states_transition_label,"names")<- 1:5
lmaj_plot<-
rbind(cbind(pr="res",LMAJ_mods2$lmaj_res_1096_1_5s,transo=1),
cbind(pr="out",LMAJ_mods2$lmaj_out_1096_1_5s,transo=1)) %>%
melt(id.vars=c("pr","transo","time")) %>%
dplyr::rename("state_from"="transo") %>%
dplyr::mutate(state_to=stri_sub(variable,-1,-1)) %>%
dplyr::mutate(setting= dplyr::case_when(grepl("out",pr)~"Ambulatory",
grepl("res",pr)~"Residential",
T~NA_character_)) %>%
dplyr::mutate(measure= dplyr::case_when(grepl("se",variable)~"se",
grepl("pstate",variable)~"Estimate",
T~NA_character_)) %>%
dplyr::select(-pr,-variable) %>%
tidyr::pivot_wider(names_from=measure,values_from = value) %>%
dplyr::mutate(lo_ci=pmax(0,1-(1-Estimate)* + exp(qnorm(0.975)*se/(1-Estimate)))) %>%
dplyr::mutate(up_ci=1-(1-Estimate)* + exp(-qnorm(0.975)*se/(1-Estimate))) %>%
dplyr::filter(state_from>0, state_to>0) %>%
purrr::when(dplyr::group_by(.,time, state_from, state_to, setting) %>% summarise(n=n()) %>% dplyr::filter(n>1)%>% nrow()>0 ~ stop("There are cases with differences different than 0 days of a variable that should be equal"),
~.) %>%
dplyr::mutate(state_from=factor(state_from),state_to=factor(state_to), setting=factor(setting)) %>%
ggplot(aes(time, Estimate, linetype =setting))+
geom_step(size=1, alpha=.65) +
geom_ribbon(aes(ymin=lo_ci, ymax=up_ci, fill=setting), alpha=.5)+#, fill=setting
facet_wrap(state_to~., scales="free_y",labeller = as_labeller(states_transition_label), ncol=2) + #
scale_y_continuous(labels = scales::percent_format(accuracy = .1))+
#facet_wrap(state~., ncol=1, scales="free_y") + #type_of_program
scale_fill_manual(name= "Type of\nprogram",values=c("gray35","gray75"), labels=c("Ambulatory","Residential"))+
scale_linetype_manual(name= "Type of\nprogram",values=c(1,4), labels=c("Ambulatory","Residential")) +
scale_x_continuous(breaks=seq(0,365.25*11,length.out=11),
label=round(seq(0,365.25*11,length.out=11)/365.25,2))+
xlab("Years") +
ylab("") +
theme_minimal(base_size = 18)+
theme(legend.position = c(0.75,.05))
## `summarise()` has grouped output by 'time', 'state_from', 'state_to'. You can
## override using the `.groups` argument.
if(no_mostrar==1){
jpeg(paste0(jpg_path,"_mult_state_ags/lmaj_st_occ_ago_from1_3y_apr22.jpg"), height=8, width= 15, res= 320, units = "in")
lmaj_plot
dev.off()
}
time_before_LMAJ3<-Sys.time()
LMAJ_mods3 <-list()
lmaj_mods_pars3<-expand.grid(s=c(90,365, 1096, 1826), from=1:7, res=c(0,1))
for (j in 1:nrow(lmaj_mods_pars3)) {
paste0("Time ",lmaj_mods_pars3[j, "s"],"; From: ",lmaj_mods_pars2[j, "from"],"; Setting (res==1)= ",lmaj_mods_pars3[j, "res"])
LMAJ_mods3[[j]]<-
#tryCatch({assign(paste0("lmaj_",ifelse(lmaj_mods_pars[j, "res"]==1,"res","out"),"_",lmaj_mods_pars[j, "s"] ,"_9s"),
try(LMAJ2(get(paste0("pr",lmaj_mods_pars3[j, "res"],"_sel_9s")), #An "msdata" object, as for instance prepared by link{msprep}
from= lmaj_mods_pars3[j, "from"], ##Either a single state or a set of states in the state space 1,...,S
s= lmaj_mods_pars3[j, "s"], #The prediction time point s from which transition probabilities are to be obtained
method ="aalen"), #The method for calculating variances, as in probtrans
silent=F)
#)}, error=function(e){},silent=F)
names(LMAJ_mods3)[[j]] <- paste0("lmaj_",ifelse(lmaj_mods_pars3[j, "res"]==1,"res","out"),"_",lmaj_mods_pars3[j, "s"] ,"_",lmaj_mods_pars3[j, "from"],"_9s")
}
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in sqrt(diag(varP)): Se han producido NaNs
## Warning in sqrt(diag(varP)): Se han producido NaNs
## Warning in sqrt(diag(varP)): Se han producido NaNs
## Warning in max(sf0$trans): ningun argumento finito para max; retornando -Inf
## Error in rep(allt, K) : argumento 'times' inválido
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(event[who2]): ningun argumento finito para max; retornando -Inf
## Error in coxph(Surv(Tstart, Tstop, status) ~ strata(trans), data = msdatasfrom) :
## No (non-missing) observations
## Warning in max(sf0$trans): ningun argumento finito para max; retornando -Inf
## Error in rep(allt, K) : argumento 'times' inválido
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Error in rowSums(imat[, 1:3]) :
## 'x' must be an array of at least two dimensions
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(sf0$trans): ningun argumento finito para max; retornando -Inf
## Error in rep(allt, K) : argumento 'times' inválido
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(event[who2]): ningun argumento finito para max; retornando -Inf
## Error in coxph(Surv(Tstart, Tstop, status) ~ strata(trans), data = msdatasfrom) :
## No (non-missing) observations
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(stackvarhaz$time[stackvarhaz$time <= predt]): ningun argumento
## finito para max; retornando -Inf
time_after_LMAJ3<-Sys.time()
#LMAJ(pr1,from=1,s=90,method="aalen")
paste0("Time in process: ");time_after_LMAJ3-time_before_LMAJ3
## [1] "Time in process: "
## Time difference of 50.92665 secs
#A data frame containing estimates and associated standard errors of the transition probabilities P(X(t)=k | X(s) in from) with s and from the arguments of the function.
lmaj_plot_9s<-
rbind(cbind(pr="res",LMAJ_mods3$lmaj_res_1096_1_9s,transo=1),
cbind(pr="out",LMAJ_mods3$lmaj_out_1096_1_9s,transo=1)) %>%
melt(id.vars=c("pr","transo","time")) %>%
dplyr::rename("state_from"="transo") %>%
dplyr::filter(time<5.01*365.25) %>%
dplyr::mutate(state_to=stri_sub(variable,-1,-1)) %>%
dplyr::mutate(setting= dplyr::case_when(grepl("out",pr)~"Ambulatory",
grepl("res",pr)~"Residential",
T~NA_character_)) %>%
dplyr::mutate(measure= dplyr::case_when(grepl("se",variable)~"se",
grepl("pstate",variable)~"Estimate",
T~NA_character_)) %>%
dplyr::select(-pr,-variable) %>%
tidyr::pivot_wider(names_from=measure,values_from = value) %>%
dplyr::mutate(lo_ci=pmax(0,1-(1-Estimate)* + exp(qnorm(0.975)*se/(1-Estimate)))) %>%
dplyr::mutate(up_ci=1-(1-Estimate)* + exp(-qnorm(0.975)*se/(1-Estimate))) %>%
dplyr::filter(state_from>0, state_to>0) %>%
purrr::when(dplyr::group_by(.,time, state_from, state_to, setting) %>% summarise(n=n()) %>% dplyr::filter(n>1)%>% nrow()>0 ~ stop("There are cases with differences different than 0 days of a variable that should be equal"),
~.) %>%
dplyr::mutate(state_from=factor(state_from),state_to=factor(state_to), setting=factor(setting)) %>%
ggplot(aes(time, Estimate, linetype =setting))+
geom_step(size=1, alpha=.65) +
geom_ribbon(aes(ymin=lo_ci, ymax=up_ci, fill=setting), alpha=.5)+#, fill=setting
facet_wrap(state_to~., scales="free_y",labeller = as_labeller(states_trans_lab_9s), ncol=2) + #
scale_y_continuous(labels = scales::percent_format(accuracy = .1))+
#facet_wrap(state~., ncol=1, scales="free_y") + #type_of_program
scale_fill_manual(name= "Type of\nprogram",values=c("gray35","gray75"), labels=c("Ambulatory","Residential"))+
scale_linetype_manual(name= "Type of\nprogram",values=c(1,4), labels=c("Ambulatory","Residential")) +
scale_x_continuous(breaks=seq(0,365.25*5,length.out=11),
label=round(seq(0,365.25*5,length.out=11)/365.25,2))+
xlab("Years") +
ylab("") +
theme_minimal(base_size = 18)+
theme(legend.position = c(0.75,.05))
## `summarise()` has grouped output by 'time', 'state_from', 'state_to'. You can
## override using the `.groups` argument.
if(no_mostrar==1){
jpeg(paste0(jpg_path,"_mult_state_ags/lmaj_st_occ_ago_from1_3y_apr22_9s.jpg"), height=8, width= 15, res= 320, units = "in")
lmaj_plot_9s
dev.off()
}
states_trans_lab<-paste0(1:5,") ",states_trans)
attr(states_trans_lab,"names")<-1:5
# Prob.occ5 <- data.frame(P=tmp.prob,
# lci=tmp.prob-qnorm(0.975)*c(tmp$se1,tmp$se2,tmp$se3),
# uci=tmp.prob+qnorm(0.975)*c(tmp$se1,tmp$se2,tmp$se3))
lmaj_ci_df<-
rbind(cbind(pr="res",LMAJ_mods2$lmaj_res_1096_1_5s,transo=1),
cbind(pr="out",LMAJ_mods2$lmaj_out_1096_1_5s,transo=1)) %>%
rbind(cbind(pr="res",LMAJ_mods2$lmaj_res_1096_2_5s,transo=2),
cbind(pr="out",LMAJ_mods2$lmaj_out_1096_2_5s,transo=2)) %>%
rbind(cbind(pr="res",LMAJ_mods2$lmaj_res_1096_3_5s,transo=3),
cbind(pr="out",LMAJ_mods2$lmaj_out_1096_3_5s,transo=3)) %>%
rbind(cbind(pr="res",LMAJ_mods2$lmaj_res_1096_4_5s,transo=4),
cbind(pr="out",LMAJ_mods2$lmaj_out_1096_4_5s,transo=4)) %>%
dplyr::mutate(lo_pstate1=pmax(0,1-(1-pstate1)* + exp(qnorm(0.975)*se1/(1-pstate1)))) %>%
dplyr::mutate(up_pstate1=1-(1-pstate1)* + exp(-qnorm(0.975)*se1/(1-pstate1))) %>%
dplyr::mutate(lo_pstate2=pmax(0,1-(1-pstate2)* + exp(qnorm(0.975)*se2/(1-pstate2)))) %>%
dplyr::mutate(up_pstate2=1-(1-pstate2)* + exp(-qnorm(0.975)*se2/(1-pstate2))) %>%
dplyr::mutate(lo_pstate3=pmax(0,1-(1-pstate3)* + exp(qnorm(0.975)*se3/(1-pstate3)))) %>%
dplyr::mutate(up_pstate3=1-(1-pstate3)* + exp(-qnorm(0.975)*se3/(1-pstate3))) %>%
dplyr::mutate(lo_pstate4=pmax(0,1-(1-pstate4)* + exp(qnorm(0.975)*se4/(1-pstate4)))) %>%
dplyr::mutate(up_pstate4=1-(1-pstate4)* + exp(-qnorm(0.975)*se4/(1-pstate4))) %>%
dplyr::mutate(lo_pstate5=pmax(0,1-(1-pstate5)* + exp(qnorm(0.975)*se5/(1-pstate5)))) %>%
dplyr::mutate(up_pstate5=1-(1-pstate5)* + exp(-qnorm(0.975)*se5/(1-pstate5))) %>%
melt(id.vars=c("pr","transo","time")) %>%
dplyr::rename("state_from"="transo") %>%
dplyr::mutate(state_to=stri_sub(variable,-1,-1)) %>%
dplyr::mutate(setting= dplyr::case_when(grepl("out",pr)~"Ambulatory",
grepl("res",pr)~"Residential",
T~NA_character_)) %>%
dplyr::mutate(measure= dplyr::case_when(grepl("se",variable)~"se",
grepl("lo",variable)~"l95ci",
grepl("up",variable)~"u95ci",
grepl("pstate",variable)~"Estimate",
T~NA_character_)) %>%
dplyr::select(-pr,-variable) %>%
purrr::when(dplyr::group_by(.,state_from, time, state_to, setting, measure)%>% summarise(n=n())%>% dplyr::filter(n>1)%>% nrow()>0 ~ stop("There are cases with differences different than 0 days of a variable that should be equal"),
~.) %>%
tidyr::pivot_wider(names_from=measure,values_from = value) %>%
dplyr::mutate(state_from=ifelse(state_from==0,5,state_from)) %>%
dplyr::mutate(state_to=ifelse(state_to==0,5,state_to)) %>%
#dplyr::filter(state_from>0, state_to>0) %>%
purrr::when(dplyr::group_by(.,time, state_from, state_to, setting) %>% summarise(n=n()) %>% dplyr::filter(n>1)%>% nrow()>0 ~ stop("There are cases with differences different than 0 days of a variable that should be equal"),
~.) %>%
dplyr::mutate(setting=factor(setting))
## `summarise()` has grouped output by 'state_from', 'time', 'state_to', 'setting'. You can override using the `.groups` argument.
## `summarise()` has grouped output by 'time', 'state_from', 'state_to'. You can override using the `.groups` argument.
lmaj_ci_df%>%
dplyr::select(time, state_from, state_to, setting, Estimate, l95ci, u95ci) %>%
dplyr::arrange(state_from,state_to,setting,time) %>%
dplyr::mutate(state_to=as.numeric(state_to)) %>%
dplyr::mutate(time_group= dplyr::case_when(time>=85 & time<=105~ 1, time>=350 & time<=380~ 2, time>=1080 & time<=1110~ 3, time>=1781 & time<=1871~ 4, T~NA_real_)) %>%
dplyr::filter(time_group %in% 1:4) %>%
dplyr::mutate(time_group=factor(time_group, levels=1:4,
labels=c("~90days/3 months", "~1 year", "~3 years", "~5 years"),ordered=T)) %>%
dplyr::mutate(comb=paste0(state_from,"_",state_to)) %>%
dplyr::filter(comb %in% c("1_2","2_3","3_4", "4_5")) %>%
dplyr::group_by(state_from, state_to, setting, time_group, comb) %>%
dplyr::summarise(Estimate=mean(Estimate, na.rm=T), l95ci= mean(l95ci, na.rm=T), u95ci= mean(u95ci, na.rm=T)) %>%
dplyr::left_join(cbind.data.frame(states_trans_lab,st=1:5), by=c("state_from"="st")) %>%
dplyr::left_join(cbind.data.frame(states_trans_lab,st=1:5), by=c("state_to"="st")) %>%
dplyr::select(-comb) %>%
dplyr::rename("state_from_lab"="states_trans_lab.x","state_to_lab"="states_trans_lab.y") %>%
dplyr::mutate(est_ci=paste0(sprintf("%1.3f",Estimate)," [",sprintf("%1.3f",abs(l95ci)),"-",sprintf("%1.3f",abs(u95ci)),"]")) %>%
dplyr::arrange(state_from,state_to) %>%
dplyr::select(setting, state_from_lab, state_to_lab, est_ci) %>%
tidyr::pivot_wider(names_from=setting,values_from = est_ci) %>%
#2021-04-27: drop from/actual state, readmission
knitr::kable(format = "html", format.args = list(decimal.mark = ".", big.mark = ","),
caption = paste0("Table 1. Estimated transition probabilities, Five-states model (From state=1, at s=90 days)"),
col.names = c("State from","State to","Ambulatory","Residential"),
align =rep('l', 2),rep('c', 2)) %>%
kableExtra::kable_styling(bootstrap_options = c("striped", "hover"),font_size = 13) %>%
kableExtra::add_footnote("Note. We removed Readmission because it was an absorbing state", notation="none") %>%
#kableExtra::add_header_above(c(" ", "Women-specific: Transition to" = 4,"General Population: Transition to" = 4)) %>%
kableExtra::pack_rows("At 90 days", 1, 4) %>%
kableExtra::pack_rows("At ~1 year", 5, 8) %>%
kableExtra::pack_rows("At ~3 years", 9, 12) %>%
kableExtra::pack_rows("At ~5 years", 13, 16) %>%
kableExtra::scroll_box(width = "100%", height = "375px")
## `summarise()` has grouped output by 'state_from', 'state_to', 'setting', 'time_group'. You can override using the `.groups` argument.
## Adding missing grouping variables: `state_from`, `state_to`, `time_group`
## Error in round(x[, j], digits[j]): non-numeric argument to mathematical function
# Prob.occ5 <- data.frame(P=tmp.prob,
# lci=tmp.prob-qnorm(0.975)*c(tmp$se1,tmp$se2,tmp$se3),
# uci=tmp.prob+qnorm(0.975)*c(tmp$se1,tmp$se2,tmp$se3))
lmaj_ci_df2<-
rbind(cbind(pr="res",LMAJ_mods3$lmaj_res_1096_1_9s,transo=1),
cbind(pr="out",LMAJ_mods3$lmaj_out_1096_1_9s,transo=1)) %>%
rbind(cbind(pr="res",LMAJ_mods3$lmaj_res_1096_2_9s,transo=2),
cbind(pr="out",LMAJ_mods3$lmaj_out_1096_2_9s,transo=2)) %>%
rbind(cbind(pr="res",LMAJ_mods3$lmaj_res_1096_3_9s,transo=3),
cbind(pr="out",LMAJ_mods3$lmaj_out_1096_3_9s,transo=3)) %>%
rbind(cbind(pr="res",LMAJ_mods3$lmaj_res_1096_4_9s,transo=4),
cbind(pr="out",LMAJ_mods3$lmaj_out_1096_4_9s,transo=4)) %>%
rbind(cbind(pr="res",LMAJ_mods3$lmaj_res_1096_5_9s,transo=5),
cbind(pr="out",LMAJ_mods3$lmaj_out_1096_5_9s,transo=5)) %>%
rbind(cbind(pr="res",LMAJ_mods3$lmaj_res_1096_6_9s,transo=6),
cbind(pr="out",LMAJ_mods3$lmaj_out_1096_6_9s,transo=6)) %>%
rbind(cbind(pr="res",LMAJ_mods3$lmaj_res_1096_7_9s,transo=7),
cbind(pr="out",LMAJ_mods3$lmaj_out_1096_7_9s,transo=7)) %>%
dplyr::mutate(lo_pstate1=pmax(0,1-(1-pstate1)* + exp(qnorm(0.975)*se1/(1-pstate1)))) %>%
dplyr::mutate(up_pstate1=1-(1-pstate1)* + exp(-qnorm(0.975)*se1/(1-pstate1))) %>%
dplyr::mutate(lo_pstate2=pmax(0,1-(1-pstate2)* + exp(qnorm(0.975)*se2/(1-pstate2)))) %>%
dplyr::mutate(up_pstate2=1-(1-pstate2)* + exp(-qnorm(0.975)*se2/(1-pstate2))) %>%
dplyr::mutate(lo_pstate3=pmax(0,1-(1-pstate3)* + exp(qnorm(0.975)*se3/(1-pstate3)))) %>%
dplyr::mutate(up_pstate3=1-(1-pstate3)* + exp(-qnorm(0.975)*se3/(1-pstate3))) %>%
dplyr::mutate(lo_pstate4=pmax(0,1-(1-pstate4)* + exp(qnorm(0.975)*se4/(1-pstate4)))) %>%
dplyr::mutate(up_pstate4=1-(1-pstate4)* + exp(-qnorm(0.975)*se4/(1-pstate4))) %>%
dplyr::mutate(lo_pstate5=pmax(0,1-(1-pstate5)* + exp(qnorm(0.975)*se5/(1-pstate5)))) %>%
dplyr::mutate(up_pstate5=1-(1-pstate5)* + exp(-qnorm(0.975)*se5/(1-pstate5))) %>%
dplyr::mutate(lo_pstate6=pmax(0,1-(1-pstate6)* + exp(qnorm(0.975)*se6/(1-pstate6)))) %>%
dplyr::mutate(up_pstate6=1-(1-pstate6)* + exp(-qnorm(0.975)*se6/(1-pstate6))) %>%
dplyr::mutate(lo_pstate7=pmax(0,1-(1-pstate7)* + exp(qnorm(0.975)*se7/(1-pstate7)))) %>%
dplyr::mutate(up_pstate7=1-(1-pstate7)* + exp(-qnorm(0.975)*se7/(1-pstate7))) %>%
dplyr::mutate(lo_pstate8=pmax(0,1-(1-pstate8)* + exp(qnorm(0.975)*se8/(1-pstate8)))) %>%
dplyr::mutate(up_pstate8=1-(1-pstate8)* + exp(-qnorm(0.975)*se8/(1-pstate8))) %>%
dplyr::mutate(lo_pstate9=pmax(0,1-(1-pstate9)* + exp(qnorm(0.975)*se9/(1-pstate9)))) %>%
dplyr::mutate(up_pstate9=1-(1-pstate9)* + exp(-qnorm(0.975)*se9/(1-pstate9))) %>%
melt(id.vars=c("pr","transo","time")) %>%
dplyr::rename("state_from"="transo") %>%
dplyr::mutate(state_to=stri_sub(variable,-1,-1)) %>%
dplyr::mutate(setting= dplyr::case_when(grepl("out",pr)~"Ambulatory",
grepl("res",pr)~"Residential",
T~NA_character_)) %>%
dplyr::mutate(measure= dplyr::case_when(grepl("se",variable)~"se",
grepl("lo",variable)~"l95ci",
grepl("up",variable)~"u95ci",
grepl("pstate",variable)~"Estimate",
T~NA_character_)) %>%
dplyr::select(-pr,-variable) %>%
purrr::when(dplyr::group_by(.,state_from, time, state_to, setting, measure)%>% summarise(n=n())%>% dplyr::filter(n>1)%>% nrow()>0 ~ stop("There are cases with differences different than 0 days of a variable that should be equal"),
~.) %>%
tidyr::pivot_wider(names_from=measure,values_from = value) %>%
#dplyr::filter(state_from>0, state_to>0) %>%
purrr::when(dplyr::group_by(.,time, state_from, state_to, setting) %>% summarise(n=n()) %>% dplyr::filter(n>1)%>% nrow()>0 ~ stop("There are cases with differences different than 0 days of a variable that should be equal"),
~.) %>%
dplyr::mutate(setting=factor(setting))
## `summarise()` has grouped output by 'state_from', 'time', 'state_to', 'setting'. You can override using the `.groups` argument.
## `summarise()` has grouped output by 'time', 'state_from', 'state_to'. You can override using the `.groups` argument.
lmaj_ci_df2 %>%
dplyr::select(time, state_from, state_to, setting, Estimate, l95ci, u95ci) %>%
dplyr::arrange(state_from,state_to,setting,time) %>%
dplyr::mutate(state_to=as.numeric(state_to)) %>%
dplyr::mutate(time_group= dplyr::case_when(time>=85 & time<=105~ 1, time>=350 & time<=380~ 2, time>=1080 & time<=1110~ 3, time>=1781 & time<=1871~ 4, T~NA_real_)) %>%
dplyr::filter(time_group %in% 1:4) %>%
dplyr::mutate(time_group=factor(time_group, levels=1:4,
labels=c("~90days/3 months", "~1 year", "~3 years", "~5 years"),ordered=T)) %>%
dplyr::mutate(comb=paste0(state_from,"_",state_to)) %>%
dplyr::filter(comb %in% c("1_2","1_3","2_4","3_5","4_6","5_7","6_8","7_9")) %>%
dplyr::left_join(cbind.data.frame(states_trans_lab_9s,st=1:9), by=c("state_from"="st")) %>%
dplyr::left_join(cbind.data.frame(states_trans_lab_9s,st=1:9), by=c("state_to"="st")) %>%
dplyr::select(-comb) %>%
dplyr::rename("state_from_lab"="states_trans_lab_9s.x","state_to_lab"="states_trans_lab_9s.y") %>%
dplyr::mutate(est_ci=paste0(sprintf("%1.3f",Estimate)," [",sprintf("%1.3f",abs(l95ci)),"-",sprintf("%1.3f",abs(u95ci)),"]")) %>%
dplyr::arrange(state_from,state_to) %>%
dplyr::select(setting, state_from_lab, state_to_lab, est_ci) %>%
tidyr::pivot_wider(names_from=setting,values_from = est_ci) %>%
#2021-04-27: drop from/actual state, readmission
knitr::kable(format = "html", format.args = list(decimal.mark = ".", big.mark = ","),
caption = paste0("Table 1. Estimated transition probabilities, Five-states model (From state=1, at s=90 days)"),
col.names = c("State from","State to","Ambulatory","Residential"),
align =rep('l', 2),rep('c', 2)) %>%
kableExtra::kable_styling(bootstrap_options = c("striped", "hover"),font_size = 13) %>%
kableExtra::add_footnote("Note. We removed Readmission because it was an absorbing state", notation="none") %>%
#kableExtra::add_header_above(c(" ", "Women-specific: Transition to" = 4,"General Population: Transition to" = 4)) %>%
kableExtra::pack_rows("At 90 days", 1, 4) %>%
kableExtra::pack_rows("At ~1 year", 5, 8) %>%
kableExtra::pack_rows("At ~3 years", 9, 12) %>%
kableExtra::pack_rows("At ~5 years", 13, 16) %>%
kableExtra::scroll_box(width = "100%", height = "375px")
## Warning: Values are not uniquely identified; output will contain list-cols.
## * Use `values_fn = list` to suppress this warning.
## * Use `values_fn = length` to identify where the duplicates arise
## * Use `values_fn = {summary_fun}` to summarise duplicates
## Error in UseMethod("nodeset_apply"): no applicable method for 'nodeset_apply' applied to an object of class "NULL"
lmaj_ci_df_plot<-
lmaj_ci_df %>%
dplyr::mutate(l95ci=dplyr::case_when(se<.1 & Estimate==1~1,T~l95ci),
u95ci=dplyr::case_when(se<.1 & Estimate==1~1,T~u95ci)) %>%
dplyr::mutate(comb=paste0(state_from,"_",state_to)) %>%
dplyr::filter(comb %in% c("1_2","2_3","3_4","4_5")) %>%
# dplyr::filter(state_from==1) %>%
ggplot(aes(time, Estimate, color= setting, linetype =setting, fill=setting))+
geom_step(size=1, alpha=.65) +
geom_ribbon(aes(ymin=l95ci, ymax=u95ci, fill=setting), alpha=.5)+
facet_wrap(state_from~state_to, ncol=5, scales="free_y", labeller = as_labeller(states_trans_lab)) + #
scale_y_continuous(labels = scales::percent_format(accuracy = .1))+
#facet_wrap(state~., ncol=5, scales="free_y") + #type_of_program
scale_color_manual(name= "Type of\nprogram",values=c("gray65","gray35"), labels=c("Ambulatory","Residential")) +
scale_fill_manual(name= "Type of\nprogram",values=c("gray65","gray35"), labels=c("Ambulatory","Residential")) +
scale_linetype_manual(name= "Type of\nprogram",values=c(1,4), labels=c("Ambulatory","Residential")) +
scale_x_continuous(breaks=seq(0,max(c(msf0$Haz$time,msf1$Haz$time),na.rm=T),by=max(c(msf0$Haz$time,msf1$Haz$time),na.rm=T)/11),
label=0:11)+
xlab("Years") +
ylab("") +
theme_minimal()
lmaj_ci_df_plot
Figure 4a. State Occupancies & 95% CIs, landmark Aalen-Johansen estimator (at 3 years)
if(no_mostrar==1){
jpeg(paste0(jpg_path,"_mult_state_ags/probtrans_states_trans_apr22_2.jpg"), height=10, width= 15, res= 320, units = "in")
lmaj_ci_df_plot
dev.off()
}
lmaj_ci_df_plot2<-
lmaj_ci_df2 %>%
dplyr::mutate(l95ci=dplyr::case_when(se<.1 & Estimate==1~1,T~l95ci),
u95ci=dplyr::case_when(se<.1 & Estimate==1~1,T~u95ci)) %>%
dplyr::mutate(comb=paste0(state_from,"_",state_to)) %>%
dplyr::filter(comb %in% c("1_2","2_3","3_4","4_5")) %>%
ggplot(aes(time, Estimate, color= setting, linetype =setting, fill=setting))+
geom_step(size=1, alpha=.65) +
geom_ribbon(aes(ymin=l95ci, ymax=u95ci, fill=setting), alpha=.5)+
facet_wrap(state_from~state_to, ncol=5, scales="free_y", labeller = as_labeller(states_trans_lab)) + #
scale_y_continuous(labels = scales::percent_format(accuracy = .1))+
#facet_wrap(state~., ncol=1, scales="free_y") + #type_of_program
scale_color_manual(name= "Type of\nprogram",values=c("gray65","gray35"), labels=c("Ambulatory","Residential")) +
scale_fill_manual(name= "Type of\nprogram",values=c("gray65","gray35"), labels=c("Ambulatory","Residential")) +
scale_linetype_manual(name= "Type of\nprogram",values=c(1,4), labels=c("Ambulatory","Residential")) +
scale_x_continuous(breaks=seq(0,max(c(msf0$Haz$time,msf1$Haz$time),na.rm=T),by=max(c(msf0$Haz$time,msf1$Haz$time),na.rm=T)/11),
label=0:11)+
xlab("Years") +
ylab("") +
theme_minimal()
lmaj_ci_df_plot2
Figure 4b. State Occupancies & 95% CIs, landmark Aalen-Johansen estimator (At 90 days)
#jpeg(paste0(jpg_path,"_mult_state_ags/Cum_haz_markov_set_jun2.jpg"), height=14, width= 12, res= 320, units = "in")
if(no_mostrar==1){
jpeg(paste0(jpg_path,"_mult_state_ags/probtrans_states_trans_apr22_3_9s.jpg"), height=10, width= 15, res= 320, units = "in")
lmaj_ci_df_plot2
dev.off()
}
## Function that calculates the working independence Aalen-Johansen estimator
## of the population-averaged transition probabilities. Standard errors and
## and 95% confidence intervals and bands are also calculated.
## Auxiliary function to calculate the landmark version
## of the working independence Aalen-Johansen estimator.
## This is a modification of the LMAJ function in the
## R package mstate.
LMAJ2 <- function (msdata, tmat, id, s, h, j, weighted){
if (is.null(tmat))
stop("msdata object should have a \"trans\" attribute")
K <- nrow(tmat)
if (any(is.na(match(h, 1:K))))
stop("h should be subset of 1:K with K number of states")
attr(msdata, "trans") <- tmat
xss <- xsect(msdata, s)
infrom <- xss[xss$state %in% h,id]
msdatas <- cutLMms(msdata, LM = s)
msdatasfrom <- msdatas[msdatas[,id] %in% infrom, ]
c0 <- coxph(Surv(Tstart, Tstop, status) ~ strata(trans),
data = msdatasfrom)
A0 <- msfit(c0, trans = tmat, variance=FALSE)
if(weighted==TRUE){
c0 <- coxph(Surv(Tstart, Tstop, status) ~ strata(trans),
weights=(1/clust.size), data = msdatasfrom)
A.wt <- basehaz(c0, centered=FALSE)
A.wt$strata <- as.numeric(A.wt$strata)
for(trn in sort(unique(A.wt$strata))){
fun <- stepfun(A.wt[A.wt$strata==trn,"time"],
c(0,A.wt[A.wt$strata==trn,"hazard"]))
A0$Haz[A0$Haz$trans==trn,"Haz"] <- fun(A0$Haz[A0$Haz$trans==trn,"time"])
}
}
pt0 <- probtrans(A0, predt = s, variance=FALSE)[[h]][,c("time",
paste("pstate", j, sep=""))]
return(pt0)
}
patp <- function(data, tmat, cid, id, h, j, s=0, weighted=FALSE,
LMAJ=FALSE, B=10000, cband=FALSE){
check.ic <- aggregate(data[,cid], by=list(data[,id]),
FUN=sd, na.rm=TRUE)$x
check.ic <- check.ic[!is.na(check.ic)]
if(length(check.ic)>0){
if(max(check.ic)>0){
stop("Same unit(s) in more than 1 cluster (violation of the independent clusters assumption)")
}
}
if(B<=0 & cband==TRUE){
stop("Condidence bands cannot be caclulated based on <=0 bootstrap samples")
} else if (B<1000 & cband==TRUE){
warning("It is recommended to use at least 1000 bootstrap samples for confidence band calculation")
}
if(LMAJ==FALSE){
c0 <- coxph(Surv(Tstart, Tstop, status) ~ strata(trans), data=data,
method = "breslow")
A0 <- msfit(object = c0, trans = tmat, variance=FALSE)
if(weighted==TRUE){
## msfit does not currently support weights and thus
## the weighted by cluster size cumulative transition
## intensities need to be manually inserted into A0
M0 <- aggregate(rep(1,times=nrow(data)),
by = list( data[,cid], data[,id]),
FUN = mean)
M <- aggregate(M0$x,
by = list( M0$Group.1),
FUN = sum)
colnames(M) <- c(cid, "clust.size")
data <- merge(data, M, by=cid)
data <- data[order(data[,cid],data[,id]),]
class(data) <- c("msdata", "data.frame")
c0 <- coxph(Surv(Tstart, Tstop, status) ~ strata(trans),
weights=(1/clust.size), data=data,
method = "breslow")
A.wt <- basehaz(c0, centered=FALSE)
A.wt$strata <- as.numeric(A.wt$strata)
for(trn in sort(unique(A.wt$strata))){
fun <- stepfun(A.wt[A.wt$strata==trn,"time"],
c(0,A.wt[A.wt$strata==trn,"hazard"]))
A0$Haz[A0$Haz$trans==trn,"Haz"] <- fun(A0$Haz[A0$Haz$trans==trn,"time"])
}
}
P0 <- probtrans(A0, predt = s,
variance=FALSE)[[h]][,c("time",
paste("pstate", j, sep=""))]
} else {
if(weighted==TRUE){
M0 <- aggregate(rep(1,times=nrow(data)),
by = list( data[,cid], data[,id]),
FUN = mean)
M <- aggregate(M0$x,
by = list( M0$Group.1),
FUN = sum)
colnames(M) <- c(cid, "clust.size")
data <- merge(data, M, by=cid)
data <- data[order(data[,cid],data[,id]),]
class(data) <- c("msdata", "data.frame")
}
P0 <- LMAJ2(msdata=data, tmat=tmat, id=id, s=s, h=h, j=j, weighted=weighted)
}
colnames(P0) <- c("time", paste("P", h, j, sep=""))
if(B==0){
return(P0)
} else {
n <- length(unique(data[,cid]))
boot <- msboot(patp_b, data=data,
id=cid, B=B, verbose=0,
tmat=tmat, id2=id, h=h, j=j, s=s, times=P0$time,
wiaj_hat=P0[,paste("P", h, j, sep="")],
n=n, weighted=weighted, LMAJ=LMAJ)
sigma <- apply(boot, 1, sd)
se <- sigma/sqrt(n)
## cloglog transformation
ll <- exp(-exp(log(-log(P0[,paste("P", h, j, sep="")]))-qnorm(0.975)*se/
(P0[,paste("P", h, j, sep="")]*
log(P0[,paste("P", h, j, sep="")]))))
ul <- exp(-exp(log(-log(P0[,paste("P", h, j, sep="")]))+qnorm(0.975)*se/
(P0[,paste("P", h, j, sep="")]*
log(P0[,paste("P", h, j, sep="")]))))
res <- cbind(P0, se, ll, ul)
if(cband==TRUE){
q_t <- 1/(1+sigma^2)
jump.times <- P0$time[diff(c(P0[1,paste("P", h, j, sep="")],
P0[,paste("P", h, j, sep="")]), lag=1)!=0]
quant <- quantile(jump.times, probs=c(.05,.95))
range <- (P0$time>=quant[1] & P0$time<=quant[2] &
P0[,paste("P", h, j, sep="")]>0)
B_t <- q_t[range]*boot[range,]/(log(P0[range, paste("P", h, j, sep="")])*
P0[range, paste("P", h, j, sep="")])
B_t <- abs(B_t)
c_a <- apply(B_t, 2, max)
c_a <- quantile(c_a, probs=0.95)
## cloglog transformation
ll.band <- exp(-exp(log(-log(P0[,paste("P", h, j, sep="")]))+c_a/(sqrt(n)*q_t)))
ll.band[!range] <- NA
ul.band <- exp(-exp(log(-log(P0[,paste("P", h, j, sep="")]))-c_a/(sqrt(n)*q_t)))
ul.band[!range] <- NA
res <- cbind(res, ll.band, ul.band)
}
return(res)
}
}
patp_b <- function(data, tmat, id2, h, j, s, times, wiaj_hat, n, weighted, LMAJ){
if(LMAJ==FALSE){
c0 <- coxph(Surv(Tstart, Tstop, status) ~ strata(trans), data=data,
method = "breslow")
A0 <- msfit(object = c0, trans = tmat, variance=FALSE)
if(weighted==TRUE){
c0 <- coxph(Surv(Tstart, Tstop, status) ~ strata(trans),
weights=(1/clust.size), data=data,
method = "breslow")
A.wt <- basehaz(c0, centered=FALSE)
A.wt$strata <- as.numeric(A.wt$strata)
for(trn in sort(unique(A.wt$strata))){
fun <- stepfun(A.wt[A.wt$strata==trn,"time"],
c(0,A.wt[A.wt$strata==trn,"hazard"]))
A0$Haz[A0$Haz$trans==trn,"Haz"] <- fun(A0$Haz[A0$Haz$trans==trn,"time"])
}
}
P0 <- probtrans(A0, predt = s,
variance=FALSE)[[h]][,c("time",
paste("pstate", j, sep=""))]
} else {
P0 <- LMAJ2(msdata=data, tmat=tmat, id=id2, s=s, h=h, j=j, weighted=weighted)
}
P0_t <-stepfun(P0$time, c(P0[1,paste("pstate", j, sep="")],
P0[,paste("pstate", j, sep="")]))
return(sqrt(n)*(P0_t(times)-wiaj_hat))
}
patp_test <- function(data, tmat, cid, id, group, h, j, s=0,
weighted=FALSE, LMAJ=FALSE, B=1000){
check.ic <- aggregate(data[,cid], by=list(data[,id]),
FUN=sd, na.rm=TRUE)$x
check.ic <- check.ic[!is.na(check.ic)]
if(length(check.ic)>0){
if(max(check.ic)>0){
stop("Same unit(s) in more than 1 cluster (violation of the independent clusters assumption)")
}
}
if(B<=0){
stop("Tests cannot be performed based on <=0 bootstrap samples")
} else if (B<1000){
warning("It is recommended to use at least 1000 bootstrap samples for two-sample testing")
}
n <- length(unique(data[,cid]))
groups <- unique(data[,group])
groups <- sort(groups[!is.na(groups)])
if(length(groups)!=2){
stop("Number of groups != 2")
}
if(weighted==TRUE){
M0 <- aggregate(rep(1,times=nrow(data)),
by = list(data[,cid],
data[,group],
data[,id]),
FUN = mean)
M <- aggregate(M0$x,
by = list(M0$Group.1, M0$Group.2),
FUN = sum)
colnames(M) <- c(cid, group, "clust.size")
data <- merge(data, M, by=c(cid,group))
data <- data[order(data[,cid],data[,id]),]
class(data) <- c("msdata", "data.frame")
}
Pt <- list()
tms <- list()
for(g in groups){
if(LMAJ==FALSE){
c0 <- coxph(Surv(Tstart, Tstop, status) ~ strata(trans),
data=data[data[,group]==g,], method = "breslow")
A0 <- msfit(object = c0, trans = tmat, variance=FALSE)
if(weighted==TRUE){
c0 <- coxph(Surv(Tstart, Tstop, status) ~ strata(trans),
weights=(1/clust.size), data=data[data[,group]==g,],
method = "breslow")
A.wt <- basehaz(c0, centered=FALSE)
A.wt$strata <- as.numeric(A.wt$strata)
for(trn in sort(unique(A.wt$strata))){
fun <- stepfun(A.wt[A.wt$strata==trn,"time"],
c(0,A.wt[A.wt$strata==trn,"hazard"]))
A0$Haz[A0$Haz$trans==trn,"Haz"] <- fun(A0$Haz[A0$Haz$trans==trn,"time"])
}
}
P0 <- probtrans(A0, predt = s, variance=FALSE)[[h]][,c("time",
paste("pstate", j, sep=""))]
} else {
P0 <- LMAJ2(msdata=data[data[,group]==g,], tmat=tmat,
id=id, s=s, h=h, j=j, weighted=weighted)
}
if(length(Pt)==0){
Pt[[1]] <- stepfun(P0$time, c(P0[1,paste("pstate", j, sep="")],
P0[,paste("pstate", j, sep="")]))
tms[[1]] <- P0$time[diff(c(P0[1,paste("pstate", j, sep="")],
P0[,paste("pstate", j, sep="")]), lag=1)!=0]
} else {
Pt[[2]] <- stepfun(P0$time, c(P0[1,paste("pstate", j, sep="")],
P0[,paste("pstate", j, sep="")]))
tms[[2]] <- P0$time[diff(c(P0[1,paste("pstate", j, sep="")],
P0[,paste("pstate", j, sep="")]), lag=1)!=0]
}
}
tms <- sort(unique(c(tms[[1]], tms[[2]])))
if(nrow(data[data$from==j,])>0){
tS <- sort(unique(c(data[data$to==j,"from"],j)))
} else {
tS <- sort(unique(data[data$to==j,"from"]))
}
EY <- NULL
EY.t <- function(t,dt){
sum(dt$Tstart<t & dt$Tstop>=t)/n
}
for(i in tS){
for(g in groups){
dat <- unique(data[data$from==i & data[,group]==g,
c(id, "from", "Tstart", "Tstop")])
if(is.null(EY)){
EY <- sapply(tms, EY.t, dt=dat)
} else {
EY <- cbind(EY, sapply(tms, EY.t, dt=dat))
}
}
}
Wt <- rowprods(EY)/rowSums(EY)
tms <- tms[!is.na(Wt)]
if(length(tms)==0 | max(Wt, na.rm=TRUE)==0){
stop("Weights NA or 0 for all timepoints")
}
Wt <- Wt[!is.na(Wt)]
D_hat=(Pt[[1]](tms) - Pt[[2]](tms))
Diff_boot <- msboot(patp_test_b, data=data,
id=cid, B=B, verbose=0,
tmat=tmat, id2=id, group=group, h=h, j=j, s=s,
times=tms, D_hat=D_hat, Wt=Wt,
n=n, weighted=weighted, LMAJ=LMAJ)
#2022
return_patp_test <- list()
return_patp_test$diff_boot <-Diff_boot
KS <- max(abs(sqrt(n)*Wt*D_hat))
return_patp_test$KS<-KS
KS.b <- apply(abs(Diff_boot),2,max)
return_patp_test$KS_b<-KS.b
pval <- mean(KS.b >= KS)
names(pval) <- "p-value"
return_patp_test$pval<-pval
return(return_patp_test)
}
patp_test_b <- function(data, tmat, id2, h, j, s, group, times, D_hat,
Wt, n, weighted, LMAJ){
groups <- unique(data[,group])
groups <- sort(groups[!is.na(groups)])
Pt <- list()
for(g in groups){
if(LMAJ==FALSE){
c0 <- coxph(Surv(Tstart, Tstop, status) ~ strata(trans),
data=data[data[,group]==g,], method = "breslow")
A0 <- msfit(object = c0, trans = tmat, variance=FALSE)
if(weighted==TRUE){
c0 <- coxph(Surv(Tstart, Tstop, status) ~ strata(trans),
weights=(1/clust.size), data=data[data[,group]==g,],
method = "breslow")
A.wt <- basehaz(c0, centered=FALSE)
A.wt$strata <- as.numeric(A.wt$strata)
for(trn in sort(unique(A.wt$strata))){
fun <- stepfun(A.wt[A.wt$strata==trn,"time"],
c(0,A.wt[A.wt$strata==trn,"hazard"]))
A0$Haz[A0$Haz$trans==trn,"Haz"] <- fun(A0$Haz[A0$Haz$trans==trn,"time"])
}
}
P0 <- probtrans(A0, predt = s, variance=FALSE)[[h]][,c("time",
paste("pstate", j, sep=""))]
} else {
P0 <- LMAJ2(msdata=data[data[,group]==g,], tmat=tmat,
id=id2, s=s, h=h, j=j, weighted=weighted)
}
if(length(Pt)==0){
Pt[[1]] <- stepfun(P0$time, c(P0[1,paste("pstate", j, sep="")],
P0[,paste("pstate", j, sep="")]))
} else {
Pt[[2]] <- stepfun(P0$time, c(P0[1,paste("pstate", j, sep="")],
P0[,paste("pstate", j, sep="")]))
}
}
D_boot <- Pt[[1]](times) - Pt[[2]](times)
return(sqrt(n)*Wt*(D_boot-D_hat))
}
#data: a data.frame in the long format required by the mstate package.
#tmat: a matrix of possible transitions between states of the process where different transitions are identified by a different integer. If a direct transition between two states is not possible it is indicated as NA. This matrix can be obtained via the mstate function transMat().
#cid: variable name that identifies the clusters.
#id: variable name that identifies the individual observations.
#h: the state h in Pr(X(t) = j| X(s) = h).
#j: the state j in Pr(X(t) = j| X(s) = h).
#s: the time s in Pr(X(t) = j| X(s) = h). The default value is 0.
#weighted: logical value. If TRUE, the estimator is weighted by the inverse of the cluster sizes. This is useful when cluster size is random and expected to be informative. The default value is FALSE.
#LMAJ: logical value. If TRUE, the landmark version of the estimator is returned. This is useful when s>0 and the Markov assumption is not plausible. The default value is FALSE.
#B: number of nonparametric cluster bootstrap replications. If B=0, no standard errors or confidence intervals/bands are returned. The default value is 100.
#cband: logical value. If TRUE, the limits of the 95% simultaneous confidence band are returned. The default value is FALSE.
#https://github.com/gbakoyannis/clustered-multistate/tree/master/R
ms_d_match_surv$cid<-
as.numeric(unlist(ms_d_match_surv %>% dplyr::mutate(id=as.numeric(id)) %>% #119356
dplyr::left_join(d_match_surv_msprep[,c("id","group_match")], by="id") %>% select(group_match)))#119356
time_before_LMAJ4<-Sys.time()
LMAJ_mods4 <-list()
lmaj_mods_pars4a<-expand.grid(s=c(90,365, 1096, 1826), trans=c("1_2","2_3","3_4","4_5")) %>%
tidyr::separate(trans, into=c("from","to"),sep="_")
for (i in 1:nrow(lmaj_mods_pars4b)) {
h<-as.numeric(lmaj_mods_pars4a[i, "from"])
j<-as.numeric(lmaj_mods_pars4a[i, "to"])
s<-as.numeric(lmaj_mods_pars4a[i, "s"])
set.seed(2125)
LMAJ_mods4[[i]] <- try(patp(data=ms_d_match_surv,
tmat=trans_matrix,
cid="cid",
id="id",
h=h,
j=j,
s=s,
B=n_iter/1e2,
LMAJ=T,
cband=T))
names(LMAJ_mods4)[[i]] <- paste0("P",h,j,"_",s)
}
## Error in nrow(lmaj_mods_pars4b): objeto 'lmaj_mods_pars4b' no encontrado
time_after_LMAJ4<-Sys.time()
ms_d_match_surv_oct_2022$cid<-
as.numeric(unlist(ms_d_match_surv_oct_2022 %>% dplyr::mutate(id=as.numeric(id)) %>% #119356
dplyr::left_join(d_match_surv_msprep_oct_2022[,c("id","group_match")], by="id") %>% select(group_match)))#119356
time_before_LMAJ42<-Sys.time()
LMAJ_mods4b <-list()
lmaj_mods_pars4b<-expand.grid(s=c(90,365, 1096, 1826), trans=c("1_2","1_3","2_4","3_5","5_7","6_8")) %>%
tidyr::separate(trans, into=c("from","to"),sep="_")
for (i in 1:nrow(lmaj_mods_pars4b)) {
h<-as.numeric(lmaj_mods_pars4b[i, "from"])
j<-as.numeric(lmaj_mods_pars4b[i, "to"])
s<-as.numeric(lmaj_mods_pars4b[i, "s"])
set.seed(2125)
LMAJ_mods4b[[i]] <- try(patp(data=ms_d_match_surv_oct_2022,
tmat=trans_matrix2,
cid="cid",
id="id",
h=h,
j=j,
s=s,
B=n_iter/1e2,
LMAJ=T,
cband=T))
names(LMAJ_mods4b)[[i]] <- paste0("P",h,j,"_",s)
}
## Warning in patp(data = ms_d_match_surv_oct_2022, tmat = trans_matrix2, cid =
## "cid", : It is recommended to use at least 1000 bootstrap samples for confidence
## band calculation
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in patp(data = ms_d_match_surv_oct_2022, tmat = trans_matrix2, cid =
## "cid", : It is recommended to use at least 1000 bootstrap samples for confidence
## band calculation
## Warning in patp(data = ms_d_match_surv_oct_2022, tmat = trans_matrix2, cid =
## "cid", : It is recommended to use at least 1000 bootstrap samples for confidence
## band calculation
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in patp(data = ms_d_match_surv_oct_2022, tmat = trans_matrix2, cid =
## "cid", : It is recommended to use at least 1000 bootstrap samples for confidence
## band calculation
## Warning in max(sf0$trans): ningun argumento finito para max; retornando -Inf
## Error in rep(allt, K) : argumento 'times' inválido
## Warning in patp(data = ms_d_match_surv_oct_2022, tmat = trans_matrix2, cid =
## "cid", : It is recommended to use at least 1000 bootstrap samples for confidence
## band calculation
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in patp(data = ms_d_match_surv_oct_2022, tmat = trans_matrix2, cid =
## "cid", : It is recommended to use at least 1000 bootstrap samples for confidence
## band calculation
## Warning in patp(data = ms_d_match_surv_oct_2022, tmat = trans_matrix2, cid =
## "cid", : It is recommended to use at least 1000 bootstrap samples for confidence
## band calculation
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in patp(data = ms_d_match_surv_oct_2022, tmat = trans_matrix2, cid =
## "cid", : It is recommended to use at least 1000 bootstrap samples for confidence
## band calculation
## Warning in max(sf0$trans): ningun argumento finito para max; retornando -Inf
## Error in rep(allt, K) : argumento 'times' inválido
## Warning in patp(data = ms_d_match_surv_oct_2022, tmat = trans_matrix2, cid =
## "cid", : It is recommended to use at least 1000 bootstrap samples for confidence
## band calculation
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in patp(data = ms_d_match_surv_oct_2022, tmat = trans_matrix2, cid =
## "cid", : It is recommended to use at least 1000 bootstrap samples for confidence
## band calculation
## Warning in patp(data = ms_d_match_surv_oct_2022, tmat = trans_matrix2, cid =
## "cid", : It is recommended to use at least 1000 bootstrap samples for confidence
## band calculation
## Warning in patp(data = ms_d_match_surv_oct_2022, tmat = trans_matrix2, cid =
## "cid", : It is recommended to use at least 1000 bootstrap samples for confidence
## band calculation
## Warning in patp(data = ms_d_match_surv_oct_2022, tmat = trans_matrix2, cid =
## "cid", : It is recommended to use at least 1000 bootstrap samples for confidence
## band calculation
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in patp(data = ms_d_match_surv_oct_2022, tmat = trans_matrix2, cid =
## "cid", : It is recommended to use at least 1000 bootstrap samples for confidence
## band calculation
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in patp(data = ms_d_match_surv_oct_2022, tmat = trans_matrix2, cid =
## "cid", : It is recommended to use at least 1000 bootstrap samples for confidence
## band calculation
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in patp(data = ms_d_match_surv_oct_2022, tmat = trans_matrix2, cid =
## "cid", : It is recommended to use at least 1000 bootstrap samples for confidence
## band calculation
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in patp(data = ms_d_match_surv_oct_2022, tmat = trans_matrix2, cid =
## "cid", : It is recommended to use at least 1000 bootstrap samples for confidence
## band calculation
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in patp(data = ms_d_match_surv_oct_2022, tmat = trans_matrix2, cid =
## "cid", : It is recommended to use at least 1000 bootstrap samples for confidence
## band calculation
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in patp(data = ms_d_match_surv_oct_2022, tmat = trans_matrix2, cid =
## "cid", : It is recommended to use at least 1000 bootstrap samples for confidence
## band calculation
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in patp(data = ms_d_match_surv_oct_2022, tmat = trans_matrix2, cid =
## "cid", : It is recommended to use at least 1000 bootstrap samples for confidence
## band calculation
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in FUN(newX[, i], ...): ningun argumento finito para max; retornando -
## Inf
## Warning in patp(data = ms_d_match_surv_oct_2022, tmat = trans_matrix2, cid =
## "cid", : It is recommended to use at least 1000 bootstrap samples for confidence
## band calculation
## Warning in max(event[who2]): ningun argumento finito para max; retornando -Inf
## Error in coxph(Surv(Tstart, Tstop, status) ~ strata(trans), data = msdatasfrom) :
## No (non-missing) observations
## Warning in patp(data = ms_d_match_surv_oct_2022, tmat = trans_matrix2, cid =
## "cid", : It is recommended to use at least 1000 bootstrap samples for confidence
## band calculation
## Error in data.frame(time = sf0$time, Haz = -log(sf0$surv), norisk = norisk, :
## arguments imply differing number of rows: 2, 0
## Warning in patp(data = ms_d_match_surv_oct_2022, tmat = trans_matrix2, cid =
## "cid", : It is recommended to use at least 1000 bootstrap samples for confidence
## band calculation
## Error in data.frame(time = sf0$time, Haz = -log(sf0$surv), norisk = norisk, :
## arguments imply differing number of rows: 26, 0
## Warning in patp(data = ms_d_match_surv_oct_2022, tmat = trans_matrix2, cid =
## "cid", : It is recommended to use at least 1000 bootstrap samples for confidence
## band calculation
## Error in data.frame(time = sf0$time, Haz = -log(sf0$surv), norisk = norisk, :
## arguments imply differing number of rows: 43, 0
time_after_LMAJ42<-Sys.time()
lmaj_mods_pars5a<-expand.grid(s=c(90,365, 1096, 1826), trans=c("1_2","2_3","3_4","4_5")) %>%
tidyr::separate(trans, into=c("from","to"),sep="_")
time_before_LMAJ5<-Sys.time()
LMAJ_mods5 <-list()
for (i in 1:nrow(lmaj_mods_pars5a)) {
h<-as.numeric(lmaj_mods_pars5a[i, "from"])
j<-as.numeric(lmaj_mods_pars5a[i, "to"])
s<-as.numeric(lmaj_mods_pars5a[i, "s"])
set.seed(2125)
LMAJ_mods5[[i]] <- tryCatch({
patp_test(data=ms_d_match_surv, tmat=trans_matrix, cid="cid", id="id", group="tipo_de_plan_res_1",
h=h, j=j, s=s, B=n_iter/1e2, LMAJ=T)},
error=function(error_message){warning(paste0("Error"));print("");message(error_message)})
names(LMAJ_mods5)[[i]] <- paste0("P",h,j,"_",s)
}
## Warning in patp_test(data = ms_d_match_surv, tmat = trans_matrix, cid = "cid", :
## It is recommended to use at least 1000 bootstrap samples for two-sample testing
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in patp_test(data = ms_d_match_surv, tmat = trans_matrix, cid = "cid", :
## It is recommended to use at least 1000 bootstrap samples for two-sample testing
## Warning in patp_test(data = ms_d_match_surv, tmat = trans_matrix, cid = "cid", :
## It is recommended to use at least 1000 bootstrap samples for two-sample testing
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in patp_test(data = ms_d_match_surv, tmat = trans_matrix, cid = "cid", :
## It is recommended to use at least 1000 bootstrap samples for two-sample testing
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in patp_test(data = ms_d_match_surv, tmat = trans_matrix, cid = "cid", :
## It is recommended to use at least 1000 bootstrap samples for two-sample testing
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in patp_test(data = ms_d_match_surv, tmat = trans_matrix, cid = "cid", :
## It is recommended to use at least 1000 bootstrap samples for two-sample testing
## Warning in patp_test(data = ms_d_match_surv, tmat = trans_matrix, cid = "cid", :
## It is recommended to use at least 1000 bootstrap samples for two-sample testing
## Warning in patp_test(data = ms_d_match_surv, tmat = trans_matrix, cid = "cid", :
## It is recommended to use at least 1000 bootstrap samples for two-sample testing
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in patp_test(data = ms_d_match_surv, tmat = trans_matrix, cid = "cid", :
## It is recommended to use at least 1000 bootstrap samples for two-sample testing
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in value[[3L]](cond): Error
## [1] ""
## Error in rowprods(EY): Not compatible with requested type: [type=list; target=double].
time_after_LMAJ5<-Sys.time()
lmaj_mods_pars5b<-expand.grid(s=c(90,365, 1096, 1826), trans=c("1_2","1_3","2_4","3_5","5_7","6_8")) %>%
tidyr::separate(trans, into=c("from","to"),sep="_")
time_before_LMAJ5b<-Sys.time()
LMAJ_mods5b <-list()
for (i in 1:nrow(lmaj_mods_pars5b)) {
h<-as.numeric(lmaj_mods_pars5b[i, "from"])
j<-as.numeric(lmaj_mods_pars5b[i, "to"])
s<-as.numeric(lmaj_mods_pars5b[i, "s"])
set.seed(2125)
LMAJ_mods5b[[i]] <- tryCatch({
patp_test(data=ms_d_match_surv_oct_2022, tmat=trans_matrix2, cid="cid", id="id", group="tipo_de_plan_res_1",
h=h, j=j, s=s, B=n_iter/1e2, LMAJ=T)},
error=function(error_message){warning(paste0("Error"));print("");message(error_message)})
names(LMAJ_mods5b)[[i]] <- paste0("P",h,j,"_",s)
}
## Warning in patp_test(data = ms_d_match_surv_oct_2022, tmat = trans_matrix2, : It
## is recommended to use at least 1000 bootstrap samples for two-sample testing
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in patp_test(data = ms_d_match_surv_oct_2022, tmat = trans_matrix2, : It
## is recommended to use at least 1000 bootstrap samples for two-sample testing
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in patp_test(data = ms_d_match_surv_oct_2022, tmat = trans_matrix2, : It
## is recommended to use at least 1000 bootstrap samples for two-sample testing
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in min(diff(time)): ningún argumento finito para min; retornando Inf
## Warning in max(x[!is.na(x)]): ningun argumento finito para max; retornando -Inf
## Warning in probtrans(A0, predt = s, variance = FALSE): Warning! Negative diagonal elements of (I+dA); the estimate may not be meaningful.
## Warning in max(sf0$trans): ningun argumento finito para max; retornando -Inf
## Warning in value[[3L]](cond): Error
## [1] ""
## Error in rep(allt, K): argumento 'times' inválido
time_after_LMAJ5b<-Sys.time()
bind_rows(cbind.data.frame(p=LMAJ_mods5$P12_90$diff_boot,at=rep(90,),t=rep(12,)),
cbind.data.frame(p=LMAJ_mods5$P12_365$diff_boot,at=rep(365,),t=rep(12,)),
cbind.data.frame(p=LMAJ_mods5$P12_1096$diff_boot,at=rep(1095,),t=rep(12,)),
cbind.data.frame(p=LMAJ_mods5$P12_1826$diff_boot,at=rep(1826,),t=rep(12,)),
cbind.data.frame(p=LMAJ_mods5$P23_90$diff_boot,at=rep(90,),t=rep(23,)),
cbind.data.frame(p=LMAJ_mods5$P23_365$diff_boot,at=rep(365,),t=rep(23,)),
cbind.data.frame(p=LMAJ_mods5$P23_1096$diff_boot,at=rep(1095,),t=rep(23,)),
cbind.data.frame(p=LMAJ_mods5$P23_1826$diff_boot,at=rep(1826,),t=rep(23,)),
) %>%
reshape2::melt(id.vars=c("at","t")) %>%
dplyr::select(-variable) %>%
dplyr::mutate(time=dplyr::row_number()) %>%
dplyr::mutate(at=factor(at,levels = c(90,365,1095,1826), labels=c("90 days", "1 year","3 years", "5 years"))) %>%
dplyr::mutate(l95ci=dplyr::case_when(se<.1 & Estimate==1~1,T~l95ci),
u95ci=dplyr::case_when(se<.1 & Estimate==1~1,T~u95ci)) %>%
ggplot(aes(time, value))+#,² color= setting, linetype =setting, fill=setting
geom_step(size=1, alpha=.65) +
geom_ribbon(aes(ymin=ll.band, ymax=ul.band), alpha=.5)+
facet_wrap(t~at, ncol=5, scales="free_y") + #
scale_y_continuous(labels = scales::percent_format(accuracy = .1), limits=c(0,.25))+
#facet_wrap(state~., ncol=1, scales="free_y") + #type_of_program
#scale_color_manual(name= "Type of\nprogram",values=c("gray65","gray35"), labels=c("Ambulatory","Residential")) +
#scale_fill_manual(name= "Type of\nprogram",values=c("gray65","gray35"), labels=c("Ambulatory","Residential")) +
#scale_linetype_manual(name= "Type of\nprogram",values=c(1,4), labels=c("Ambulatory","Residential")) +
scale_x_continuous(breaks=seq(0,max(c(msf0$Haz$time,msf1$Haz$time),na.rm=T),by=max(c(msf0$Haz$time,msf1$Haz$time),na.rm=T)/11),
label=0:11)+
xlab("Years") +
ylab("") +
theme_minimal()
Sys.getenv("R_LIBS_USER")
## [1] "C:/Users/andre/Documents/R/win-library/4.0"
rstudioapi::getSourceEditorContext()$path
## [1] "E:/Mi unidad/Alvacast/SISTRAT 2019 (github)/SUD_CL/Matching_Process2_SEP_22.Rmd"
if (grepl("CISS Fondecyt",rstudioapi::getSourceEditorContext()$path)==T){
save.image("C:/Users/CISS Fondecyt/Mi unidad/Alvacast/SISTRAT 2019 (github)/mult_state_2_apr22.RData")
} else if (grepl("andre",rstudioapi::getSourceEditorContext()$path)==T){
save.image("C:/Users/andre/Desktop/SUD_CL/mult_state_2_apr22.RData")
} else if (grepl("E:",rstudioapi::getSourceEditorContext()$path)==T){
save.image("E:/Mi unidad/Alvacast/SISTRAT 2019 (github)/mult_state_2_apr22.RData")
} else if (grepl("G:",rstudioapi::getSourceEditorContext()$path)==T){
save.image("G:/Mi unidad/Alvacast/SISTRAT 2019 (github)/mult_state_2_apr22.RData")
} else {
save.image("~/mult_state_2_apr22.RData")
path.expand("~/mult_state_2_apr22.RData")
}
sessionInfo()
## R version 4.0.2 (2020-06-22)
## Platform: x86_64-w64-mingw32/x64 (64-bit)
## Running under: Windows 10 x64 (build 19042)
##
## Matrix products: default
##
## locale:
## [1] LC_COLLATE=Spanish_Chile.1252 LC_CTYPE=Spanish_Chile.1252
## [3] LC_MONETARY=Spanish_Chile.1252 LC_NUMERIC=C
## [5] LC_TIME=Spanish_Chile.1252
##
## attached base packages:
## [1] grid stats graphics grDevices utils datasets methods
## [8] base
##
## other attached packages:
## [1] Rfast_2.0.3 RcppZiggurat_0.1.6 Metrics_0.1.4 muhaz_1.2.6.1
## [5] flexsurv_2.0 mstate_0.3.1 DiagrammeR_1.0.6.1 Amelia_1.7.6
## [9] Rcpp_1.0.8.3 igraph_1.2.6 eha_2.8.5 cobalt_4.3.1
## [13] MatchIt_4.1.0 tableone_0.12.0 stargazer_5.2.2 reshape2_1.4.4
## [17] gridExtra_2.3 foreign_0.8-80 survMisc_0.5.5 ggfortify_0.4.11
## [21] survminer_0.4.9 ggpubr_0.4.0 epiR_2.0.19 forcats_0.5.1
## [25] purrr_0.3.4 readr_2.1.2 tibble_3.0.6 tidyverse_1.3.1
## [29] dplyr_1.0.6 treemapify_2.5.5 sf_0.9-7 ggiraph_0.7.10
## [33] finalfit_1.0.3 lsmeans_2.30-0 emmeans_1.5.4 RColorBrewer_1.1-2
## [37] panelr_0.7.5 lme4_1.1-26 Matrix_1.2-18 data.table_1.14.0
## [41] codebook_0.9.2 devtools_2.4.3 usethis_2.1.6 sqldf_0.4-11
## [45] RSQLite_2.2.3 gsubfn_0.7 proto_1.0.0 broom_0.7.7
## [49] zoo_1.8-8 rbokeh_0.5.1 janitor_2.1.0 plotly_4.10.0
## [53] kableExtra_1.3.1 Hmisc_4.5-0 Formula_1.2-4 survival_3.1-12
## [57] lattice_0.20-41 ggplot2_3.3.6 stringr_1.4.0 stringi_1.5.3
## [61] tidyr_1.1.3 knitr_1.39 matrixStats_0.58.0 boot_1.3-25
##
## loaded via a namespace (and not attached):
## [1] utf8_1.2.1 tidyselect_1.1.2 htmlwidgets_1.5.3
## [4] jtools_2.1.3 munsell_0.5.0 codetools_0.2-16
## [7] units_0.7-0 chron_2.3-56 statmod_1.4.35
## [10] withr_2.5.0 colorspace_2.0-0 highr_0.8
## [13] uuid_0.1-4 rstudioapi_0.13 ggsignif_0.6.0
## [16] labeling_0.4.2 KMsurv_0.1-5 farver_2.0.3
## [19] bit64_4.0.5 rprojroot_2.0.2 coda_0.19-4
## [22] vctrs_0.3.8 generics_0.1.0 TH.data_1.0-10
## [25] xfun_0.31 R6_2.5.0 cachem_1.0.3
## [28] assertthat_0.2.1 scales_1.1.1 multcomp_1.4-17
## [31] nnet_7.3-14 gtable_0.3.0 processx_3.7.0
## [34] sandwich_3.0-0 rlang_1.0.2 systemfonts_1.0.4
## [37] splines_4.0.2 rstatix_0.6.0 lazyeval_0.2.2
## [40] hexbin_1.28.2 checkmate_2.0.0 yaml_2.2.1
## [43] abind_1.4-5 modelr_0.1.8 backports_1.2.1
## [46] tools_4.0.2 tcltk_4.0.2 ellipsis_0.3.2
## [49] jquerylib_0.1.3 sessioninfo_1.2.2 plyr_1.8.6
## [52] visNetwork_2.0.9 base64enc_0.1-3 BiasedUrn_1.07
## [55] classInt_0.4-3 ps_1.5.0 prettyunits_1.1.1
## [58] rpart_4.1-15 cowplot_1.1.1 deSolve_1.28
## [61] haven_2.5.0 cluster_2.1.0 survey_4.0
## [64] fs_1.5.2 crul_1.0.0 magrittr_2.0.3
## [67] openxlsx_4.2.3 reprex_2.0.1 mvtnorm_1.1-1
## [70] pkgload_1.2.4 hms_1.1.1 evaluate_0.15
## [73] xtable_1.8-4 rio_0.5.16 jpeg_0.1-8.1
## [76] readxl_1.3.1 testthat_3.1.5 compiler_4.0.2
## [79] mice_3.13.0 maps_3.3.0 KernSmooth_2.23-17
## [82] crayon_1.5.1 minqa_1.2.4 htmltools_0.5.2
## [85] tzdb_0.3.0 lubridate_1.8.0 DBI_1.1.1
## [88] dbplyr_2.1.1 MASS_7.3-51.6 car_3.0-10
## [91] mitools_2.4 brio_1.1.1 cli_3.3.0
## [94] pryr_0.1.4 quadprog_1.5-8 parallel_4.0.2
## [97] pkgconfig_2.0.3 km.ci_0.5-2 numDeriv_2016.8-1.1
## [100] xml2_1.3.2 bslib_0.3.1 ggcorrplot_0.1.3
## [103] webshot_0.5.2 estimability_1.3 rvest_1.0.2
## [106] snakecase_0.11.0 callr_3.7.2 digest_0.6.27
## [109] httpcode_0.3.0 rmarkdown_2.14 cellranger_1.1.0
## [112] htmlTable_2.1.0 curl_4.3.3 nloptr_1.2.2.2
## [115] lifecycle_1.0.1 nlme_3.1-148 jsonlite_1.7.2
## [118] carData_3.0-4 desc_1.4.1 viridisLite_0.4.0
## [121] fansi_0.4.2 labelled_2.7.0 pillar_1.7.0
## [124] fastmap_1.1.0 httr_1.4.4 pkgbuild_1.3.1
## [127] glue_1.6.2 remotes_2.4.2 zip_2.1.1
## [130] png_0.1-7 pander_0.6.3 bit_4.0.4
## [133] class_7.3-17 sass_0.4.1 gistr_0.9.0
## [136] blob_1.2.1 ggfittext_0.9.1 latticeExtra_0.6-29
## [139] memoise_2.0.1 e1071_1.7-4
sesion_info <- devtools::session_info()
dplyr::select(
tibble::as_tibble(sesion_info$packages),
c(package, loadedversion, source)
) %>%
DT::datatable(filter = 'top', colnames = c('Row number' =1,'Variable' = 2, 'Percentage'= 3),
caption = htmltools::tags$caption(
style = 'caption-side: top; text-align: left;',
'', htmltools::em('Packages')),
options=list(
initComplete = htmlwidgets::JS(
"function(settings, json) {",
"$(this.api().tables().body()).css({'font-size': '80%'});",
"}")))