A problem with MEDIAN
in SPSS (computed with procesdure MEANS /cells GMEDIAN )
or in the matrix-program MatMate.

 

Different computation of medians - reason not clear:

 

Median of Age in sample:

Software

procedure

All

male

female

SPSS

Gruppierter Median

40.36

42.29

38.22

MatMate

Median

40.80

42.67

39.00

 

2) Median, documentation of frequencies

(only some categories around the median-category is documented)

Grey: median category, red: category-value; blue cumulated frequencies

 

All

male

female

Age

(k)

freq

(f)

Kum freq

Kum Freq %

...

 

 

 

38

6

86

45.50

39

4

90

47.62

40

5

95

50.26

41

6

101

53.44

42

6

107

56.61

43

6

113

59.79

44

6

119

62.96

...

 

 

 

N

189

189

100 %

Age

freq

Kum freq

Kum Freq %

...

 

 

 

40

1

42

44.21

41

3

45

47.37

42

3

48

50.53

43

4

52

54.74

44

3

55

57.89

45

3

58

61.05

47

1

59

62.11

...

 

 

 

N

95

95

100 %

Age

freq

Kum freq

Kum Freq  %

...

 

 

 

36

3

40

42.55

37

4

44

46.81

38

5

49

52.13

40

4

53

56.38

41

3

56

59.57

42

3

59

62.77

...

 

 

 

...

 

 

 

N

94

94

100 %

n0.5 = (189+1)/2 = 95

i=20 (the 20'th category cont. case n0.5)

ki = 40     ki+1  = 41

fi =  5     cfi-1 = 90

 

n0.5 = (95+1)/2 = 48

i=19 (the 19'th category cont. case n0.5)

ki = 42     ki+1  = 43

fi =  3     cfi-1 = 45

 

n0.5 = (94+1)/2 = 47.5

i=16 (the 16'th category cont. case n0.5)

ki = 38     ki+1  = 40

fi =  5     cfi-1 = 44

 

x0.5 =

x0.5 = = 40.8

 

x0.5 =

x0.5 = = 42.667

 

x0.5 =

x0.5 = = 39.0

 

Median = 40.8

 

Median = 42.667

 

Median = 39.0

 

SPSS : 40.36

SPSS : 42.29

SPSS : 38.22


Legend:

            n0.5       : median-case

            i           : nr of category containing median-case

            ki         : value for median-category

            ki+1      : value for next category

            fi          : number of cases in i'th category

            cfi-1      : cumulated number of cases up to (i-1)'th category

 

Median-formula:=      x0.5 =


Data: agesex.txt

age

sex

32

2

29

2

45

2

42

1

52

1

41

1

20

2

44

2

52

2

48

1

79

1

25

2

20

2

22

2

34

2

37

2

54

2

26

1

31

1

44

2

41

2

45

2

42

2

62

1

49

2

61

2

29

2

30

2

29

2

41

2

36

2

42

2

57

2

59

2

29

2

29

2

20

2

64

1

39

1

28

1

21

1

43

1

64

1

33

1

33

2

23

1

57

2

40

1

30

2

33

2

41

1

20

2

78

2

37

2

45

1

34

1

21

1

43

2

44

2

56

2

38

2

43

1

44

1

22

2

61

2

40

2

38

1

53

1

41

1

63

1

45

2

28

2

28

2

30

1

29

1

61

1

29

1

44

1

27

1

64

1

20

2

51

2

29

2

25

1

34

1

28

1

44

1

34

1

28

2

36

2

30

1

23

1

24

1

33

1

61

1

34

1

42

1

31

1

42

2

40

2

20

1

28

1

45

1

23

1

28

2

24

2

51

1

25

1

43

1

21

1

83

1

41

2

56

2

54

2

38

2

27

1

84

1

58

2

30

2

45

2

45

2

56

1

34

1

37

1

61

1

51

2

33

2

38

2

24

2

85

2

25

1

47

1

38

2

79

2

31

2

82

2

40

2

34

2

73

1

53

1

38

2

32

2

42

1

72

1

62

1

84

1

48

2

32

2

22

1

21

2

71

2

36

2

28

2

77

2

50

1

82

1

27

1

45

1

57

1

49

1

70

1

37

2

56

1

56

1

39

1

34

2

33

1

43

1

22

1

62

1

39

1

24

1

40

2

37

2

61

1

39

1

69

2

33

2

43

2

65

1

50

1

60

1

66

2

32

2

78

2

49

2

71

1

77

1

73

1