Docsity

Comparing Two Groups with Mann-Whitney Test: Skewed Data & Non-parametric Analysis, Study notes of Economic statistics

Partial preview of the text

Download Comparing Two Groups with Mann-Whitney Test: Skewed Data & Non-parametric Analysis and more Study notes Economic statistics in PDF only on Docsity!

Skewed Data and Non-parametricMethodsComparing two groups:t-test

assumes data are:

1.^ Normally distributed,and2. both samples have the same SD(i.e. one sample is simply shifted relative to the other)^0

2 4 6 8 1 0^ 1 2^ 1 4

Violation of Assumptions1. Ascertain if assumptions hold. Things to bear in mind are:Slight violations are probably unimportantViolations of unequal variance worse than violations of NormalityWhat is an important violation is judged by experience2. Use a method that does not make the assumptionsor 3. Can try to transform data so that assumptions are satisfied

Example: Assessing AssumptionsCompare 20 patients in remission from Hodgkin’s disease and 20 patients inremission from non-Hodgkin’s disease.Variable is the number of Tcells per mm^4

3.^ (Altman, DG,Practical Statistics for Medical

Research, 1991, Chapman & Hall, section 9.7, citing Shapiro

et al. 1986,Am J Med Sci, 293-366-70).

Plotting data is first step: Dotplots

(found under Character Graphs

under Graph)^ can be very useful: MTB^ >^ DotPlot^ 'hodgt4'^ 'nonhodt4'..^ .:^ ::^ :^.^ ...

.^.^.^.^.^. +---------+---------+---------+---------+---------+-------hodgt4 0 500 1000 1500 2000 2500. .. :. :.... .:...^.^

+---------+---------+---------+---------+---------+-------nonhodt4 0 250 500

Assessment of above plots is very subjective.Additional assessment, slightly less informal, is to look atmean and SD: MTB^ >^ Describe^ 'hodgt4'^ 'nonhodt4'.N^ MEAN^

MEDIAN^ TRMEAN^ STDEV^ SEMEAN

hodgt4^20

nonhodt4^20 522.^

433.0^ 504.1^ 293.^

Mean is less than 2 x SD for non-Hodgkin’s cases and less than 1.5 SD forHodgkin’s cases, so Normality not a good model.Also, SD is larger when mean is largerShould avoid using at-test on these data.

How does rank sum test work?For illustration, suppose:Hodgkin’s sample contained 3 cases

non-Hodgkin’s sample 4 cases

Combine two samples and rank them. The ranks will be1,2,3,4,…,7 (in general 1,2,3,…,n

+n2). 1

Null hypothesis is that both samples come from the same(arbitrary) distribution.If true, there will be no tendency for ranks from one sample tobe larger than those from other sample

Illustration (continued)Value 116 377 431 958

Rank^1

(Hodgkin’s sample underlined)Once ranks have been found, original data can be discarded for purposesof test.(This is the way that approach avoids assuming a specific distribution)Test statistic is sum of ranks from one of the samples, e.g.

Under null hypothesis, expected value is

4 +^ +^ +^ +^ +^ +^ = 16^1 2 3 4 5 6 7 (^ ) 7

Can also calculate how much observed value is expected to deviate from its expected value n (in general,^ n^ n^ n^

11 n n^ n^ n 1 2 1 × + + + + = +^ +{ ( )} (^ ) ) 1 2 1 1 22 + 1 2

Point Estimate & Confidence IntervalAbove output contains line hodgt4^ N =^20 Median =

nonhodt4^ N =^20 Median =

Point estimate for ETA1-ETA2 is

Note: 681.5-433.0≠203.0: value of 203.0 is median of all possible differences x-y,where x is one sample and y is in the other.Confidence interval assumes twodistributions have the sameshape, which is often notreasonable:distribution-free^ ≠^ assumption-freeAlso, analysis based on ranksmust lose information^

0 2 4 6 8 1 0^ 1 2^

1 4

Alternative ApproachIf assumptions oft-test violated, transform data so that

t-test can be applied to

transformed data.Taking logs of the data is often useful for data that are >0 because:1. It can get rid of skewnessBefore log-transformation

After log-transformation 0. 3 5 0. 3 0 0. 2 5 0. 2 0 0. 1 5 0. 1 0 0. 0 5 0. 0 0- 2. 5^0 2 4 6 8 1 0

0. 3 5 0. 3 0 0. 2 5 0. 2 0 0. 1 5 0. 1 0 0. 0 5 0. 0 00. 0^ 2. 5

2. It can turn multiplicative effects into additive ones

Taking logs

Doesn’t always work, but often helpsProcedure is:1.Take logs of original data2.Apply all statistical methods, i.e. calculating means andSDs as well as performing

t-test, on logged data

3.Transform back to original scale. Care needed to getinterpretation correct, do not back transform SDs, justmeans and confidence intervals

Logging Hodgkin’s dataResults, (using logs to base 10) (omitting inessentials) MTB > Describe 'loghod'^ 'lognhod'.N^ MEAN^ MEDIAN^ TRMEAN^

STDEV^ SEMEAN

loghod^20 2.^

2.8274^ 2.8183^ 0.3076^ 0.

lognhod^20 2.^

2.6364^ 2.6513^ 0.2743^ 0.

MTB^ >^ TwoSample^ 95.0^ 'loghod'

'lognhod'; SUBC>^ Alternative^ 0;SUBC>^ Pooled.TWOSAMPLE^ T^ FOR^ loghod^ VS^ lognhodN^ MEAN^ STDEV

SE^ MEAN

loghod^20 2.817^ 0.

lognhod^20 2.644^ 0.

95 PCT^ CI^ FOR^ MU^ loghod^ -^ MU lognhod:^ (^ -0.014,^ 0.360) TTEST^ MU^ loghod^ =^ MU^ lognhod

(VS^ NE):^ T=^ 1.88^ P=0.^

DF=^38

POOLED^ STDEV^ =^ 0.

“Mean”

In above mean is written in quotes to signify it does not mean the usual(arithmetic) mean, but the geometric mean, a measure which is more suited toskewed data.Consider data 2, 3, 5 or general sample x

, …, x 1 n Example^ General case

Arithmeticmean (AM)

2 3 5 +^ +^3333 =^.^3

x^ x+^ +n^1 n

Geometricmean (GM)^

13 ( ). 2 3 5 3107 × × =^ (

1 n )x x x × ×n 1

GM of unlogged data= antilog of AM of logged dataFurther reading: Bland, chapter 12 (

nd^ ed.); Altman, section 9.6; articles by Bland

& Altman inBMJ, vol. 312, 1996: p700, p. 770, p.