Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 2. Exercise 1 21,36,42,24,25,36,35,49,32 a=c(21,36,42,24,25,36,35,49,32) mean(a) [1] 33.33333 tmean(a) [1] 32.85714 median(a) [1] 35.

Similar presentations


Presentation on theme: "Chapter 2. Exercise 1 21,36,42,24,25,36,35,49,32 a=c(21,36,42,24,25,36,35,49,32) mean(a) [1] 33.33333 tmean(a) [1] 32.85714 median(a) [1] 35."— Presentation transcript:

1 Chapter 2

2 Exercise 1 21,36,42,24,25,36,35,49,32 a=c(21,36,42,24,25,36,35,49,32) mean(a) [1] tmean(a) [1] median(a) [1] 35

3 Exercise 2 a=c(21,36,42,24,25,36,35,200,32) mean(a) [1] tmean(a) [1] median(a) [1] 35 Sample mean is not resistant as its value largely inflated with a change of a single value.

4 Exercise 3 The resistance of the 20% trimmed mean is 0.2, meaning that a change in more than 20% of the observations are required to generate a large change in its value. In this case n=9, so 9×0.2=1.8, rounded down to the nearest integer, =1. This means that a large change in the 20% trimmed mean value requires a change of at least 2 observations.

5 Exercise 4 The resistance of the Median is 0.5, meaning that a change in more than 50% of the observations are required to generate a large change in its value. In this case n=9, so 9×0.5=4.5. This means that a large change in the median requires a change of at least 5 observations.

6 Exercise 5 b=c(6,3,2,7,6,5,8,9,8,11) a=c(21,36,42,24,25,36,35,49,32) > tmean(a, tr=.1) [1] > b=c(6,3,2,7,6,5,8,9,8,11) > mean(b) [1] 6.5 > tmean(b) [1] > median(b) [1] 6.5

7 Exercise 6 c=c(250,220,281,247,230,209,240,160,370,274,210,204,243,251,190,200,130,150,177,475,221,350,22 4,163,272,236,200,171,98) mean(c) [1] > tmean(c) [1] > median(c) [1] 221

8 Exercise 7 n= =88

9 Exercise 8

10 Exercise 9 d=(21,36,42,24,25,36,35,49,32) var(d) [1] 81 > winvar(d) [1]

11 Exercise 10 d=(21,36,42,24,25,36,35,102,32) winvar(d) [1] Winsorized variance remained the same.

12 Exercise 11 Yes, because we shift the extreme values closer to the mean. This reduces the dispersion in the data. The mean squared distances from the mean decreases accordingly.

13 Exercise 12 The variance has s sample breakdown point of 1/n, thus a single observation can render it value arbitrarily large or small.

14 Exercise 13 The sample breakdown point of the 20% Winsorized variance is 0.2. In the case of n=25, this would be 25×0.2= 5. Thus, we need at to change at least 6 observation to render the Winsorized variance arbitrarily large.

15 Exercise 14 e=c(6,3,2,7,6,5,8,9,8,11) var(e) [1] > winvar(e) [1]

16 Exercise 15 c=c(250,220,281,247,230,209,240,160,370,274, 210,204,243,251,190,200,130,150,177,475,221, 350,224,163,272,236,200,171,98) var(c) [1] > winvar(c) [1]

17 Exercise 16 e=c(6,3,2,7,6,5,8,9,8,11) idealf(e) $ql [1] $qu [1] IQR= =3.25

18 Exercise 17 c=c(250,220,281,247,230,209,240,160,370,274, 210,204,243,251,190,200,130,150,177,475,221, 350,224,163,272,236,200,171,98) out(c) $out.val [1]

19 Exercise 18

20 Exercise 19 X: Fx/n:

21 Exercise 20 X: μ=1.45 Fx/n:

22 Exercise 21 f=c(90,76,90,64,86,51,72,90,95,78) out(f) $out.val [1] 51

23 Exercise 22 3 outliers (none detected) 2 outliers detected (one is masked on graph) print(boxplot(g,plot=F)$out) [1] print(boxplot(g,plot=F)$out) numeric(0)

24 Exercise 23 The boxplot has a sample break down point of 0.25%. The number of outliers it detects does not exceed 25% of the sample. For example, when we had 3 outliers with n=10, all outliers disappeared.

25 Exercise 24 m=c(0,0.12,.16,.19,.33,.36,.38,.46,.47,.60,.61,.61,.66,.67,.68,.69,.75,.77,.81,.81,.82,.87,.87,.87,.91,.96,.97,.98,.98,1.02,1.06,1.08,1.08,1.11,1.12,1.12,1.13,1.2,1.2,1.32, 1.33,1.35,1.38,1.38,1.41,1.44,1.46,1.51,1.58,1.62,1.66,1.68,1.68,1.70,1.78,1.82,1.8 9,1.93,1.94,2.05,2.09,2.16,2.25,2.76,3.05) print(boxplot(m,plot=F)$out) [1] 3.05

26 Exercise 25 The upper and lower quartiles of figure 2.2 are 125 and 50, respectively, so an outlier will be declared when 1.x> (125-50) 2.X<50-1.5(125-50)

27 Exercise 26 out(z) $out.val [1] outbox(z) $out.val [1] Histogram detected far fewer outliers than the other methods

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89 Exercise 1 21,36,42,24,25,36,35,49,32 a=c(21,36,42,24,25,36,35,49,32) mean(a) [1] tmean(a) [1] median(a) [1] 35


Download ppt "Chapter 2. Exercise 1 21,36,42,24,25,36,35,49,32 a=c(21,36,42,24,25,36,35,49,32) mean(a) [1] 33.33333 tmean(a) [1] 32.85714 median(a) [1] 35."

Similar presentations


Ads by Google