Nonparametric Methods For Analyzing Longitudinal Data in Biostatistics Assignments
Nonparametric Methods For Analyzing Longitudinal Data in Biostatistics Assignments
co
m
NONPARAMETRIC
METHODS for Analyzing
LONGITUDINAL DATA
BIOSTATISTICS ASSIGNMENT GUIDE
Introduction Tutorhelpdesk.com
2
Introduction Tutorhelpdesk.com
Introduction
EXAMPLES
• Week-long recording of a patient’s blood pressure.
• Measure a child’s height and weight and compare them later
to ensure they follow the right growth pattern.
• Measuring how well a new drug is performing in comparison
to older drugs after two years of usage.
KEY FEATURES
• Observations made multiple times over a period on the same
individual.
• Correlations between measurements on the same subject.
3
Why nonparametric method is used Tutorhelpdesk.com
Introduction
for Longitudinal data?
5
1. Sign Test and Wilcoxon Signed Tutorhelpdesk.com
Introduction
Rank Test
• Purpose: Compare two sets of PROCEDURE
results on the same subjects – • Order the differences between
paired data analysis (Before and paired measurements.
After treatment). • Don’t consider the signs of
• Example Scenario: Conducting differences (either positive or
hypothesis whether a special diet negative).
type does or does not influence • Rather than the raw values, it
the cholesterol levels in the is the ranks that have to be
patients.
EXAMPLE IN R analyzed.
# Hypothetical cholesterol levels before and after intervention
before <- c(200, 220, 180, 210, 195)
after <- c(190, 210, 185, 200, 185)
# Wilcoxon Signed-Rank Test
6 wilcox.test(before, after, paired = TRUE, exact = FALSE)
2. Kruskal-Wallis Test Tutorhelpdesk.com
Introduction
• Purpose: Compare three or EXAMPLE IN PYTHON (USIN
more groups for ordinal or
from scipy.stats import kruskal
continuous data.
# Recovery rates in three
• Example Scenario:
treatment groups
Statistically assessing whether
group1 = [3.2, 2.8, 3.5, 3.0]
patient samples from three
group2 = [3.8, 3.7, 4.0, 4.1]
treatment groups have
group3 = [2.9, 3.1, 3.3, 3.2]
PROCEDURE
different recovery rates over
# Kruskal-Wallis Test
time.
• Analyse all the data and rank stat, p = kruskal(group1, group2,
them in order. group3)
• compare mean ranks between print(f"Kruskal-Wallis statistic:
groups. {stat}, p-value: {p}")
7
3. Friedman Test Tutorhelpdesk.com
Introduction
• Purpose: The many-measures EXAMPLE IN R
data are analyzed over multiple
# Pain scores across time points
conditions.
pain_scores <- matrix(c(4, 3, 2,
• Example Scenario: Pain scores
5, 4, 3,
are measured at 3 different
6, 5, 4),
periods post surgery on patients
nrow = 3, byrow =
(e.g., Day 1, Day 3, and Day 7).
# Perform Friedman test
PROCEDURE friedman.test(pain_scores)
• Rank data for each subject
across time points.
• Compute the test statistics
using rank sums.
8
4. Kaplan-Meier Estimator Tutorhelpdesk.com
Introduction Survival Analysis)
(Nonparametric
• Purpose: The estimate of EXAMPLE IN PYTHON
time-to-event data under no
habit of distribution. from lifelines import
• Example Scenario: A drug KaplanMeierFitter
is administered to the import matplotlib.pyplot as plt
patients, and the survival # Time-to-event data
rates are studied. time = [5, 6, 6, 2, 4, 8, 10]
event = [1, 1, 0, 1, 0, 1, 1] # 1:
PROCEDURE Event occurred, 0: Censored
• Estimate survival probability # Kaplan-Meier Estimator
at each time point. kmf = KaplanMeierFitter()
• Plot survival curves. kmf.fit(time, event)
kmf.plot_survival_function()
9 plt.title("Kaplan-Meier Survival
Curve")
Difficulties in the analysis of Tutorhelpdesk.com
Introduction
longitudinal data
10
Strengths of Nonparametric Tutorhelpdesk.com
Introduction
Techniques
13
Questions for Self-Review Tutorhelpdesk.com
14
Recommended Textbooks Tutorhelpdesk.com
15
Tutorhelpdesk.co
m
Thank You
www.tutorhelpdesk.co
m
+1-617-807-0926