Spss & minitab

23
Akram Ullah M.Sc Statistics UOP Page 1 Practical # 1 One Sample t-Test (SPSS) Ten individuals are chosen at random from a normal population and the heights are found to be in inches 63, 63, 66, 67, 68, 69, 70, 70, 71 and 71. In the light of these data, discuss the suggestion that mean height in the population is 66 inches. Solution: Step1: First we create a variable “Height” in the variable view and then data is entered in the Data view. Step 2: In order to apply one sample t-test” first we click on the “Analyze” menu and select “Compare means” then another menu will appear and click on “one sample t - test”. Step 3: A window will appear now shift variable “Height” to the test variable and enter “66” for test value. Step 4: Then click on “OK” and the results will appear in output window. One-Sample Statistics N M ean Std. Deviation Std. Error Mean Height 10 67.8000 3.01109 .95219 One-Sample Test Test Value = 66 T df Sig. (2-tailed) Mean Difference 95% Confidence Interval of the Difference Lower Upper Height 1.890 9 .091 1.80000 -.3540 3.9540 Decision: Since the p value is greater then 0.05, hence we do not reject H0and concluded that the mean height in the population is “66” inches.

Transcript of Spss & minitab

Page 1: Spss & minitab

Akram Ullah M.Sc Statistics UOP

Page 1

Practical # 1 One Sample t-Test (SPSS)

Ten individuals are chosen at random from a normal population and the heights

are found to be in inches 63, 63, 66, 67, 68, 69, 70, 70, 71 and 71. In the light of these

data, discuss the suggestion that mean height in the population is 66 inches.

Solution:

Step1: First we create a variable “Height” in the variable view and then data is entered in

the Data view.

Step 2: In order to apply “one sample t-test” first we click on the “Analyze” menu

and select “Compare means” then another menu will appear and click on “one sample t-

test”.

Step 3: A window will appear now shift variable “Height” to the test variable and

enter “66” for test value.

Step 4: Then click on “OK” and the results will appear in output window.

One-Sample Statistics

N Mean Std. Deviation Std. Error Mean

Height 10 67.8000 3.01109 .95219

One-Sample Test

Test Value = 66

T df Sig. (2-tailed) Mean Difference

95% Confidence Interval of the

Difference

Lower Upper

Height 1.890 9 .091 1.80000 -.3540 3.9540

Decision:

Since the p value is greater then “0.05” , hence we do not reject “H0” and

concluded that the mean height in the population is “66” inches.

Page 2: Spss & minitab

Akram Ullah M.Sc Statistics UOP

Page 2

Practical # 2 Paired Samples t-Test (SPSS) The following data gives paired yields of two varieties of wheat. Each pair was

planted in a different locality. Test the hypothesis that the mean yields are equal. Variety 1: 45 32 58 57 60 38 47 51 42 38 Variety 2: 47 34 60 59 63 44 49 53 46 41

Solution:

Step 1: First we create two variables in the variable view. The “v1” variable is

create for Variety 1 and “v2” variable is create for Variety 2. Then enter the given data in

the “Data view”. Step 2: To apply “Paired samples t-test” we click on “Analyze” menu and select

“compare mean”, a menu will appear and then we click on “Paired samples t-test”. Step 3: A new dialog box will appear. We shift variable “v1” to variable 1 and

variable “v2” to variable 2 and click on “OK”. Step 4: The results will appear in the output window.

Paired Samples Statistics

Mean N Std. Deviation Std. Error Mean

Pair 1 v1 46.80 10 9.555 3.021

v2 49.60 10 9.168 2.899

Paired Samples Correlations

N Correlation Sig.

Pair 1 v1 & v2 10 .991 .000

Paired Samples Test

Paired Differences

t df

Sig. (2-

tailed)

Mean

Std.

Deviation

Std. Error

Mean

95% Confidence Interval

of the Difference

Lower Upper

Pair 1 v1 -

v2

-2.800 1.317 .416 -3.742 -1.858 -6.725 9 .000

Decision: Since the p value is less then “0.05”. Hence we reject “H0” and concluded

that the mean yields of Variety 1 and Variety 2 are not equal.

Page 3: Spss & minitab

Akram Ullah M.Sc Statistics UOP

Page 3

Practical # 3 One Way ANOVA (SPSS) Given the data below test the hypothesis that the means of the three

populations are equal. Let α=0.05 Sample 1: 40 50 60 65 Sample 2: 70 65 66 50

Sample 3: 45 38 60 42

Solution:

Step 1: First we create two variables in the “variable view”. The variable

“sample” is created for the given data of the all three samples and “Factor” variable is

created for the subscripts of the samples. Assigned values “1” for sample 1, “2” for

sample 2 and “3” for sample 3. The data is entered in the “Data view”. Step 2: To apply “One Way ANOVA” first we click on “Analyze” menu and select

“compare mean”, another menu will appear and then we click on “One Way ANOVA”.

Step 3: A window will appear now we shift variable “s_data” to the “dependent

list” dialog box and variable “Factor” to “Factor” dialog box and click on “OK”. Step 4: The results will appear in the output window. Which are shown below.

One way

ANOVA

Sample data

Sum of Squares df Mean Square F Sig.

Between Groups 546.000 2 273.000 2.804 .113

Within Groups 876.250 9 97.361

Total 1422.250 11

Decision:

Since the p value is greater then 0.05. Hence we do not reject “H0” and

concluded that all the three means are equal.

Page 4: Spss & minitab

Akram Ullah M.Sc Statistics UOP

Page 4

Practical # 4 Correlation Coefficient (SPSS) Calculate co-efficient of correlation between X and Y from the following data. X: 1 2 3 4 5 Y: 2 5 3 8 7 Solution:

Step 1: First we create two variables “X” and “Y” in the “variable view”. And then

the data is entered in the “Data view”. Step 2: To apply “correlation” first we click on “Analyze” menu and select

“correlate”, another menu will appear and then we click on “bivariate”. Step 3: A window will appear now we shift variables “X” and “Y” to the

“variables” dialog box and click on “option”. Another window will appear we mark

means and standard deviations and then click on “continue” button. Step 4: Then click on “OK” and the results will appear in the output window.

Correlations

Descriptive Statistics

Mean Std. Deviation N

X 3.00 1.581 5

Y 5.00 2.550 5

Correlations

X Y

X Pearson Correlation 1 .806

Sig. (2-tailed) .099

N 5 5

Y Pearson Correlation .806 1

Sig. (2-tailed) .099

N 5 5

Decision:

Since the p value is greater then 0.05. Hence we do not reject our null hypothesis

and concluded that the correlation is significant.

Page 5: Spss & minitab

Akram Ullah M.Sc Statistics UOP

Page 5

Practical # 5 Sign Test (SPSS) Apply Sign test Weight before: 125 195 171 140 201 170 176 195 139 Weight after: 136 201 158 145 195 175 190 190 145

Solution:

Step 1: First we create two variables “before” and “after” in “Variable View”. And

then data is entered in the “Data view”. Step 2: To apply “sign test” first we click on “Analyze” menu and select “Non-

paramedics test” and click on “2-related samples”.

Step-3: A new window will appear where we have to shift the variable “after” to

the dialog box “variable 1” and the variable “before” to dialog box “variable 2”. And click

on “sign”. Step-4: Then we click on “OK” and the output will appear in out put window.

Sign Test

Frequencies

N

Weight before - Weight after Negative Differencesa 7

Positive Differencesb 3

Tiesc 0

Total 10

a. Weight before < Weight after

b. Weight before > Weight after

c. Weight before = Weight after

Test Statisticsb

Weight before - Weight after

Exact Sig. (2-tailed) .344a

a. Binomial distribution used.

b. Sign Test

Decision:

The p value is greater then 0.05. Hence we do not reject H0 and concluded that the

programme does not affect on the average weight of recruits.

Page 6: Spss & minitab

Akram Ullah M.Sc Statistics UOP

Page 6

Practical # 6 Willcoxon Sign rankTest (SPSS) Apply

Willcoxon Sign rank test Weight before: 125 195 171 140 201 170 176 195 139 Weight after: 136 201 158 145 195 175 190 190 145

Solution:

Step 1: First we create two variables “before” and “after” in “Variable View”. And

then data is entered in the “Data view”. Step 2: To apply “sign test” first we click on “Analyze” menu and select “Non-

parametic test” and click on “2-related samples”.

Step-3: A new window will appear where we have to shift the variable “after” to

the dialog box “variable 1” and the variable “before” to dialog box “variable 2”. And click

on “willcoxon”. Step-4: Then we click on “OK” and the output will appear in out put window.

Sign Test

Frequencies

N

Weight before - Weight after Negative Differencesa 7

Positive Differencesb 3

Tiesc 0

Total 10

a. Weight before < Weight after

b. Weight before > Weight after

c. Weight before = Weight after

Test Statisticsb

Weight before - Weight after

Exact Sig. (2-tailed) .344a

a. Binomial distribution used.

b. Sign Test

Decision:

The p value is greater then 0.05. Hence we do not reject H0 and concluded that the

programme does not affect on the average weight of recruits.

Page 7: Spss & minitab

Akram Ullah M.Sc Statistics UOP

Page 7

Practical # 7 Median Test (SPSS) The following data represent the operating times in hours for three types of

scientific pocket calculators before a recharge is required: Calculator A: 4.9 6.1 4.3 4.6 5.3 Calculator B: 5.5 5.4 6.2 5.8 5.5 5.2 4.8 Calculator C: 6.4 6.8 5.6 6.5 6.3 6.6 Use the Median Test to test

the hypothesis that the operating times for all three calculators are equal. Solution: Step 1: First we create two variables in the “Variable View”. Step 2: To apply “Median Test” first we click on “Analyze” menu and select “Non-

parametric test” and click on “K-independent”. Step 3: Now we shift the variable “factor” to the factor dialog box and “response” to the

response dialog box. and click on “Median”. Step 4: Then we click

on “OK” and the output will appear in out put window. Median Test

Frequencies

factor

1 2 3

response > Median 1 2 6

<= Median 4 5 0

Test Statisticsb

response

N 18

Median 5.55

Chi-Square 9.086a

df 2

Asymp. Sig. .011

a. 6 cells (100.0%) have expected frequencies less than 5. The minimum expected cell

frequency is 2.5.

Decision: Since p value is greater then 0.01. Hence we do not reject (H0) and

concluded that the operating times for all three calculators are equal.

Page 8: Spss & minitab

Akram Ullah M.Sc Statistics UOP

Page 8

Practical # 8 Run Test (SPSS) Each day a sample of 10 production items was taken and the mean weight computed.

Following are the first 20 daily means:13.0 12.8 12.9 13.0 12.9 12.6 12.6

12.7 12.9 13.1 13.1 13.2 13.3 13.2 13.1 12.9 13.2 13.3 13.2 Are the number of runs below and above the median significant at the 5 percent level? Solution: Step 1: First we create a variable “mean” in the “Variable View”. And data is

entered in the “Data view”.

Step 2: To apply the “run test” first we click on “Analyze” menu and select “Non-

parametric test” and click on “runs”.

Step 3: A new window will appear where we have to shift the variable “mean” to

the “test variable” dialog box and click on the “option” button. A new window will

appear we click on the “descriptive” dialog box and then click on the “continue” button.

Step 4: We click on “OK” and the output will appear in the output window.

NPar Tests

Descriptive Statistics

N Mean Std. Deviation Minimum Maximum

mean 20 13.005 .2139 12.6 13.3

Runs Test

mean

Test Valuea 13.1

Cases < Test Value 10

Cases >= Test Value 10

Total Cases 20

Number of Runs 6

Z -2.068

Asymp. Sig. (2-tailed) .039

a. Median

Decision: Since p value is less then 0.05. Hence we reject (H0) and concluded that the

number of runs below and above the median is significant.

Page 9: Spss & minitab

Akram Ullah M.Sc Statistics UOP

Page 9

Practical # 9 Kalmogorov – Smirnov Test (SPSS) The following scores were obtained by rolling a six-sided die 10 times: Scores: 3 4 4 2 6 6 3 4 2 5 Use

the Kalmogorov – Smirnov Test to test the hypothesis that at is a sample from a uniform

distribution at α = “0.05”. Solution: Step 1: First of all we have to create a variable “score” in the “Variable View”.

And the given data is entered in the “Data view”. Step 2: To apply the “Kalmogorov – Smirnov Test” first we click on “Analyze”

menu and select “Non-parametric test” and click on “1- sample K-S…”. Step 3: A window will appear where we have to shift the variable “score” to the

“test variable list” and click on the “option” button. A new window will appear we click

on the “descriptive” dialog box and then click on the “continue” button. Then we click

on “uniform” dialog box. Step 4: Then we click on “OK” and the output will appear in the output window.

NPar Tests

Descriptive Statistics

N Mean Std. Deviation Minimum Maximum

score 10 3.90 1.449 2 6

One-Sample Kolmogorov-Smirnov Test

score

N 10

Uniform Parametersa,,b Minimum 2

Maximum 6

Most Extreme Differences Absolute .200

Positive .200

Negative -.200

Kolmogorov-Smirnov Z .632

Asymp. Sig. (2-tailed) .819

a. Test distribution is Uniform.

b. Calculated from data.

Decision: Since the p value is greater then 0.05. Hence we do not reject (H0) and

concluded that at is a sample from a uniform distribution.

Page 10: Spss & minitab

Akram Ullah M.Sc Statistics UOP

Page 10

Practical # 10 Mann-Whitney U test (SPSS) Two independent samples given below are from two populations. Sample 1: 38 49 45 29 31 35 Sample 2: 31 42 22 26 43 37 25 30 47 Apply the “Mann-Whitney U test” to test the hypothesis that the two samples come

from population having identical distribution. Use a “0.05”level of significance. Solution: Step 1: First of all we have to create two variables in the “Variable View”. The

variable “response” is created for the given data of the two samples and the variable

“Factor” is created for the subscripts of the samples. Assigned values “1” for sample 1

and “2” for sample 2. And the data is entered in the “Data view”. Step 2: To apply “Kalmogorov – Smirnov Test and Mann-Whitney U test” first of

all we have to click on the “Analyze” menu and select “Non-parametric test” and click on

“2-independent samples”. Step 3: A new window will appear where we have to shift the variable “factor” to

the “grouping variable” dialog box and “response” to the “test variable list” dialog box

and click on “Define Groups” a new window will appear and we enter “1” in the “Group

1” dialog box and “2” in the “Group 2”dialog box and click on continue then click on

“Kalmogorov – Smirnov” and “Mann-Whitney U”. Step 4: Then we click on “OK” and the output will appear in out put window.

NPar Tests

Descriptive Statistics

N Mean Std. Deviation Minimum Maximum

respons 15 35.33 8.482 22 49

factor 15 1.60 .507 1 2

Mann-Whitney Test

Ranks

factor N Mean Rank Sum of Ranks

respons sample 1 6 9.42 56.50

sample 2 9 7.06 63.50

Total 15

Page 11: Spss & minitab

Akram Ullah M.Sc Statistics UOP

Page 11

Test Statisticsb

respons

Mann-Whitney U 18.500

Wilcoxon W 63.500

Z -1.003

Asymp. Sig. (2-tailed) .316

Exact Sig. [2*(1-tailed Sig.)] .328a

a. Not corrected for ties.

b. Grouping Variable: factor

Decision:

Since the p value is greater then 0.05. Hence we do not reject (H0) and concluded

that the two samples come from population having identical distribution.

Page 12: Spss & minitab

Akram Ullah M.Sc Statistics UOP

Page 12

MINITAB

PRACTICAL

Practical # 11 One Way ANOVA (MINITAB)

Page 13: Spss & minitab

Akram Ullah M.Sc Statistics UOP

Page 13

Given the data below, test the hypothesis that the means of the three

populations are equal.

Sample 1: 45 60 38 57

Sample 2: 73 58 55 75

Sample 3: 47 42 65 41

Solution:

Step 1: First of all we enter the data of all the three samples separately in column

C1,C2 and C3 in the “Data window”. And assigned labels “sample 1” to C1, “sample 2”

to C2 an sample 3” to C3.

Step 2: In order to apply “One Way ANOVA” first we click on “stat” menu and

select “ANOVA”, another menu will appear and then we click on “oneway (unstacked)”.

Step 3: A new window will appear now we shift all the three variables in to the

“responses” dialog box.

Step 4: Then click on “OK” and the results will appear in the session window.

One-Way Analysis of Variance

Analysis of Variance

Source DF SS MS F P

Factor 2 675 338 3.03 0.099

Error 9 1004 112

Total 11 1679

Individual 95% CIs For Mean

Based on Pooled StDev

Level N Mean StDev ----------+---------+---------+-----

-

C1 4 50.00 10.30 (---------*---------)

C2 4 65.25 10.21 (---------*---------)

C3 4 48.75 11.15 (---------*---------)

----------+---------+---------+-----

-

Pooled StDev = 10.56 48 60 72

Decision:

Since the p value is greater then “0.05” therefore we do not reject our null

hypothesis.

Practical # 12 One Sample t-Test (MINITAB)

Apply the one sample t-test in the following data.

Page 14: Spss & minitab

Akram Ullah M.Sc Statistics UOP

Page 14

12 20 31 35 38 40 17 22 27

Solution:

Step 1: First we entered the given data in C1 in the “Data window”.

Step 2: In order to apply “one sample t-test” first we click on the “stat” menu and

select “Basic Statistics” then another menu will appear and click on “1-Sample t…”.

Step 3: A window will appear now we shift variable “C1” to the test variables and

click on “test mean” .

Step 4: We click on “OK” and the result will appear in the session window.

T-Test of the Mean

Test of mu = 0.00 vs mu not = 0.00

Variable N Mean StDev SE Mean T P

C1 9 26.89 9.80 3.27 8.23 0.0000

Decision:

Since the p value is less then “0.05”. Hence we reject our null hypothesis.

Practical # 13 Two sample t-Test (MINITAB)

Page 15: Spss & minitab

Akram Ullah M.Sc Statistics UOP

Page 15

The following data gives paired yields of two varieties of wheat. Each pair was

planted in a different locality. Test the hypothesis that the mean yields are equal.

Variety 1: 32 58 57 38 47 51 38

Variety 2: 47 60 63 49 53 46 41

Solution:

Step 1: First we have enter the values of variety 1 in “C1” and variety 2 in “C2” in

the “Data window”.

Step 2: Then we click on the “stat” menu and select “Basic Statistics” then

another menu will appear and click on “2-Sample t…”.

Step 3: A window will appear now we click on “samples in different columns” the

the two dilogs boxes will appear then we have to shift shift variable “C1” to the “First”

dilog box and shioft “C2” to the “second” dilog box.

Step 4: We click on “OK” and the result will appear in the session window.

Two Sample T-Test and Confidence Interval

Two sample T for C1 vs C2

N Mean StDev SE Mean

C1 7 45.9 10.1 3.8

C2 7 51.29 7.89 3.0

95% CI for mu C1 - mu C2: ( -16.1, 5.2)

T-Test mu C1 = mu C2 (vs not =): T= -1.12 P=0.29 DF= 11

Decision:

Since the p value is greater then “0.05”. Hence we do not reject “H0” and

concluded that the mean yields of Variety 1 and Variety 2 are equal.

Practical # 14 One sample sign test (MINITAB)

Page 16: Spss & minitab

Akram Ullah M.Sc Statistics UOP

Page 16

A sample of size 8 was chosen from a population. The sample observations are

given below: 3.55, 5.62, 3.93, 3.46, 2.95, 5.55, 3.11 and 1.90.

Use sign test to test the hypothesis that the median of the population equal to 3.

Solution:

Step 1: First we enter the values of the given sample in the column “C1” in the

“Data window”.

Step: 2 An apply “1-sample sign test” we click on “stat” menu and select

“Nonparametrics” a new menu will appear and then we click on “1-sample sign”.

Step 3: A new window will appear then we shift “C1” to the “variables” dialog

box and click on “test mean” a dialog box will appear then we enter “2” in the “test

median” dialog box.

Step 4: We click on “OK” and the result will appear in the “session window”.

Sign Test for Median

Sign test of median = 3.000 versus not = 3.000

N Below Equal Above P Median

C1 7 1 0 6 0.1250 3.550

Decision:

Since the p value is greater then 0.05. Hence we do not reject our null hypothesis

and concluded that the median of the population is equal to 3.

Practical # 15 Regression (MINITAB) Use the following data to test the hypothesis that the regression is linear at the 0.05

Page 17: Spss & minitab

Akram Ullah M.Sc Statistics UOP

Page 17

level of significance.

X: 1 2 3 4 5 6 7 8

Y: 3 5 8 11 12 17 19 20

Solution:

Step 1: First we enter the values of “X” in to “C1” and the values of “Y” in to “C2”

in the “Data window”. And assigned labels “X” to “C1” and “Y” to “C2”.

Step 2: To apply “Regression” first we click on “stat” menu and select

“regression”, a new menu will appear and click on “regression”.

Step 3: A new window will appear then we shift variable “X” to “Response” dialog box

and variable “Y” to “Predictors” dialog box.

Step 4: Click on “OK” and the results will appear in the session window.

Regression Analysis

The regression equation is

C1 = - 0.023 + 0.381 C2

Predictor Coef StDev T P

Constant -0.0228 0.2642 -0.09 0.934

C2 0.38087 0.01988 19.16 0.000

S = 0.3356 R-Sq = 98.4% R-Sq(adj) = 98.1%

Analysis of Variance

Source DF SS MS F P

Regression 1 41.324 41.324 366.93 0.000

Error 6 0.676 0.113

Total 7 42.000

Decision: Since the p value is less then “0.05” . Hence we reject our null hypothesis and concluded that the variables “X” and “Y” are dependent to each other.

Practical # 16 Mann-Whitney U test (MINITAB)

Two independent samples given below are from two populations.

Page 18: Spss & minitab

Akram Ullah M.Sc Statistics UOP

Page 18

Sample 1: 38 49 45 29 31 35

Sample 2: 31 42 22 26 43 37

Apply the “Mann-Whitney U test” to test the hypothesis that the two samples

come from population having identical distribution. Use a “0.05”level of significance.

Solution:

Step 1: First we have entered the data of sample 1 in “C1” and the data of

sample 2 in “C2” in the “Data window”.

Step: 2 To apply “Mann-Whitney U test” we click on “stat” menu and select

“Nonparametric” a new menu will appear and then we click on “Mann-Whitney”.

Step 3: A new window will appear then we shift “C1” to the “First Sample” dialog

box and also shift “C2” to the “Second Sample” dialog box.

Step 4: We click on “OK” and the result will appear in the “session window”.

Mann-Whitney Confidence Interval and Test C1 N = 6 Median = 36.50

C2 N = 6 Median = 34.00

Point estimate for ETA1-ETA2 is 4.50

95.5 Percent CI for ETA1-ETA2 is (-7.99,16.00)

W = 44.5

Test of ETA1 = ETA2 vs ETA1 not = ETA2 is significant at 0.4233

The test is significant at 0.4225 (adjusted for ties)

Cannot reject at alpha = 0.05

Practical # 17 Kruskal Wallis Test(MINITAB) The following data represent the operating times in hours for three types of

scientific pocket calculators before a recharge is required:

Page 19: Spss & minitab

Akram Ullah M.Sc Statistics UOP

Page 19

Calculator A: 4.9 6.1 4.3 4.6 5.3 Calculator B: 5.5 5.4 6.2 5.8 5.5 5.2 4.8 Calculator C: 6.4 6.8 5.6 6.5 6.3 6.6 Use the Kruskal Willis Test to test the hypothesis that the operating times for all

three calculators are equal.

Solution:

Step 1: First of all we have entered the values of all the three samples in the

column “C1” and their corrosponding subscripts in “C2” in the “Data window”.

Step 2: An ordered to apply “Kruskal wallis test” we click on “stat” menu and

select “Nonparametrics” a new menu will appear and then we click on “kurskal -wallis”.

Step 3: A new window will appear then we shift “C1” to the “Response” dialog

box and also shift “C2” to the “Factor” dialog box.

Step 4: We click on “OK” and the result will appear in the “session window”.

Kruskal-Wallis Test Kruskal-Wallis Test on C1

C2 N Median Ave Rank Z

1 5 4.900 5.0 -2.22

2 7 5.500 8.0 -0.95

3 6 6.450 15.0 3.09

Overall 18 9.5

H = 10.47 DF = 2 P = 0.005

H = 10.48 DF = 2 P = 0.005 (adjusted for ties)

Decision:

Since the p value is less then “0.05”. Hence we reject our null hypothesis (H0) and

concluded that the operating times for all three calculators are not equal.

Practical # 18 Run Test (MINITAB)

Page 20: Spss & minitab

Akram Ullah M.Sc Statistics UOP

Page 20

Each day a sample of 10 production items was taken and the mean weight

computed. Following are the first 20 daily means:

13.0 12.8 12.9 13.0 13.1 12.9 12.6 12.6 12.7 12.9 13.1 13.1

13.2 13.3 13.2 13.1 12.9 13.2 13.3 13.2

Are the number of runs below and above the median significant at the 5 percent level?

Solution:

Step 1: First we enter the values of the given sample in the column “C1” in the

“Data window”.

Step 2: To apply “runs test” we click on “stat” menu and select “Nonparametrics”

a new menu will appear and then we click on “Runs test”.

Step 3: A new window will appear then we shift “C1” to the “variables” dialog

box and click on “Above and below the median”.

Step 4: Then click on “OK” and the result will appear in the “session window”.

Runs Test

C1

K = 13.0050

The observed number of runs = 6

The expected number of runs = 11.0000

10 Observations above K 10 below

* N Small -- The following approximation may be invalid

The test is significant at 0.0218

Page 21: Spss & minitab

Akram Ullah M.Sc Statistics UOP

Page 21

Practical # 19 Median test (MINITAB) The following data represent the operating times in hours for three types of

scientific pocket calculators before a recharge is required: Calculator A: 4.9 6.1 4.3 4.6 5.3 Calculator B: 5.5 5.4 6.2 5.8 5.5

Calculator C: 6.4 6.8 5.6 6.5 6.3 Use the Mood’s Median Test to test the hypothesis that the operating times for

all three calculators are equal.

Solution:

Step 1: First we have entered the values of all the three samples in the column

“C1” and their corresponding subscripts in “C2” in the “Data window”.

Step 2: To apply “Kruskal wallis test” we click on “stat” menu and select

“Nonparametric” a new menu will appear and then we click on “kurskal-wallis”.

Step 3: A window will appear then we shift “C1” to the “Response” dialog box

and also shift “C2” to the “Factor” dialog box.

Step 4: Then click on “OK” and the result will appear in the “session window”.

Mood Median Test Mood median test for C1

Chi-Square = 3.75 DF = 2 P = 0.153

Individual 95.0% CIs

C2 N<= N> Median Q3-Q1 ---------+---------+---------+-------

1 4 1 4.90 1.25 (--------+----------------)

2 3 2 5.50 0.55 (-+---------)

3 1 4 6.40 0.70 (----------+-----)

---------+---------+---------+-------

4.90 5.60 6.30

Overall median = 5.60

* NOTE * Levels with < 6 observations have confidence < 95.0%

Decision:

Since according p value is greater then “0.05”. Hence we do not reject our null

hypothesis and concluded that the operating times for all three calculators are equal.

Page 22: Spss & minitab

Akram Ullah M.Sc Statistics UOP

Page 22

Practical # 20 Chi square test (MINITAB)

from the adult male population of seven large cities, random samples of sizes

indicated below were taken, and the numbers of married and single men recorded.

City A B C D E F G

Married

Single

133 164 155 106 153 123 116

36 57 40 37 55 33 36

Test the hypothesis at the “0.05” level of significance that the proportions of

married men are the same in all the seven cities.

Solution:

Step 1: First of all we enter the data of all the seven cities separately in column

C1, C2, C3, C4, C5, C6 and C7 respectively in the “Data window”.

Step 2: To apply “Chi-square test” first we click on “stat” menu and select “tables” then

another menu will appear and then we click on “Chi-square test…”.

Step 3: A window will appear now we shift all the seven variables in to the

“Column containing the table” dialog box.

Step 4: Then we click on “OK” and the results will appear in the session window.

Chi-Square Test

Expected counts are printed below observed counts

A B C D E F G

Total

1 133 164 155 106 153 123 146

980

130.00 170.00 150.00 110.00 160.00 120.00 140.00

2 36 57 40 37 55 33 36

294

39.00 51.00 45.00 33.00 48.00 36.00 42.00

Total 169 221 195 143 208 156 182

1274

Chi-Sq = 0.069 + 0.212 + 0.167 + 0.145 + 0.306 + 0.075 + 0.257 +

0.231 + 0.706 + 0.556 + 0.485 + 1.021 + 0.250 + 0.857 = 5.337

DF = 6, P-Value = 0.501

Decision: Since the p value is greater then “0.05” we do not reject our null

hypothesis and concluded that the proportions of married men are the same in all the seven cities.

Page 23: Spss & minitab

Akram Ullah M.Sc Statistics UOP

Page 23