Example 1. Skin electric potential (mV)after various stimuli in 8 individuals

Comparison of location parameters among 3or more groups of identical individuals●

Comparison of location parameters among 3 or more groups ofdifferent individuals → One-way ANOVA or Kruskal-Wallis test●

Read data from:http://minato.sip21c.org/hypno-psycho01.txt●

If all groups are composed of the same individuals?
→ Repeated-measures ANOVA or Friedman's test●●

Data should be given as wide-format for EZR(Data at different times → Different variables*1 line means 1 individual)
Names of time-dependent variables must be given asalphebetical order. If not, rename using [Active data set]
[Variables] [Rename variables]

Draw graph of raw data:[Graphs][Line graph (Repeated measures)]select → calmness, despair, fear, happiness●

Looks not normally distributed. Values are not independent(→ One-way ANOVA is not appropriate). And, the intraindividual factor is not “time”.

●

Null-hypothesis: Skin electric potentials are not different by thekind of psychological stimuli●Statistical analysis:[Nonparametric tests] [Friedman test]
select → calmness, despair, fear, happiness●

Flow: Read data → Draw graph → Statistical analysis
See, (1) The effects of Group(s), Time, Interaction from ANOVA
table, (2) Check sphericity (Null-hypothesis: equal variancesamong time), (3) If (2) is significant, see G-G or H-F adjustment

Friedman chi-squared = 6.45, df = 3, p-value = 0.09166 (NS)

Example 2. Changes of plasma inorganic
phosphate after OGTT for 33 individuals
●

●

●

●

Reading data: [File][Import data][Read Text Data From Flie,
Clipboard, or URL]
Name: ogtt02, From: URL, Delimiter: tabs
URL: http://minato.sip21c.org/ogtt02.txt

Example 2. (cont'd)●[Statistical analysis] [Continuous variables] [Repeated measures ANOVA]●

Repeatedly measured data: T.0, T.0.5, …, T.5
Grouping variable: GROUP●

Univariate Type III Repeated-Measures ANOVA Assuming Sphericity
SS num Df Error SS den Df
F
Pr(>F)(Intercept)
3173.3173.581
31 1336.9260 < 2.2e-16 ***Factor1.GROUP
13.2
173.581315.5464
0.02503 *Time42.3
736.438
21735.9602 < 2.2e-16 ***Factor1.GROUP:Time
9.4
736.438217
7.9881 1.255e-08 ***--Signif. Codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1●

Mauchly Tests for Sphericity
Test statistic
p-valueTime
0.05137 9.4322e-08
Factor1.GROUP:Time
0.05137 9.4322e-08

Draw graph of raw data:[Graphs] → [Line graph (Repeated measures)]
Repeatedly measured data: T.0, T.0.5, …, T.5
Grouping variable: GROUP
2 GROUPs
1: Control
2: Obesity
Checking the effect of TIME,GROUP, and interaction●Or, doGreenhouse-Geisser and Huynh-Feldt Corrections
Two-wayfor Departure from Sphericity
ANOVA
GG eps Pr(>F[GG])
Time0.57374 < 2.2e-16 ***Factor1.GROUP:Time 0.57374 8.868e-06 ***--Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Example 3. Change of systolic bloodpressures (mmHg) after drug admin.

Example 2. (cont'd)●

Non-parametric test is still possible●

Read data: http://minato.sip21c.org/sbp01.txt●[Statistical analysis] [Nonparametric test][Friedman test]
Select variables: T0, T0.5, …, T5●

Rename the name of variable from T.1 to S1●

Draw graph of raw data
Repeatedly measured data: S1, T0, T1, …, T8●Friedman test: p=0.029 → SBP significantly
changes by time after drug administration.

●

Repeated measures ANOVA:[Statistical analysis] [Continuous variables][Repeated measures ANOVA]
Repeatedly measured data: T0, T1, …, T5* More variables than subjects are not allowed●

Friedman chi-squared = 114.8377, df = 7,p-value < 2.2e-16

Repeated or Inter-rater agreementof categorical variables (Chap.13)

Kappa-statistics and McNemar's test
●

●●

●

When ordered or categorical variables were measured
repeatedly or evaluated by multiple raters (observers), theresult can be summarized as two-dimensional crosstabulation.
However, common statistical testing for two-dimensionalcross table like chi-square test or fisher's exact test iscompletely inadequate, because repeated or inter-ratermeasurements are clearly not independent.
We have to test (1) the agreement significantly exceeds
the expected one by chance, or (2) the agreement
significantly worse than the expected one by chance.
●(1) can be done by Kappa-statistics●(2) can be done by McNemar's test

●Test
Kappa statistics●
Please assume the clinical test repeated 2 times, summarized
as 2 by 2 cross table.
Positive●
The agreement probability Po is (a+d)/(a+b+c+d).
●
If the agreement of the 2 test is perfect, b=c=0 (Po=1). When Negative
the tests completely disagree, a=d=0 (Po=0).
●
If the agreement is completely by chance, expected agreement
probability Pe is {(a+c)(a+d)/(a+b+c+d)+(b+d)(c+d)/(a+b+c+d)}●
Kappa statistics can be defined as (Po-Pe)/(1-Pe)●library(fmsb)
Kappa.test(matrix(c(12, 2, 4, 10), 2, 2))●
In EZR, [Statistical analysis]>[Accuracy of diagnostictest]>[Kappa statistics for agreement of two tests]
McNemar's test●
Evaluate the significant change of binary variable (pos/neg)
between before/after intervention●
The result is still 2 by 2 cross table.
●
Χ20= (b-c)2/(b+c), obeys chi-sq distwith d.f.=1●
mcnemar.test(matrix(c(a, c, b, d), 2, 2))●
By EZR, from raw data, see right.

RetestPositive

Negativea (=12)b (=4)c (=2)

d (=10)