Draws the Kaplan-Meier plot and calculates the log-rank test (log rank test is only for two group).

The sample size is calculated from total events and censored events. If by the end of the research some subjects didn't have an event, please insert censored data for these subjects.

Please change "Time1" header to your time unit.

Please fill in **one row per subject**. Event/Censored - **1** for event or **0** for censored event.

You may copy data from Excel, Google sheets or any tool that separate data with **Tab** and **Line Feed**.

Copy the data,**one block of 3 consecutive columns includes the header**, and paste below.

Copy the data,

Copy the data,

It is okay to leave empty cells, empty cells or non numeric cells won't be counted

Group | Observed Frequency | *Expected Frequencies |
---|---|---|

k | number of groups | |

n | sample size | |

χ² | Chi square test statistic |

validation message

**Event**: Maintenance failure, recovery, disease occurrence, death, etc.**Censored event**: the main event didn't happen since the subject left the experiment before the ending time, or due to the termination of the experiment.

Hypotheses

H_{0}: Model fits, equal survival distributions

H_{1}: Model doesn't fit

Test statistic

χ² distribution

The test uses Chi-square distribution.

The log-rank test model assumes the events per subject distributes evenly between the groups. The expected number of events is calculated per each time value.

Example with two groups A and B.

Expected value = n

The page was created per Anna P request.

The following R code should produce the same results as the **alternative** log-rank test