0

I'm conducting an experiment (during 10 days of observation) to compare four different topologys (refered as conditions) of ant nests named NTS, NTC, TS, and TC. I am aware that the death rate in my experiment is very low, but why is there a vertical line at the end of my survplot ? No tutorial on YouTube talk about this issue...

My data set contains 5 columns which are named : ID, Statut, Time, Condition and Colony. ID : the ID using to refer to an individual (not realevant here). Statut : 0 or 1, 0 is for dead and 1 for alive. Time : the day of the death and 10 if still alive at the end of the experiment. Condition : information on condition (NTS, NTC, TS and TC) Colony : from 1 to 6, just the label of the colony.

I dont know to share proprely my data, so here is a google drive link : https://drive.google.com/file/d/1QKAZof0dQw-K4uqmK2hnnPGzkAAcmXsA/view?usp=sharing

Here is my R script :

morta <- read.csv("mortalite.test.csv", head=TRUE, sep = ";")
morta$Statut <- as.integer(morta$Statut)
morta$Condition <- as.factor(morta$Condition)
morta$Time <- as.numeric(morta$Time)
table(morta$Statut)
table(morta$Time)
summary(morta)
head(morta)
complete_cases <- complete.cases(morta)
sum(complete_cases)  # Nombre d'observations complètes
sum(!complete_cases) # Nombre d'observations manquantes

surv_obj <- Surv(morta$Time, morta$Statut)
fit_km <- survfit(surv_obj ~ Condition, data = morta)
print(fit_km)
logrank_testCondition <- survdiff(surv_obj ~ Condition, data = morta)
logrank_testColony <- survdiff(surv_obj ~ Colony, data = morta)
print(logrank_testCondition)
print(logrank_testColony)

ggsurvplot(fit_km, data = morta,
           risk.table = TRUE, 
           pval=TRUE, 
           conf.int = FALSE)+
  labs(x = "Temps (en jour)", y = "Probabilité de survie")

And here is an image of :my survplot

Thanks in advance for your awsners

Something looking like that : enter image description here

data for morta:

structure(list(ID = 1:20, Statut = c(0L, 0L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), Time = c(4, 8, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10), Condition = structure(c(2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("NTC", "NTS", "TC", "TS"), class = "factor"), Colony = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L)), row.names = c(NA, 20L), class = "data.frame") 
Chris
  • 1,647
  • 1
  • 18
  • 25
lddc
  • 1
  • 2
  • It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input that can be used to test and verify possible solutions. There's likely something wrong with your data. – MrFlick Aug 31 '23 at 14:11
  • 2
    For data `dput(head(morta, n = 20))` and paste `structure(...)` above in your question. – Chris Aug 31 '23 at 14:19
  • @Chris here is the output : > dput(head(morta, n = 20)) structure(list(ID = 1:20, Statut = c(0L, 0L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), Time = c(4, 8, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10), Condition = structure(c(2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("NTC", "NTS", "TC", "TS"), class = "factor"), Colony = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L)), row.names = c(NA, 20L), class = "data.frame") – lddc Aug 31 '23 at 15:56

0 Answers0