Olá,

Estou tentanto construir curvas de Kaplan-Meiers estratificadas por grupos mas estou tendo um problema.

Meu database (chamado de Data), possui a varíavel tempo-ate-evento (TEMPOPPC), o evento (PPC), e os grupos (IMC, ARISCAT e TIPO). Estou usando a seguinte função: 

plot(survfit(Surv(as.numeric(Data$TEMPOPPC), is.logical(Data$PPC))~Data$IMC), ylab="Proportion of Patients", xlab="Follow-Up (Days)")

Entretanto, o R retorna o seguinte problema:

Erro em Surv(as.numeric(Data$TEMPOPPC), is.logical(Data$PPC)) : 
  Time and status are different lengths

Alguem sabe como resolver? Ainda, como consigo inserir o intervalo de confiança de 95% para cada curva?

Desde já agradeço,

Ary Serpa Neto, MD, MSc, PhD Hospital Israelita Albert Einstein, São Paulo, Brazil (http://www.einstein.br): Department of Critical Care Medicine & Jewish Institute of Education and Research Albert Einstein (http://www.einstein.br/pesquisa) The PROtective VEntilation NETwork (www.provenet.eu) http://publicationslist.org/a.serpa_neto http://lattes.cnpq.br/0254664157557375