0% found this document useful (0 votes)
13 views

New Math-Lab-report

new

Uploaded by

Sahil Gupta
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

New Math-Lab-report

new

Uploaded by

Sahil Gupta
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

Tribhuvan University

Faculty of humanities and social science

Mechi Multiple Campus

Bhadrapur, Jhapa

BCA (Bachelor of Computer Application)

Third semester (3rd sem)

Report of Probability & Statistics (CACS202)

Submitted by: Submitted To:

Name: Manjil Timsina Name: Sabin Dahal

Roll No.: 32 Signature:


CERTIFICATE FROM THE SUPERVISOR

This certificate is to certify that the Lab Report entitled “Probability & Statistics”
is an academic work done by Manjil Timsina submitted in the partial fulfillment
of the requirements for the degree of Bachelor of Computer Application (BCA)
at faculty of Humanities and Social Science, Tribhuvan University under my
guidance and supervision. To the best of my knowledge, the worked performed
by him in the lab report is his own creation.

Name :

Designation :

Date :

..………………………

Signature of Supervisor
Table of Contents
Introduction: ............................................................................................................................. 1
Formula: ................................................................................................................................... 2
Steps to be followed in SPSS: ................................................................................................... 3
For Mean, Median, Mode, Percentile, SD, Variance, Range: .......................................................3
For Regression ...................................................................................................................................3
For Correlation: ................................................................................................................................3
For Binomial Distribution ................................................................................................................3
For Poisson Distribution ...................................................................................................................4
For One way ANOVA table: ............................................................................................................4
For Two way ANOVA table: ............................................................................................................4
Lab 1: ......................................................................................................................................... 5
Lab 2: ......................................................................................................................................... 6
Lab 3: ......................................................................................................................................... 7
Lab 4: ......................................................................................................................................... 8
Lab 5: ......................................................................................................................................... 9
Lab 6: ....................................................................................................................................... 10
Lab 7: ....................................................................................................................................... 11
Lab 8: ....................................................................................................................................... 12
Lab 9: ....................................................................................................................................... 13
Lab 10: ..................................................................................................................................... 14
Lab 11: ..................................................................................................................................... 15
Lab 13: ..................................................................................................................................... 17
Lab 14: ..................................................................................................................................... 18
Lab 15: ..................................................................................................................................... 19
Introduction:
SPSS, which stands for "Statistical Package for the Social Sciences," is a powerful software
program used for statistical analysis and data management. It is widely employed in various
fields, including social sciences, psychology, business, and healthcare, to analyze data and
make informed decisions based on research findings. Here's an introduction to SPSS and its
five main features:

1. Data Management: SPSS provides robust tools for data entry, manipulation, and
management. You can easily input data, import data from various file formats, clean and
transform data, and handle missing values. This feature streamlines the data preparation
process, ensuring your data is ready for analysis.

2. Statistical Analysis: SPSS offers a wide range of statistical techniques to explore and
analyze data. These include descriptive statistics (mean, median, mode), inferential
statistics (t-tests, ANOVA, regression), non-parametric tests, factor analysis, and more. It
allows you to perform both basic and advanced statistical analyses to uncover patterns,
relationships, and insights within your data.

3. Data Visualization: Visualization is a crucial aspect of data analysis, and SPSS offers
various tools to create meaningful graphs and charts. You can create bar charts, histograms,
scatterplots, and more to visually represent your data. Effective visualization helps you
communicate your findings and make data-driven decisions.

4. Reporting and Output: SPSS generates comprehensive and customizable output reports that
include tables, charts, and statistical summaries. These reports can be exported to various
formats, such as PDF, Word, Excel, or HTML, making it easy to share your results with
colleagues or stakeholders. SPSS also supports syntax, allowing you to automate and
reproduce analyses.

5. Data Mining and Predictive Analytics: SPSS includes advanced features for data mining
and predictive analytics. You can use techniques like decision trees, clustering, and logistic
regression to identify patterns and make predictions based on historical data. This is
particularly valuable in fields like marketing, where predictive modeling can inform future
strategies.

In addition to these five main features, SPSS offers a user-friendly interface that makes it
accessible to individuals with varying levels of statistical expertise. It's a versatile tool that
supports both basic data analysis tasks and complex research projects, making it a popular
choice for researchers and data analysts across different industries.

1
Formula:
a) Mean= Sx/n
b) Media= (n+1)/2
c) First quartile= (n+1)/4
d) Second quartile= 2(n+1)/4
e) Third quartile= 3(n+1)/4
f) 25th percentile= 25(n+1)/100
g) 50th percentile= 50(n+1)/100
h) 75th percentile= 75(n+1)/100
i) Range= Largest - Smallest(L-S)
j) Coefficient of Range= (L-S)/(L+S)
k) Interquartile Range= Q3-Q1
l) Quartile deviation= (Q3-Q1)/2
m) Cofficient of quartile deviation= (Q3-Q1)/(Q3+Q1)
n) Standard Deviation= √ [Σx^2/n-(Σx/n)^2]
o) Varience= σ^2
p) Cofficient of Varience= (σ / x̄)*100%

2
Steps to be followed in SPSS:

For Mean, Median, Mode, Percentile, SD, Variance, Range:


i. Enter the data as in Project.
ii. Select Data è Weight Case.
iii. Move Frequency into Frequency Variable
iv. Click ok. Select Analyze è Descriptive Statistics è Frequeccies.
v. Click the Frequeccies è Move Midvalue into Variables.
vi. Click the Statistics. Select Mean, Median, Mode, Percentile, SD,
Variance, Range.
vii. Click Continue. Click OK.

For Regression
i. Enter value of the variable X and Y.
ii. Select Aralyze è Regression è Linear.
iii. Move X into Independs (s) and Y into Depends (s). then click OK.

For Correlation:
i. Enter value of the variables X and Y.
ii. Select Aralyze è Correlate è Bivariate
iii. Move X and Y into Variable(s). Select Pearson. Then, click OK.

For Binomial Distribution


i. Click Analyze > Regression > Binary Logistic... on the main menu
ii. Transfer the dependent variable, into the Dependent: box, and the independent
variables, into the Covariates: box using buttons.
iii. Click the Categorical button.
iv. Transfer the categorical independent variable, from the Covariates: box to the
Categorical Covariates: box:
v. In the Change -Contract- area, change the Reference Category: from the Last
option to First option. Then click on the change button.
vi. Click on the continue button.
vii. Click on the Options… button.
viii. In the -Statistics and Plots- area, click the Classification plots, Hosmer-
Lemeshow googness-of-fit, Casewise listing of residuals and CI for exp(B):
options, and in the -Display- area, click the At last step option.
ix. Click on the continue button. You will be returned to the Logistic Regression
dialogue box.
x. Click on the OK button. This will generate the output.

3
For Poisson Distribution
i. Click Analyze > Generalized Linear Models > Generalized Linear
Models... on the main menu.
ii. Select Poisson loglinear in the Counts area.
iii. Select the Response tab.
iv. Transfer dependent variable using the button.
v. Select Predictors tab.
vi. Transfer the categorical independent variable into the Factors: box and the
continuous independent variable into Covariates: using the button.
vii. Select the Model tab.
viii. Keep the default of “Main effects” in the -build Term(s)- area and transfer the
categorical and continuous independent variables from the “Factors and
Covariates:” box into the “model:” box using the button.
ix. Select the “Estimation” tab.
x. Keep the default option selected.
xi. Select the “Statistics” tab.
xii. Select “Include exponential parameter estimates” in the “Print” area.
xiii. Click “OK” button. This will generate the output.

For One way ANOVA table:


i. Click Analyze > Compare Means > One-Way ANOVA.
ii. Add the variable Sprint to the Dependent List box, and add the variable
Smoking to the Factor box.
iii. Click Options. Check the box for Means plot, then click Continue.
iv. Click OK when finished.

For Two way ANOVA table:


i. Click the Analyze tab, then General Linear Model, then Univariate:
ii. Drag the response variable height into the box labelled Dependent variable.
Drag the two factor variables water and sun into the box labelled Fixed Factor:
iii. Next, click the Plots button. Drag water into the box labelled Horizontal axis
and sun into the box labelled Separate lines. Then click Add. The
words water*sun will appear in the box labelled Plots. Then click Continue.
iv. Next, click the Post Hoc button. In the new window that pops up, drag the
variable sun into the box labelled Post Hoc Tests for. Then check the box next
to Tukey. Then click Continue.
v. Next, click the EM Means button. Drag the following variables into the box
labelled Display Means for. Then click Continue.
vi. Lastly, Click OK. This will generate the Output.

4
Lab 1:

Find mean, median, mode, p25, p50, p75 from the following data:
Data: 10 20 30 40 50 60 70 80 90 30 25 31

Solution:

SPSS SYNTAX:
FREQUENCIES VARIABLES=x
/NTILES=4
STATISTICS=STDDEV VARIANCE RANGE MINIMUM MAXIMUM MEAN
MEDIAN
/ORDER=ANALYSIS.

Solution using SPSS:


Statistics
data
N Valid 12
Missing 0
Mean 44.6667
Median 35.5000
Mode 30.00
Std. Deviation 25.30660
Variance 640.424
Skewness 0.566
Std. Error of Skewness 0.637
Kurtosis -0.828
Std. Error of Kurtosis 1.232
Range 80.00
Sum 536.00
Percentiles 25 26.2500
50 35.5000
75 67.5000

From the above table, we found that Mean = 44.6667, Median = 35.5000, Mode = 30,
p25 = 26.2500, p50 = 35.5000, p75 = 67.5000.

5
Lab 2:

Find mean, median, mode, p25, p50, p75 from the following data:
Data: 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 50, 50, 50, 50,
50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 60, 60, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80

SPSS SYNTAX:
FREQUENCIES VARIABLES=x
/NTILES=4
STATISTICS=STDDEV VARIANCE RANGE MINIMUM MAXIMUM MEAN
MEDIAN
/ORDER=ANALYSIS.

Solution using SPSS:


Statistics
Data
N Valid 79
Missing 0
Mean 45.8861
Std. Error of Mean 2.22690
Median 49.0000
Mode 50.00
Std. Deviation 19.79315
Variance 391.769
Skewness -0.120
Std. Error of Skewness 0.271
Kurtosis -1.062
Std. Error of Kurtosis 0.535
Range 70.00
Minimum 10.00
Maximum 80.00
Sum 3625.00
Percentiles 25 29.0000
50 49.0000
75 61.0000

From the above table, we found that Mean = 45.8861, Median = 49.0000, Mode = 50.00,
p25 = 29.0000, p50 = 49.0000, p75 = 61.0000.

6
Lab 3:

Calculate Karl Pearsons correlation coefficient, coefficient of determination.

12 10 26 6 10 19 23 17 13.9 3 30 16 9 6 11 10 8.4
9.5 9 11.8 8 7 20 24 21 10.7 4 12 12 12 9 8.3 9 4.7

Solution using SPSS:


Correlations
Child
Nutrition
Mortality
Pearson
Child Mortality 1 .614**
Correlation
Sig. (2-tailed) 0.009
N 17 17
Pearson
Nutrition .614** 1
Correlation
Sig. (2-tailed) 0.009
N 17 17
**. Correlation is significant at
the 0.01 level (2-tailed).

From the above table, we found that Karl Pearsons correlation coefficient is .614**.

7
Lab 4:

Calculate the correlations Coefficients from the following data:

Age Blood Pressure


56 147
42 125
36 118
47 128
49 145
42 140
60 155
72 160
63 149
55 150

Solution using SPSS:

Correlations
Blood
Age
Pressure
Pearson
Age 1 .892**
Correlation
Sig. (2-tailed) 0.001
N 10 10
Pearson
Blood Pressure .892** 1
Correlation
Sig. (2-tailed) 0.001
N 10 10
**. Correlation
is significant at
the 0.01 level
(2-tailed).

From the above table, we found that the correlations Coefficients is .892**.

8
Lab 5:

find mean, median, quartilies, p25,p50 and p75


Data: 511, 512, 513, 514, 515, 516, 517, 518, 519, 501, 502, 503, 504, 505, 506, 507, 508, 509,
521, 522, 523, 524, 525, 526, 527, 528, 529, 541, 542, 543, 544, 545, 546, 547, 548, 549, 531,
532, 533, 534, 535, 536, 537, 538, 539

Solution using SPSS:


Statistics
Data
N Valid 45
Missing 0
Mean 525.0000
Median 525.0000
Percentiles 25 512.5000
50 525.0000
75 537.5000

From the above table, we found that Mean = 525.00, Median = 525.00, p25 = 512.50,
p50 = 525.00, p75 = 537.50.

9
Lab 6:

Fit the Poisson distribution and find the expected frequencies.

f 0 1 2 3 4 5 6 7
x 71 112 117 57 27 11 3 1

Solution using SPSS:


Expected Rounded
x f fx p(x) frequency Expected
NXp(x) frequency
0 71 0 0.170858423 68.17251085 68
1 112 112 0.301893165 120.4553729 120
2 117 234 0.266710536 106.4175037 106
3 57 171 0.157085393 62.67707189 63
4 27 108 0.069389331 27.68634297 28
5 11 55 0.024521079 9.783910623 10
6 3 18 0.007221131 2.881231226 3
7 1 7 0.001822737 0.727272154 1
total 399 705 0.999501795 398.8012163 399

Form the above table we get the following expected frequency:

x 0 1 2 3 4 5 6 7
f 71 112 117 57 27 11 3 1
Expected Frequency 68 120 106 63 28 10 3 1

10
Lab 7:
Fit the binominal distribution to the data given below
f 0 1 2 3 4
x 28 62 46 10 4

Solution using SPSS:


Expected frequency Rounded Expected
x f fx p(x)
NXp(x) frequency
0 28 0 0.197530864 29.62962963 30
1 62 62 0.395061728 59.25925926 59
2 46 92 0.296296296 44.44444444 44
3 10 30 0.098765432 14.81481481 15
4 4 16 0.012345679 1.851851852 2
total 150 200 1 150 150

Cases and Values:


case Symbol value
No.of Object n 4
Mean= 1.33 (Fx sum/ f
sum) np 1.333333333
Prob.of Success (np/n) p 0.333333333
Prob of failuer (1-p) q 0.666666667
Total Frequency N 150

From the above table, we get the following expected frequency:


x 0 1 2 3 4
f 28 62 46 10 4
Expected Frequency 30 59 44 15 2

11
Lab 8:

Fit the Poisson distribution and find expected frequency.


x f
0 71
1 112
2 117
3 57
4 27
5 11
6 3
7 1

Solution using SPSS


Expected Rounded Expected
x f fx p(x)
frequency NXp(x) frequency
0 71 0 0.170858423 68.17251085 68
1 112 112 0.301893165 120.4553729 120
2 117 234 0.266710536 106.4175037 106
3 57 171 0.157085393 62.67707189 63
4 27 108 0.069389331 27.68634297 28
5 11 55 0.024521079 9.783910623 10
6 3 18 0.007221131 2.881231226 3
7 1 7 0.001822737 0.727272154 1
total 399 705 0.999501795 398.8012163 399

From the above table, we get the following expected frequency:


x 0 1 2 3 4 5 6 7
f 71 112 117 57 27 11 3 1
Expected Frequency 68 120 106 63 28 10 3 1

12
Lab 9:
Fit the Poisson distribution and find expected frequency.
MPP NOP
0 142
1 156
2 69
3 27
4 5
5 1

Solution Using SPSS


Expected Rounded
MPP NOP fx p(x) frequency Expected
Nxp(x) frequency
0 142 0 0.367879441 147.1517765 147
1 156 156 0.367879441 147.1517765 147
2 69 138 0.183939721 73.57588823 74
3 27 81 0.06131324 24.52529608 25
4 5 20 0.01532831 6.13132402 6
5 1 5 0.003065662 1.226264804 1
total 400 400 0.999405815 399.7623261 400

From the above table, we get the following expected frequency:


MPP 0 1 2 3 4 5
NOP 142 156 69 27 5 1
Rounded Expected 147 147 74 25 6 1
frequency

13
Lab 10:
The yield of treatments in different plots are as shown in the following plots. Carry out
analysis and create ANOVA table.
t1 2537 2069 1797 2104
t2 2211 3366 2591 2544
t3 2536 2459 2827 2385 2460
t4 1401 1170 1516 2104 1077

Solution from SPSS


ANOVA
Value
Sum of Mean
df F Sig.
Squares Square
Between
4265689.961 3 1421896.654 11.253 0.001
Groups
Within
1768941.150 14 126352.939
Groups
Total 6034631.111 17

Solution from Excel:


Source of
SS df MS F P-value F crit
Variation
Between
4265689.961 3 1421896.65 11.2533722 0.0005037 3.343888678
Groups
Within
1768941.15 14 126352.939
Groups
Total 6034631.111 17

14
Lab 11:
Create ANOVA table:

A B C
10 5 15
20 6 11
15 10 22
16 12 18

Solution From Excel:


ANOVA
Source of
SS df MS F P-value F crit
Variation
Between Groups 158.1666667 2 79.0833333 4.79292929 0.0382622 4.256494729
Within Groups 148.5 9 16.5
Total 306.6666667 11

Solution from SPSS:


ANOVA
Value
Sum of Mean
df F Sig.
Squares Square
Between
158.1666667 2 79.0833333 4.79292929 0.001
Groups
Within
148.5 9 16.5
Groups
Total 306.6666667 11

15
LAB 12:
Enter the value in SPSS and find mean, median, mode, p25, p50, p75, SD, variance, Range,
minimum, maximum from the following data.
Weight midvalue frequency
20-30 25 4
30-40 35 6
40-50 45 7
50-60 55 21
60-70 65 23
70-80 75 2

Solution using SPSS:


Statistics

Weight Mid Value Frequency


N Valid 6 6 6
Missing 0 0 0
Mean 50.00 10.50
Median 50.00 6.50
Mode 25a 2a
Std. Deviation 18.708 9.094
Variance 350.000 82.700
Range 50 21
Minimum 25 2
Maximum 75 23

Percentiles 25 32.50 3.50


50 50.00 6.50
75 67.50 21.50

From the above table, we found that Mean Mid value = 50, Mean Frequency = 10.50, Median
Mid value = 50, Median Frequency = 6.50, Mode Mid Value = 25a, Mode Frequency = 2a, Std.
Deviation Mid Value = 17.708, Std. Deviation Frequency = 9.094, Variance Mid Value = 350,
Variance Frequency = 82.7 and so on as shown in the above table.

16
Lab 13:
find mean, median, mode, SD, and percentiles.
weight mid value frequency
20-30 25 4
30-40 35 6
40-50 45 7
50-60 55 21
60-70 65 23
70-80 75 2
80-90 85 3

Solution using SPSS:


Statistics
Weight Mid Value Frequency
N Valid 7 7 7
Missing 0 0 0
Mean 55.00 9.43

Median 55.00 6.00


Mode 25a 2a
Std. Deviation 21.602 8.772
Variance 466.667 76.952
Range 60 21
Minimum 25 2
Maximum 85 23
Percentiles 25 35.00 3.00
50 55.00 6.00
75 75.00 21.00
a. Multiple modes
exist. The smallest
value is shown

From the above table, we found Mean = 9.43, Median = 6.00, Mode = 2a, SD = 8.772,
Variance = 76.952, Range = 21, Minimum = 2, Maximum = 23, p25 = 3, p50 = 6, p75 = 21.

17
Lab 14:
from the following fata find the regression equation y on x
x y
1 6
2 7
3 5
4 4
5 3
6 1
7 2

Solution form SPSS:


ANOVAa
Sum of
Model df Mean Square F Sig.
Squares
1 Regression 24.143 1 24.143 31.296 .003b
Residual 3.857 5 0.771
Total 28.000 6
a.
Dependent
Variable: y
b.
Predictors:
(Constant),
x

18
Lab 15:
Create two way ANOVA from the following Data.
Machine Type
Workmen
A B C
i 49 43 52
ii 51 45 57
iii 39 41 49
iv 38 43 51

Solution Using SPSS:


Tests of Between-Subjects Effects
Dependent Variable:
Type III Sum
Source df Mean Square F Sig.
of Squares
Corrected Model 344.000a 8 43.000 3.686 0.156
Intercept 25947.000 1 25947.000 2224.029 0.000
column 19.500 3 6.500 0.557 0.679
rows 123.500 3 41.167 3.529 0.164
treatment 201.500 2 100.750 8.636 0.057
Error 35.000 3 11.667
Total 26326.000 12
Corrected Total 379.000 11
a. R Squared =
.908 (Adjusted R
Squared = .661)

19

You might also like