Download as xlsx, pdf, or txt
Download as xlsx, pdf, or txt
You are on page 1of 56

Events Prior Probability Conditional probability Joint Probability

Ai P(Ai) P(B|Ai) P(Ai intersection B)


A1 0
A2 0

From q From q
posterior Probability
P(Ai|B)
#DIV/0!
#DIV/0!
No of success x 4
No of trials n 6
Probability of successp 0.2
Cummulative for x success false, for x<=success true

probability 0.01536

expected number of sales E(X) np


Varinace noq
Std dev root of var
X 3
Mean 2

probability 0.180447

-0.999943 5.684024E-05
Formula norm.dist

formula inverse 47.25503 norm.inv What score would be needed to be in the 85th percentile?
e 85th percentile?
Type I Error

Rejecting Ho when it is true False Positive

Type II Error

Accepting Ho when it is false False Negative

There
is a tradeoff between these two errors The probability of making one type
of error can be reduced only if we are willing to increase probability of making the
other type of error
bility of making the
Z value t value

n 36
μ 1.5
x bar 1.4
σ 0.12

Standard Error (SE) sigma/root 0.02

Z=(x bar-μ)/SE -5

If right tailed If left tailed if 2 tail * by 2


p value calculation 2.8665157E-07

p must be less than .5 else minus 1


p value 0.9999997133 2.866516E-07

Using critical value approach

Z at 0.05 (left tailed) -1.644853627 Z critical value


Z at 0.05(right tailed) 1.644853627

if p< alpha we reject h0

Correction factor if sample >5% of population


root(N-n/N-p
t value
excrl formula for p value usinh t stats
n 20
μ 50
x bar 60 t.dist
s 5

Standard Error (SE) 1.1180339887

t=(x bar-μ)/SE 8.94427191

dof 19
p value (Two tailed)

p value (upper tail) 1.537894E-08 0.999999984621064


p value (lower tail) 0.9999999846 1.99999996924213 *2

Using critical value

At 0.95 1.7291328115
n 60
P bar 0.35
Po 0.46 1-Po 0.54
P bar-Po -0.11
Po*(1-Po)/n 0.00414
Sq root(Po*(1-Po)/n) 0.064343 standard error

z -1.709592

2.326348

n- sample size 70
p bar 0.65
q bar 0.35
standard error
root (p bar * q bar/ n)
z cv/ t cv formula for t t.inv.2t
confidence level
margin og error
lower limit
p bar- margin of error
Upper limit
p bar + margin of error

1.      A study was undertaken to determine customer satisfaction in Canadian automobile markets following certain

n samplesize 1000 p is either given in q or taken as 0.5


success p bar 0.48 not used to calculates sd
p0 0.5 It is used to define alternate and null hypothesis

stqndard error 0.01595


z stats 1.253925

z cv 1.644854
aplha 0.05
P value 0.895065
0.104935
if p< alpha we reject h0

ile markets following certain changes in customer service. Suppose that before the changes, the average customer satisfaction rating, on a
stomer satisfaction rating, on a scale of 0 to 100, was 77. A survey questionnaire was sent to a random sample of 350 residents who bough
le of 350 residents who bought new cars after the changes in customer service were instituted, and the average satisfaction rating for this
rage satisfaction rating for this sample was found to be x = 84; the sample standard deviation was found to be s=28. Use an α of your choic
e s=28. Use an α of your choice, and determine whether statistical evidence indicates a change in customer satisfaction. If you determine
satisfaction. If you determine that a change did occur, state whether you believe customer satisfaction has improved or deteriorated.
mproved or deteriorated.
Confidence Interval calculation (z)

Sample 1 Sample 2

n1 50 n2 35
x1 bar 13.6 x2 bar 11.6
sigma 1 2.2 sigma 2 3
CI
90%
Point estimator x1 bar-x2 bar 2 95%
99%
sigma1^2/n1 0.0968 sigma2^2/n2 0.257143

Standard Error 0.594931 Standard error

90% 0.978661 Margin of error


95% Margin of Error 1.166065
99% 1.532542

Minimum Maximum

90% 1.02133855701 2.978661


95% 0.83393530197 3.166065
99% 0.46745782544 3.532542

if p< alpha we reject h0

Confidence Interval calculation (t)

Sample 1 Sample 2

n1 50 n2 35
x1 bar 13.6 x2 bar 11.6
s1 2.2 s2 3

Point estimator x1 bar-x2 bar 2

sigma1^2/n1 0.0968 sigma2^2/n2 0.257143

Standard Error 0.594931

Margin of error Using appropriate t value, multiply with SE)


Interval x1 bar-x2 bar+MOE
x1 bar-x2 bar-MOE
z test statistics/t statistic(enter s value in place of sigma -formula remain

Do 0
Point estimator x1 bar-x2 bar 3.5

Sample 1

alpha/2 z(alpha/2) n1 35
0.05 1.645 x1 bar 13.6
0.025 1.96 sigma 1 5.2
0.005 2.576

sample sd/root n
sigma1^2/n1 0.772571429
Z alpha or Z cv * standard error

(x1 bar-x2 bar)-Do 3.5


Sqrt((sigma1^2/n1)+
(sigma2^2/n2)) 1.605870925

z 2.179502689
Find p value using norm.s.dist
n place of sigma -formula remains the same)

s1
n1

Sample 2 s1^2/n1

n2 40
x2 bar 10.1
sigma 2 8.5
(s1^2/n1)^2

1/(n1-1)
sigma2^2/ 1.80625
Calculation for degrees of freedom

2.5 s2 4.8
20 n2 30

0.3125 s2^2/n2 0.768

Numerator 1.16748025

0.09765625 (s2^2/n2)^2 0.589824

0.0526315789474 1/(n2-1) 0.034483

Denominator 0.0254785612523

df 45.822063437591 45
Excel formula
Observed Frequencies (fij)
Response 1 2 3 Total
Yes 150 150 96 396
No 100 150 104 354 chisq.inv.rt
Total 250 300 200 750

Expected Frequencies (eij)


Response 1 2 3 Total
Calculating Expected Frequency table
Yes 132 158.4 105.6 396 After that you can either create the Ch
No 118 141.6 94.4 354 or use the direct formula
Total 250 300 200 750

Chi-squre calculation (fij-eij)^2/eij


Response 1 2 3 Total
Yes 2.45 0.45 0.87 3.77 Use direct formula CHISQ.TEST()
No 2.75 0.50 0.98 4.22
Total

Chi square 7.99


Degree of (r-1)(c-1)
Dof 2

p value 0.018379
Reject Ho if this value is less than 0.05

chi sq test for independence Ho: 2 attributes are independent of each other
H1: 2 attribues are not independent of each other

if p< alpha we reject h0


Observed Frequencies (fij)
Column 1 Column 2 Column 3 Total
Row 1 40 25 5 70
Row 2 35 35 10 80
Row 3 25 10 15 50
Total 100 70 30 200

Expected Frequencies (eij)


Column 1 Column 2 Column 3 Total
ng Expected Frequency table is necessary.
you can either create the Chi-square table Row 1 35 24.5 10.5 70
or use the direct formula Row 2 40 28 12 80
Row 3 25 17.5 7.5 50
Total 100 70 30 200

Chi-squre calculation (fij-eij)^2/eij


t formula CHISQ.TEST() Response 1 2 3 Total
Row 1 0.71 0.01 2.88 3.61
Row 2 0.63 1.75 0.33 2.71
Row 3 0.00 3.21 7.50 10.71

Chi-Square 17.03
Dof (row-1)*(column-1) 4

0.001909
Less than 0.05 so reject Ho
Type I

Ho
Ha

Population 1
Population 2

n1 26 n2 25
s1 170 s2 100
s1^2 28900 s2^2 10000

Remember that the population having a higher variance needs to be taken as numerator

F 2.89
dof(num) 25
dof(den) 24

Now, look for 2.89 in the F table with numerator dof as 25 and denominator dof as 24 and note down the prob va

p value
If less than 0.05 then reject null hypothesis
Type II

If data is given in the form of tables then use Data

Ho S sq 1 <= S sq 2 Data Analysis- F-Test: Two Sample for Variance


H1 S sq 1 > S sq 2
The p value is given for one tail so in case the hypo
Compare with 0.05, if less than reject Ho

F value calculation
compare f stats and f cv
F value 2.347878
F test stat < F CV
Level of significance 0.05 Do not reject Ho
dof_numerator 10
dof_denominator 20

24 and note down the prob value


e form of tables then use Data Analysis tool

t: Two Sample for Variance

or one tail so in case the hypothesis is for two tail then x2


if less than reject Ho
2 sample t test

T test 2 smaple assuming equal varinace


T stat < T one tailed CV
Do not reject Ho

T test 2 sample assuming unequal varinace T test paired 2 sample for mean
ed 2 sample for mean
Develop the analysis of variance computa
A B C design. At α =_x0002_ .05, is there a signi
136 107 92
120 114 82
113 125 85 H0: muA=muB=muC
107 104 101 Ha: not same
131 107 89
114 109 117
129 97 110
102 114 120
104 98
89 106

sample (n j) 8 10 10
x(bar) 119.00 107.00 100.00 Average 107.93
variance 146.86 96.44 173.78 n (T) 28
St dev 12.12 9.82 13.18 k 3
k-1 2

SSTR calculation 980.61 8.62 628.62


SSTR 1617.86
MSTR 808.93 (between treatments estimate of population variance)

SSE calculation 1028 868 1564


SSE 3460
MSE 138.4 (within treatments estimate of population variance)

Anova table
Source of variation Sum of Square dof mean sq F p value
Treatments 1617.86 2.00 808.93 5.84 0.01
Errors 3460.00 25.00 138.40
Total 5077.86 27.00

p value 0.01
p value is less than 0.05 and hence reject HO

Anova: Single Factor

SUMMARY
Groups Count Sum Average Variance
A 8 952 119 146.8571
B 10 1070 107 96.44444
C 10 1000 100 173.7778
Data analysis table - Excel
ANOVA
Source of Variation SS df MS F P-value F crit
Between Groups 1617.86 2.00 808.93 5.84 0.01 3.39
Within Groups 3460.00 25.00 138.40

Total 5077.86 27.00

Conclusion: Not all population means are equal.


he analysis of variance computations for the following completely randomized
α =_x0002_ .05, is there a significant difference between the treatment means?

Case where sample size is different. Another case where sample size is same, refer q1 session 18
Equation : y=0.2+2.6*x
For SST For SSE

Xi Yi Yi-Ybar (Yi-Ybar)^2 Y hat Yi-Y hat


1 3 -5 25 2.8 0.2
2 7 -1 1 5.4 1.6
3 5 -3 9 8 -3
4 11 3 9 10.6 0.4
5 14 6 36 13.2 0.8

Can be solved directly by going


to Data Analysis and selecting
Y bar 8 Regression
SST 80
SSE 12.4

SST=SSR+SSE
SSR=SST-SSE 67.6

Coefficient of Determination r^2 SSR/SST 0.845


: y=0.2+2.6*x

(Yi-Y hat)^2
0.04
2.56
9
0.16
0.64

olved directly by going


Analysis and selecting
Regression
1 Drug Infection No infectioSum Oi Ei
Administering drug 144 312 456 144 212.8
Without administering drug 192 72 264 192 123.2
336 384
Ho : Drug and infection 720
are 312 243.2
Ho : independent : Drug is not
H1 : Drug and infection are 72 140.8
H1: dependenteffective
on each other : Chi sq val :
Drug is effective
(no of coluDegree of freedom=(1)(1)=
Critical value at Alpha = 0.05 and dF=1 is 3.84 (alpha assumed as it is not given)
Since chi value is greater than 3.84 (critical value). Therefore, we reject Ho. This means that the drug is effective.

chi from excel 3.841459

if chi sq val > chi cv reject h0

CHI SQ TEST FOR INDEPEDENCE

Ho:2 attribues are independent of each other


H1:2 attributes are not independent of each other

degree of freedom row-1* column -1


(Oi-Ei)^2/Ei
22.243609023
38.420779221
19.463157895
33.618181818
113.74572796 evidence to reject
Ho.
Degree of freedom=(1)(1)=1
Larger the test statistic, more evidence to reject Ho.
hat the drug is effective.

dregree of frredom

CHI SQ TEWST FOR GOODNESS OF FIT

Ho:test is a good fit for calculation


H1: not a good fit

k(p-1) If mean is given p=0 if not given p=1

if value is less than 5 clun together


1 A B C Always use WITHOUT REPLICAT
3 6 7
4 3 3
3 3 4
5 4 6
0 0 5

Anova: Single Factor

SUMMARY
Groups Count Sum Average Variance
A 5 15 3 3.5
B 5 16 3.2 4.7
C 5 25 5 2.5

ANOVA
Source of VariationSS df MS F P-value F crit
Between Groups 12.13333 2 6.066667 1.700935 0.22369 3.885294
Within Groups 42.8 12 3.566667

Total 54.93333 14
F test < F critical
P value > 0.05 (alpha) : Do not reject Ho : So all schools are equally effective.
lways use WITHOUT REPLICATION!
Anova: Two-Factor Without Replication
12 Column1
23
33 Mean 21.909090909
16 Standard Error 2.2901153026
19 Median 23
20 Mode #N/A
24 Standard Deviation 7.5954531854
28 Sample Variance 57.690909091
9 Kurtosis -0.7319509305
26 Skewness -0.262651537
31 Range 24
Minimum 9
Maximum 33
Sum 241
Count 11
Confidence Level(95.0%) 5.1026948812
Column1
17.5
Mean 21.90909 27
Standard E 2.290115
Median 23
This chart isn't available in your version of Excel.
Mode #N/A
Standard D 7.595453 Editing this shape or saving this workbook into a different file form
Sample Var 57.69091 permanently break the chart.
Kurtosis -0.731951
Skewness -0.262652
Range 24
Minimum 9
Maximum 33
Sum 241
Count 11
Largest(1) 33
Smallest(1) 9
Confidence 5.102695
sion of Excel.

kbook into a different file format will

You might also like