Manual Log Rank Test Calculator

Build log rank tables from grouped survival data. Check observed, expected, variance, and p results. Download clear study records for later statistical reporting use.

Calculator

Risk set table

Use one row for each distinct event time. Pasted rows override this table when provided.

Time Group A at risk Group A events Group B at risk Group B events Note

Accepted columns are time, group A risk, group A events, group B risk, group B events, and note.

Example Data Table

Time Treatment at risk Treatment events Control at risk Control events
2101100
492101
67192
86172
105051

Formula Used

For each event time i, use n1i and n2i for risk sets.

Total at risk: ni = n1i + n2i.

Total events: di = d1i + d2i.

Expected group A events: E1i = di × n1i / ni.

Variance row: Vi = n1i × n2i × di × (ni - di) / [ni² × (ni - 1)].

Observed group A events: O1 = sum of d1i.

Expected group A events: E1 = sum of E1i.

Log rank statistic: chi-square = (|O1 - E1| - c)² / sum Vi.

Use c = 0 without correction. Use c = 0.5 with correction.

The p-value uses a chi-square distribution with one degree of freedom.

How to Use This Calculator

Enter one row for every distinct event time.

Enter people at risk just before that event time.

Enter observed events for both groups at that time.

Do not enter censored cases as events.

Update later risk sets after censoring and earlier events.

Set alpha, choose labels, and select any correction.

Press Calculate to view the manual result above the form.

Use CSV or PDF buttons to download the same calculation.

Understanding the Manual Log Rank Test

The log rank test compares survival experience between two groups. It uses event times, risk sets, and observed events. It does not compare average survival directly. Instead, it checks whether the event pattern differs across the whole follow up period.

Why the Test Matters

Survival studies often include censored cases. A censored case has not shown the event by its last known time. The log rank method handles this by using the number still at risk before each event time. This makes the test useful in medical, reliability, product life, and retention studies.

Manual Table Method

A manual table starts with each distinct event time. For every row, enter the number at risk in group A and group B. Then enter the observed events for both groups. The calculator finds the total at risk and total events. It then assigns the expected events for group A by proportional risk. Group B is the remaining expected count.

Variance and Test Statistic

The variance measures how much the observed difference can vary by chance. Each row adds a variance term. The final chi square value uses the squared observed minus expected difference. A larger value means a larger separation between curves. The p value is based on one degree of freedom.

Reading the Result

When the p value is below alpha, the curves differ statistically. This does not prove a clinical effect alone. Check sample size, censoring pattern, study design, and endpoint definition. Also inspect survival curves when available. The test assumes comparable censoring and proportional hazards over time.

Good Data Practice

Use one row for each event time. Combine tied events into the same row. Do not list censored observations as events. Adjust the risk set after censored cases for later rows. Keep the event meaning consistent. For example, death, relapse, churn, or device failure should not be mixed without planning.

Practical Use

This calculator is designed for manual checking. It shows expected counts, variance, row contributions, and final significance. The CSV and PDF outputs help preserve audit notes. They are helpful for assignments, study reports, and quick verification work. Document every edited row clearly. Record sources before final reporting. Keep reviews simple and traceable.

FAQs

What does the log rank test compare?

It compares survival curves between two groups across event times. It checks whether observed events differ from expected events under equal survival.

What is an at risk count?

It is the number of subjects still followed and event free just before a listed event time.

Should censored cases be entered as events?

No. Censored cases reduce later risk sets. They are not counted as events at the censoring time.

How are tied event times handled?

Combine events at the same time into one row. Enter total events for each group and the risk set before that time.

What does a small p-value mean?

A small p-value suggests the survival curves differ statistically. It does not measure effect size or clinical importance.

Why can variance become zero?

Variance can be zero when useful event information is missing. It can also happen when only one group has risk data.

Does this calculate a hazard ratio?

No. The log rank test gives a chi-square statistic and p-value. Use a Cox model for hazard ratios.

Can I export my calculation?

Yes. Submit the form with the CSV or PDF button. The file includes summary results and row details.

Related Calculators

Paver Sand Bedding Calculator (depth-based)Paver Edge Restraint Length & Cost CalculatorPaver Sealer Quantity & Cost CalculatorExcavation Hauling Loads Calculator (truck loads)Soil Disposal Fee CalculatorSite Leveling Cost CalculatorCompaction Passes Time & Cost CalculatorPlate Compactor Rental Cost CalculatorGravel Volume Calculator (yards/tons)Gravel Weight Calculator (by material type)

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.