0% found this document useful (0 votes)
23 views27 pages

Statistics Notes for University of Pretoria

The document contains notes on statistical methods, including chi-square tests, hypothesis testing, and time series analysis. It discusses the differences between parametric and non-parametric tests, along with examples and calculations for statistical inference. Additionally, it covers forecasting techniques such as moving averages and trend projections.

Uploaded by

sibahlekhumalo05
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views27 pages

Statistics Notes for University of Pretoria

The document contains notes on statistical methods, including chi-square tests, hypothesis testing, and time series analysis. It discusses the differences between parametric and non-parametric tests, along with examples and calculations for statistical inference. Additionally, it covers forecasting techniques such as moving averages and trend projections.

Uploaded by

sibahlekhumalo05
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

lOMoARcPSD|42357767

Notes

Statistics (University of Pretoria)

Scan to open on Studocu

Studocu is not sponsored or endorsed by any college or university


Downloaded by Sibahle Khumalo (u23670844@[Link])
lOMoARcPSD|42357767

Chapter : 12

BSERVED FREQUENCIES :

26 Esi25985 Sij
635 102 C 1s

21 D 234741 ith jth , ma

:
INDEPENDANT
Pa(7) P(a)P(7)
=

=
(Row total) (Column total)
total
grand
W

EXPECTED FREQUENCY "


:

e = (Row total) (Column total) 215 = 20x25 =


16 81
.

total -
grand eij must be , 5
1 234567
F 26 657129 20 2831270
16 88 31 7327 68
2
. . .

M
% Go t 138 12515 2813 33
.
51910138
. .

72 0 as a 100

Downloaded by Sibahle Khumalo (u23670844@[Link])


lOMoARcPSD|42357767

Pearson's 72 : Chi Square


Te s t statistic that difference fij and
measures a
significant eij.
fij -lij
Df
2 #rows-1 # Columns-1
=

fij -lij
1 2 3456 7
22 == zij
F 26 65 71 29 20 2831 270 j
48 6
. 67 550 63
. . 2716 88 31 7327 68
. . .

11 5 19 10130 26 18 621 -

13 332
M 46
-

35
.

%
.

+... +
23 4
. 32 5
. 24 3
.
138 12515 2813 33
.
. . .6
8 13 33
.

72 100 75 40 254741 400


= 62 668
.

Chi-Square table :

a Area Prob in upper tail

Ca

Downloaded by Sibahle Khumalo (u23670844@[Link])


lOMoARcPSD|42357767

-
ST F1 DEPE DAC - :

Dependant

State Ho and Ha
Calculate test statistic : Ch
fij -lij 26 -
48 62 1 -

13 .
332
2
.

=
+... + = 62 668
.

eij .6
8 13 33.

=j

Rejection Critered

<2 with df (2-1) (7 1) 6 0 05


Reject Hoif(ch
= =
-
= -

a .

CCv2 :
density curve

Decision

2 eject Ho at a 5%
0 05 .

Conclusion
12 592
.

dependent x

HYPOTHESIS TESTUSIGP-ALUE ·

Because the t > 18 . 548 ,


we conclude that the p-value is 0 005 .
.

:
Reject Ho .

-
X(e :

Downloaded by Sibahle Khumalo (u23670844@[Link])


lOMoARcPSD|42357767

Chapter : 13 Parametric vs . Non Parametric

Big Samples ·
Small samples
· Quantitative data ·
No assumptions about
form of distribution

Categorical
·
or
quantitative
Ho : u g Ho : Median = 450
Ha :
M Ha : Median = 450
Ho :
M1 Ma Mann-Whitney-
Ha :
M1 M2 Wilcoxon test

Statistic inference with M1-M2 :

Significant difference between 2 Pop means :

M1 125
,
12 135

1 .

= -
(u1 ,
0 ? )
-

H :
M1 =
Mz

Ha :
M1 r

or
/2
12

-
12 ,
0?

Downloaded by Sibahle Khumalo (u23670844@[Link])


lOMoARcPSD|42357767

---ST :

Criteria : Ho :
th Mz ...
UK

· k independant populations. K 2 Ha : -
cleast I mean differs
·
Random samples from each population
·
Response variable :
ormally dist 200 200
15002 15002 (2
(2
·
ariance of available responses same . (41 (41

Between 25002 ithin 25002

... ithin variability 35002 143


35002 143

300 300
145 145

It It

for the difference between


esting means

using two estimates of the population variance TT -


-R- BILIT ,:

SS SSR 33
factors we are :

intrested in t not intrested in


--
ISIS --RI-C- :

Common population variation :

·
first estimate is indp of Ho ·
Second estimate based on assumption -

· -

stimate of within treatment ·


is true .

Mean stimate of between


square due
treatment
-
·
· :
to error

S-
17
SS-

<
SS- ·
Mean
square due to Treatment:
k
2
S2SSIR SS12
1,, x

k1 j = 1

erall mean :

M
1 T 12
x Cij ...
Tk

77T

M11 Mrk
Mai
m nly if sample sizes =

j
~

Downloaded by Sibahle Khumalo (u23670844@[Link])


lOMoARcPSD|42357767

variance
--
IABLE : Pop
E

Source f Sum - Degrees + ear Squares -

ariati r Squares -
reedom S

SS df

treatments SS2 SS3


SE 52

S
-
r p SS T SS
S
T

I ta SS 2

SSTR
-
S2 k1
S SS-
11 k --
table

I histest statistic sanF stributin - 1x


F

ith k-1 dfy egrees f freed m in &

df d)
.

numerat rands , k2 degrees +


freed m in den minat r

Downloaded by Sibahle Khumalo (u23670844@[Link])


lOMoARcPSD|42357767

[USK- -
S -
S :

Sort small to
big
ranks in order mean ranks
2
Assign increasing .
hen ties ,
assigned.
3 Show rank

Sum ranks
Use chi table determine the
square distribution
to K- 1 of,
5 p-value , using
under the assumption of identical populations the distribution of H
,
sampling
can be approximated chi square distribution. Sample Sizes

k
2 R 5
317T
1+ 75 Ni 2 2 2
i=1

25 3 3
T number of a s 3

number f bservati
35 & 5
11 ; ns in sample i
T
6 6
1T ni = + tal number of observations in all samples
i = 1
5

6 G 9
2 sum fthe ranks for sample i 6 I 9
~
erf rmance -

valuatin ratings 6 I

7 2
>
-
3 E
7 2 2
25 3 6 S 5 3 2
7 2 2 2 2 5
6 & 3 & 6 I 5 .5
5
85 15 1 55 G .5
5
95 2 6 I .
5 5
& 5 35 S 2 I g
55 S I 9 I
95 2 2

Downloaded by Sibahle Khumalo (u23670844@[Link])


lOMoARcPSD|42357767

EXAMPLE:
candies are often high in
calories. Assume that the following data show
the calorie content from samples of M&MÕs.
Kit Kat, and Milky Bar.
Test for significant
differences among the calorie content of
these three candies.
At a 5% level of
significance, what is your conclusion?

Sort small to
big
ranks in order mean ranks
2
Assign increasing .
hen ties ,
assigned.
3 Show rank
& Zank Zank 3
Sum ranks
23 1. 5 220 & 2 3
e C
2 25 5 2 l
e C 2 25 22
13 14 4

k 25 15 235 12 2
2 R
317T
1+ 75 Mi 23 10 5 22 g 1
i=1
.

-
56 = 48 = 16
2
2 52 6
3 -
je
565 5

Use chi table determine the


square distribution
to K- 1 of,
5 p-value , using
under the assumption of identical populations the distribution of H
,
sampling
can be approximated chi square distribution. Sample Sizes

Using the 12 table with of 2


,

1296 shows thee-aleisset een land .


25

2
Ce ve

3
2 ale .
S , reject /0 S

Downloaded by Sibahle Khumalo (u23670844@[Link])


lOMoARcPSD|42357767

)
C - -

2 :

TIME SERIES PATTER:


-

1
. Horizontal Pattern :
-

Data fluctuates around constant mean .

.
2 Trend:.......
Gradual shift lower values
to
higher or

.
3 Seasonal Pattern : Beach in Summer

Repeating pattern successive periods.

4
. Tre n d and Seasonal Pattern : Combo

.
5
Cyclical :

Downloaded by Sibahle Khumalo (u23670844@[Link])


lOMoARcPSD|42357767

TIME SERIES DECOMPOSITION:


t + Se It
& Time Series

sonal Irregular alue

Colum :
1 t Time Series
2 Tre n d t : 5
day moving average
Add 5 it : 5
day
3 Seasonal Ye : Te
rregulare :
Row 1 : 3

S
1
5 Deseasonal : = S = T Row 1 = 4

6 t : Count f
1 to amount entries

7 T same as 5

8 Fitted T :
b it

9 F = 1xS Row , x

Downloaded by Sibahle Khumalo (u23670844@[Link])


lOMoARcPSD|42357767

T 2 3 4 5 6 789

1 =3 =

55 69 125
.

Downloaded by Sibahle Khumalo (u23670844@[Link])


lOMoARcPSD|42357767

TYPES OF FORECASTING:

·
Moving average
· Tre n d projection
·
Multiplicative model

1. MOVING AVERAGE:
Only horizontal pattern

35 -
=

yi
-

yi =
92

2. TREND PROJECTION:
Trend
ny Irregular component

- b Det t Linear trend forecast in period


b
y intercept
bet Slope
by t + t
2
t t

b it

Downloaded by Sibahle Khumalo (u23670844@[Link])


lOMoARcPSD|42357767

3. MULTIPLICATIVE MODEL:
t + Se It
& Time Series

sonal Irregular alue

Colum :
1 t Time Series
2 Tre n d t : 5
day moving average
Add 5 it : 5
day
3 Seasonalt Ye : Tt Sl actual value Centered MA
rregular : :
=

S1 Sum for
Unadjusted = n
#n

S
1
5 Deseasonal : = S = T Row 1 = 4

6 t : Count f
1 to amount entries

7 T same as 5

8 Fitted T :
b it

9 F = 1xS Row , x

Calculator

SI =
actual value : Centered MA Fitted T : = A + Bt

SI form
Unadj =
sum n F =
TX S

Correction factor = #n : total


unadj St

Seasonal s)--djusted .

factor
-

djust =
Unadjusted Six Correction

Downloaded by Sibahle Khumalo (u23670844@[Link])


lOMoARcPSD|42357767

CHAPTER: 18

SIGN TEST:
Compare observation to
hypothesized value

of population mean

hypothesized :

hypothesized :

· :
eiminate the observation

·
lest number
stat =
signs

·
Decision rule Binomial : table ,
n = entries and p =
... or use

Sinom Dist to p value =


probability to a value of
.

get get
Te s t stat or more .

EXAMPLE: -
: median =, 5 -
:
P = 5
-

a
: median =, 5 -

a
: P = 5

The test stat = 7

n = 10 , p =
0 . 5

Binom Dist .
6
,
0 5 , True
.

=. 8281
P alue = 1 -

-
8281
-

119
2 Sided :

p - 3438 . S

Downloaded by Sibahle Khumalo (u23670844@[Link])


lOMoARcPSD|42357767

NORMAL APPROXIMATION TO BINOMIAL:


5 m derately large n
,
> not close to eror he

CONTINUITY CORRECTION: x(y)

2 = 5
c =
2 .
5
,
2 +

=
m =
mp =
mp1 -

p 2 .
5

Y
23

EXAMPLE:

Sample : 61 resulted in 1 value the same as

median and
hypothesized 22

-
: median - 236 -
:
P = 5
-

a
: median 236 -

a
: P = 5

u =
np = 56 =
3
0 = 60 . 5 .
5 = 3 873
.

22 .
53

p-alue = 22 5 .
note correction factor of . S
22 . 5 -
3
=
PZ 3 873 .

P1- 94) -
excels
1
Using S Dist
=
.
orm .
.

=
.
262

Because this P-alue S H.


.

, reject

Downloaded by Sibahle Khumalo (u23670844@[Link])


lOMoARcPSD|42357767

EXAMPLE:

Do a hypothesis test at 5% a and use the normal


distribution to
approximate the binomial probability
of 211

1 :
3 1 :
21 : 9

-
: median- m =
mp = 53 =
15
-

a
: median O = 30 . 5 .
5 = 2 7386
.

p- alue
= 21 - 5 note correction factor of .
S
. 5
2 -
15
=
PZ 2 .
7386

=
P2 .
1) = 222

Because this P-alue S H.


.

, reject

Downloaded by Sibahle Khumalo (u23670844@[Link])


lOMoARcPSD|42357767

NONPARAMETRIC TEST: TWO INDEPENDENT SAMPLES

fx fy
1v1

1y 1
a

M My

·
a mount of shift #

F fr

#
? #

hen parametric anal gue tests fre la it, f medians in the t distributins .

Downloaded by Sibahle Khumalo (u23670844@[Link])


lOMoARcPSD|42357767

EXAMPLE:
MANN WHITNEY WILCOXON TEST:
Two fuel additives are being tested to determine their effect on petrol mileage.
Seven cars were tested with additive 1 and nine cars with additive 2. Data shows
miles per gallon obtained with the two additives. Test whether there is a significant
difference between petrol mileage for the two additives.

-
:
cuatins are identical
- : " Justins identical
a are not

Sort small to
big
ranks in order mean ranks
2
Assign increasing .
hen ties ,
assigned.
3 Show rank 2

17 3 2 18 7 .5
8
Sum ranks for Sample
. .

4 1 as test statistic
18 .
G 17 8.

19 1 1 21. 3 15
57797595
.

ninn2 16 7 .
1 21 . 1

18 2 .
5 22 1.
16
1 1 18 G .
7 18 7.
8
.5
o
12771722227 1279797 17 5 . 3 19 8.
11

2
.7 13
94472
2
.2 12
3 c9d
Y
34 correctin factor f S
3
.

9 .
72

260

p-value =
.
2 J

H.
reject

12 - and 12 - as critered for approximation

Downloaded by Sibahle Khumalo (u23670844@[Link])


lOMoARcPSD|42357767

arametric :

- --
IABLE : Te s t of independance :
P value = Pcc observed
Sum - Degres a Can as value)
Surcef square
-

:
F :
pop
test stat
- Ho

--
table
I reatments

-
r p
Sludres-reedom
SS2

SS T
52553

S
T
SS
52

S
to

22
:
independant

=
for
zij
Ha :
Dependant

Df =
#rows-1 # Columns-1

· Treatments factors
:

: I ta SS 2
= [25a)

Row total Colum total


e =
n
Reject Hoif(ch -C 2 with

df =
(2 1)(7 1) 6a
- -
= = 0 05

:
.

To t

Independant :
·
PARB =
P(A) P(B) .

Te s t Stat : = + ·
P-alue =
#- prob
=
row total x Colum total
total
· (n-test stat)'s prob grand
·
=. 5 a3 + or -

on Parametric test :

statistical inference without


assumption has been
=>

Binomial sample
u taken from certain distribution .
=
Pxmo =
np( p) -

#
One sample or matched Pairs
· · Two ind sample
·
Mann Whitney (Wilcoxon Rank Sum)
·

Sign test
·
Sampleizes
·

n
>ann2 , 072722nn2
·
Kruskal allis
·
Te s t Stat : Sum Ranks sample 1 "W"

W
:
Sort small to
big
order.
Ho Pop identialnatical
2
Assign ranks in
increasing hen ties ,
mean ranks
assigned . table
TS add correction) -

No
get pvalue
· z to -

3 Show rank Ow

tailed Px2
Always
:
· 2
Sum ranks
chi table determine
square distribution
5 Use to the p-value , using K- 1 of,

under the of identical populations the distribution of H


assumption ,
sampling
can be approximated chi square distribution
.
Sample Sizes

2 kR ?
317T
+ Mi E ce :
Chisq dist Re Hidt)
15 i
.
.

= 1

T number of ua S eC

eC
11 ; number f bservati ns in sample i

1T ↑ = + tal number of observations in all samples


i = 1

2 sum fthe ranks for sample i

Downloaded by Sibahle Khumalo (u23670844@[Link])


lOMoARcPSD|42357767

STK 160 Calculus and matrices

:
Jeterminant
C

ranspose

Property 1: Property 3:
multiplication of any one row or column by a scalar

k will value of the determinant K-f Id .


, change the
Property 2:
interchanging any two rows or columns will alter Property 4:
the sign ,
not the value, of the determinant > each element
-

farow or column is added

or subtracted from the corresponding element of

Property 5: another row or column


,
the value of the

If new w rcolumn is a multiple of another determinant remains the same .

row or column then the determinant is zero .

Property 6: then -
is a
singular matrix .

f her w rclumnfamatrix c htains -

then-is a non-singularmatrix.

n zeros then the valuef the determinant

is zero .

Downloaded by Sibahle Khumalo (u23670844@[Link])


lOMoARcPSD|42357767

Cramer's rule:

& 113972xz =
Dy -

d213dzz2 D2 -

3th
an a a and -

a D1 913
be a , A
+ 1

xb3932933 (2 = &Das a ! ifA is non-single a


-

Downloaded by Sibahle Khumalo (u23670844@[Link])


lOMoARcPSD|42357767

Downloaded by Sibahle Khumalo (u23670844@[Link])


lOMoARcPSD|42357767

Chapter: 5 LINEAR PROGRAMMING

a ximising or minimising a linear functionc ba Daky Drin

el :
legeometrics method

L G aaehu -
S

Assembling time 25 5 17

Finishing fftime 35 3 15
umber funits x Y

rftin 21 List and G is 15 .

35x + 30y = 1058


·

c
rofit functi n: 1 x + 15 y .
#

24 feasible
B
Zestricti ms :
28

16
25x + 5y11 C 25x + 50x = 1100
12
M

35x + 3y15 g

&

x, D
Y
% 5 10 15 20 25 3035

1108
25x + 5y
= 44 22 and
= 11a+ x =
25 ..., ,

05
35x +
, =
3
: 35 and 3
3y15a+ x =
35 ,

25x5y = 11

35x3y = 15 bjective function : aximise 1x + 15y


5
253355 ·
Set function equal to any constant 1x + 15 y = c
- 3
.

Then dotted line


25
·

y =
% Y
35 5
12 25
To the profit function the
.

max more
,

function away from the origin .

Hence profit is max als 19 Sandy.


12 25.

·
Profit 1 : x + 15 y = 1 19 5 .
+ 1512 25 .
= 378 75 .

· -

ssembly time : 25x + 5 y = 25 19 5 .


+ 5 (12 .
25 = 11

·
Finishing off time : 35x + 3 y =
35(19 5) .
+ 3 (12 .
25 = 15

Downloaded by Sibahle Khumalo (u23670844@[Link])


lOMoARcPSD|42357767

eth d2 : I he extreme point method

·
The corners of the feasible region are the extreme points .

·
The solution of the linear equations can always be found in at least one of the extreme points .

·
If two points Cand D give both an
optimal solution then all the points on CD will give the optimal solutions .

·
ethod

Determine the corners of the feasible region .

Calculate the values of the objective function .

entif, the co-ordinates that give the ptimal solution .

35x + 30y = 1058


#

Extreme points Coordinates Profit function


x, Y) 1x + 15y
C, ( 10(0) + 15)) = 0
24 feasible
B
( , 22) 1010) + 15(22) =
338
28
C (19 .
5 12 25)
, . 18(19 5).
+ 15(12 25) .
=
378 75 .

16 D (3 , 10(30) + 75(0) =
300
195 12 25
C ,
.

25x 1100
+ 50x =
12
M

g profit function has a max of R378 75 .


in 1 atx = 19 5 and y
.
= 12 25
.

&
D
% 5 10 15 20 25 30 35

Downloaded by Sibahle Khumalo (u23670844@[Link])


lOMoARcPSD|42357767

2 subject castra ils : X

X 7 6 X, 7

D
2x
27 :

e e sostie jec functi is :


e seg
-
nS :

↑X .Setx
6 an fin 16. Sety an fin x 6 .

Crinates 6 and 6

r 5x + y = 5 : Set and findy = 5 .


Sety = and fin x 1 .

Crinates 5 and

setx y CS latc X

.
7

T e

6
C eama
g
3
S

&
2

2 3 5 678 &

Downloaded by Sibahle Khumalo (u23670844@[Link])


lOMoARcPSD|42357767

Downloaded by Sibahle Khumalo (u23670844@[Link])

You might also like