Survival analysis is a statistical method used to analyze time-to-event data, such as time to death or time to failure. It is commonly used in fields such as medical research and engineering, where the goal is to understand the factors that influence the occurrence of a specific event.
For example, in pesticide research, survival analysis can be used to study the effects of pesticides on the survival of organisms. For example, researchers may use survival analysis to determine the effect of a pesticide on the survival of bees or other pollinators.
To perform survival analysis in R, the package “survival” can be used. This package provides a wide range of functions for fitting and analyzing survival data, including the popular Kaplan-Meier estimator for estimating survival probabilities.
The survdiff() function compares survivals between groups (e.g. female and male) using log-rank analysis (chi-squared) with the null hypothesis that the survival rate is the same between groups.