Department of Chemistry
Submitted By: Afshan
Submitted To: Miss Nayab Hameed
Roll No: 246605
Section: M.Phil Inorganic Chemistry
Course Code: STA-795
Course Title: Statistics For Research
Government College University, Faisalabad
Commands to Analyze Data Using SPSS
1) Commands for Mean:
• Go to Analyze > Descriptive Statistics > Frequencies.
• Move the variables for which you want to calculate the mean into the "Variables" box.
• Click "Statistics".
• Select "Mean" and click "Continue".
• Click "OK" to generate the output.
Example:
Age Weight
25 60
30 65
35 70
20 55
40 75
45 80
28 62
32 68
38 72
22 58
Statistics
Age Weight
N Valid 10 10
Missing 0 0
Mean 31.50 66.50
2) Commands For median:
• Click Analyze -> Descriptive Statistics -> Frequencies.
• Move the variable for which you wish to calculate the median into the right-hand
column.
• Click the Statistics button, select Median under Central Tendency, and then press
Continue.
• Click OK to perform the calculation.
Example
Scores
10
12
15
18
20
22
25
30
35
Statistics
scores
N Valid 9
Missing 0
Median 20.00
3) Commands For Mode:
• Click Analyze -> Descriptive Statistics -> Frequencies
• Move the variable(s) for which you want to calculate the mode to the Variable(s) box
on the right
• Click Statistics
• Place a check in the Mode check box
• Click Continue
• Click OK
Example:
4) Commands for Standard Deviation:
• Click Analyze -> Descriptive Statistics -> Frequencies.
• Move the variable for which you wish to calculate the median into the right-hand
column.
• Click the Statistics button, select Standard Deviation under Central Tendency, and
then press Continue.
• Click OK to perform the calculation.
Example:
5) Command for variance:
• Click Analyze -> Descriptive Statistics -> Frequencies.
• Move the variable for which you wish to calculate the median into the right-hand
column.
• Click the Statistics button, select Variance under Central Tendency, and then press
Continue.
• Click OK to perform the calculation.
Example:
6) Command for T-test:
• Go to Analyze > Compare Means > Independent-Samples T Test.
• Move the dependent continuous variable into the "Test Variable(s)" box.
• Move the independent categorical variable into the "Grouping Variable" box.
• Click Define Groups and specify the codes for each group.
• Click Continue and then OK.
Example:
Group Weight
Male 70
Male 75
Male 80
Male 85
Male 90
Female 55
Female 60
Female 65
Female 70
Female 75
7) Commands for Chi-square test:
To perform a Chi-square test for independence in SPSS,
• Navigate to Analyze > Descriptive Statistics > Crosstabs,
• Move your categorical variables into the row and column boxes,
• Select "Chi-square" in the statistics box, and
• Click "OK".
Example:
8) Command for Range:
Analyze > Descriptive Statistics > Descriptives
Select the variable you want to calculate Range
Click Options
Select Range
Click Continue and then Ok
Example:
9) Command for Regression:
To perform a regression analysis in SPSS,
• navigate to Analyze > Regression > Linear.
• Move your dependent variable to the "Dependent" box and your independent
variables to the "Independent(s)" box.
• Ensure the "Enter" method is selected under "Method".
• Click Statistics and select estimates, Confidence intervals, and Model fit.
• Click Continue and then Ok
Example
Temperature(F) Cones Sold
75 10
80 12
85 15
90 18
95 20
Sum of
Model Squares df Mean Square F Sig.
1 Regression 67.600 1 67.600 507.000 .000b
Residual .400 3 .133
Total 68.000 4
a. Dependent Variable: cones sold
b. Predictors: (Constant), Temperature(farenhite)
10) Command for ANOVA:
• Analyze > Compare Means > One-Way ANOVA.
• Move your categorical independent variable into the "Factor" box.
• Click "Options" and select desired statistics (e.g., Descriptive,
Homogeneity of variance test, Means plot).
• Click "Post Hoc" and select appropriate tests like Tukey (for pairwise
comparisons) if needed.
• Return to the main dialog and click "OK" to run the analysis
Example: