Basic Statistics
Basic Statistics
Chapter 1
Introduction and Data
Collection
Chap 1-2
Chap 1-3
Chap 1-4
Basics of Statistics
Definition: Science of collection, presentation, analysis, and reasonable
interpretation of data.
Statistics presents a rigorous scientific method for gaining insight into data. For
example, suppose we measure the weight of 100 patients in a study. With so
many measurements, simply looking at the data fails to provide an informative
account. However statistics can give an instant overall picture of data based
on graphical presentation or numerical summarization irrespective to the
number of data points. Besides data summarization, another important task of
statistics is to make inference and predict relations of variables.
Chap 1-6
Population
Use parameters
to summarize
features
Sample
Use statistics to
summarize
features
Inference
on the population
from the
Basic Business
Chap 1-7
Statistics, 8e 2002
Prentice-Hall, Inc.
sample
Statistical Methods
Descriptive statistics
Collecting and describing data
Inferential statistics
Drawing conclusions and/or making
decisions concerning a population
based only on sample data
Basic Business
Statistics, 8e 2002
Prentice-Hall, Inc.
Chap 1-8
Descriptive Statistics
Collect data
e.g. Survey
Present data
e.g. Tables and graphs
Characterize data
Basic Business
Statistics, 8e 2002
Prentice-Hall, Inc.
Chap 1-9
Inferential Statistics
Estimation
e.g.: Estimate the
population mean weight
using the sample mean
weight
Hypothesis testing
e.g.: Test the claim that
the population mean
weight is 120 pounds
Chap 1-11
Data Sources
Primary
Secondary
Data Collection
Data Compilation
Print or Electronic
Observation
Survey
Experimentation
Basic Business
Statistics, 8e 2002
Prentice-Hall, Inc.
Chap 1-12
Types of Data
D a ta
C a te g o r ic a l
( Q u a l it a t iv e )
N u m e r ic a l
( Q u a n tit a tiv e )
D is c r e te
Basic Business
Statistics, 8e 2002
Prentice-Hall, Inc.
Chap 1-13
C o n tin u o u s
A Taxonomy of Statistics
Some Definitions
Distribution - (of a variable) tells us what values the variable
takes and how often it takes these values.
Unimodal - having a single peak
Bimodal - having two distinct peaks
Symmetric - left and right half are mirror images.
Frequency Distribution
Consider a data set of 26 children of ages 1-6 years. Then the
frequency distribution of variable age can be tabulated as
follows:
Frequency Distribution of Age
Age
Frequency
1-2
3-4
5-6
Frequency
12
Cumulative Frequency
Cumulative frequency of data in previous page
Age
Frequency
Cumulative Frequency
15
20
24
26
Age Group
1-2
3-4
5-6
Frequency
12
Cumulative Frequency
20
26
Data Presentation
Two types of statistical presentation of data - graphical and numerical.
Graphical Presentation: We look for the overall pattern and for striking
deviations from that pattern. Over all pattern usually described by
shape, center, and spread of the data. An individual value that falls
outside the overall pattern is called an outlier.
Bar diagram and Pie charts are used for categorical variables.
Histogram, stem and leaf and Box-plot are used for numerical variable.
Frequency
Proportion
Percent
(%)
15
(15/60)=0.25
25.0
25
(25/60)=0.333
41.7
20
(20/60)=0.417
33.3
Total
60
1.00
100
Frequency
15
(15/60)=0.25
25.0
25
(25/60)=0.333
41.7
20
(20/60)=0.417
33.3
60
1.00
100
Total
Proportion
Percent
(%)
90.41666667
Standard Error
3.902649518
Median
84
Mode
84
Standard Deviation
30.22979318
Sample Variance
913.8403955
Kurtosis
Skewness
-1.183899591
0.389872725
Range
95
Minimum
48
Maximum
143
Sum
Count
5425
60
Box Plot
Numerical Presentation
A fundamental concept in summary statistics is that of a central value for a set of
observations and the extent to which the central value characterizes the whole
set of data. Measures of central value such as the mean or median must be
coupled with measures of data dispersion (e.g., average distance from the
mean) to indicate how well the central value characterizes the data as a whole.
To understand how well a central value characterizes a set of observations, let
us consider the following two sets of data:
A: 30, 50, 70
B: 40, 50, 60
The mean of both two data sets is 50. But, the distance of the observations from
the mean in data set A is larger than in the data set B. Thus, the mean of data
set B is a better representation of the data set than is the case for set A.
x1 x2 ... xn
x
x
i 1
Mean or Median
The median is less sensitive to outliers (extreme scores) than the
mean and thus a better measure than the mean for highly skewed
distributions, e.g. family income. For example mean of 20, 30, 40,
and 990 is (20+30+40+990)/4 =270. The median of these four
observations is (30+40)/2 =35. Here 3 observations out of 4 lie
between 20-40. So, the mean 270 really fails to give a realistic
picture of the major part of the data. It is influenced by extreme
value 990.
( x1 x ) 2 .... ( xn x ) 2
S
n 1
2
(5 5) 2 (3 5) 2 (7 5) 2
4
3 1
Standard Deviation: Square root of the variance. The standard
deviation of the above example is 2.
100
x
Boxplot
Distribution of Age in Month
Choosing a Summary
The five number summary is usually better than the mean and standard
deviation for describing a skewed distribution or a distribution with
extreme outliers. The mean and standard deviation are reasonable for
symmetric distributions that are free of outliers.
In real life we cant always expect symmetry of the data. Its a common
practice to include number of observations (n), mean, median, standard
deviation, and range as common for data summarization purpose. We
can include other summary statistics like Q1, Q3, Coefficient of variation
if it is considered to be important for describing data.
Shape of Data
Shape of data is measured by
Skewness
Kurtosis
Skewness
Measures asymmetry of data
Positive or right skewed: Longer right tail
Negative or left skewed: Longer left tail
Skewness
n ( xi x ) 3
i 1
(x x)
i 1
3/ 2
Kurtosis
Measures peakedness of the distribution of
data. The kurtosis of normal distribution is 0.
Kurtosis
n ( xi x ) 4
i 1
(x x)
i 1
84
Mode
84
Standard Deviation
30.22979318
Sample Variance
913.8403955
Kurtosis
Skewness
-1.183899591
0.389872725
95
Minimum
48
Maximum
143
10
0
Range
Median
3.902649518
Standard Error
Histogram of Age
90.41666667
Number of Subjects
Mean
Sum
Count
5425
60
40
60
80
100
Age in Month
120
140
160
100
80
60
Age(month)
120
140
(continu
ed)
Basic Business
Statistics, 8e 2002
Prentice-Hall, Inc.
Chap 1-43
(continu
ed)
Basic Business
Statistics, 8e 2002
Prentice-Hall, Inc.
Chap 1-44
Basic Business
Statistics, 8e 2002
Prentice-Hall, Inc.
Chap 1-45
Probability Samples
Non-Probability
Samples
Judgement
Chunk
Simple
Random
Cluster
Systematic
Quota
Basic Business
Statistics, 8e 2002
Prentice-Hall, Inc.
Stratified
Chap 1-46
Probability Sampling
Subjects of the sample are chosen
based on known probabilities
Probability Samples
Simple
Random
Basic Business
Statistics, 8e 2002
Prentice-Hall, Inc.
Systematic
Chap 1-47
Stratified
Cluster
Chap 1-48
Systematic Samples
Decide on sample size: n
Divide frame of N individuals into
groups of k individuals: k=n/n
Randomly select one individual from
the 1st group
Select every k-th individual thereafter
N = 64
n=8
k=8
Basic Business
Statistics, 8e 2002
Prentice-Hall, Inc.
First Group
Chap 1-49
Stratified Samples
Population divided into two or more
groups according to some common
characteristic
Simple random sample selected from
each group
The two or more samples are
combined into one
Basic Business
Statistics, 8e 2002
Prentice-Hall, Inc.
Chap 1-50
Cluster Samples
Population divided into several
clusters, each representative of the
population
Simple random sample selected from
each
Population
The samples are combined into
one
divided
into 4
clusters.
Basic Business
Statistics, 8e 2002
Prentice-Hall, Inc.
Chap 1-51
Stratified sample
Ensures representation of individuals across
the entire population
Cluster sample
More cost effective
Less efficient (need larger sample to acquire
the same level of
precision)
Basic Business
Chap 1-52
Statistics, 8e 2002
Prentice-Hall, Inc.
Chap 1-53
Chap 1-54
Excluded from
frame.
Follow up on
non responses.
Chance
differences from
sample to sample.
Bad Question!
Microsoft Excel
A Spreadsheet Application. It features calculation, graphing tools,
pivot tables and a macro programming language called VBA (Visual
Basic for Applications).
There are many versions of MS-Excel. Excel XP, Excel 2003, Excel 2007
are capable of performing a number of statistical analyses.
Starting MS Excel: Double click on the Microsoft Excel icon on the
desktop or Click on Start --> Programs --> Microsoft Excel.
Worksheet: Consists of a multiple grid of cells with numbered rows down the
page and alphabetically-tilted columns across the page. Each cell is referenced by
its coordinates. For example, A3 is used to refer to the cell in column A and row 3.
B10:B20 is used to refer to the range of cells in column B and rows 10 through 20.
Microsoft Excel
Opening a document: File Open (From a existing workbook). Change the
directory area or drive to look for file in other locations.
Creating a new workbook: FileNewBlank Document
Saving a File: FileSave
Selecting more than one cell: Click on a cell e.g. A1), then hold the Shift key
and click on another (e.g. D4) to select cells between and A1 and D4 or Click on a
cell and drag the mouse across the desired range.
Creating Formulas: 1. Click the cell that you want to enter the
formula, 2. Type = (an equal sign), 3. Click the Function Button, 4.
Select the formula you want and step through the on-screen
instructions.
fx
Microsoft Excel
Entering Date and Time: Dates are stored as MM/DD/YYYY. No need to enter
in that format. For example, Excel will recognize jan 9 or jan-9 as 1/9/2007
and jan 9, 1999 as 1/9/1999. To enter todays date, press Ctrl and ; together.
Use a or p to indicate am or pm. For example, 8:30 p is interpreted as 8:30 pm.
To enter current time, press Ctrl and : together.
Copy and Paste all cells in a Sheet: Ctrl+A for selecting, Ctrl +C for copying
and Ctrl+V for Pasting.
Sorting: Data Sort Sort By
Descriptive Statistics and other Statistical methods: ToolsData Analysis
Statistical method. If Data Analysis is not available then click on Tools Add-Ins and
then select Analysis ToolPack and Analysis toolPack-Vba
Microsoft Excel
Statistical and Mathematical Function: Start with = sign and then select
function from function wizard f x .
Inserting a Chart: Click on Chart Wizard (or InsertChart), select
chart, give, Input data range, Update the Chart options, and Select
output range/ Worksheet.
Importing Data in Excel: File open FileType Click on File
Choose Option ( Delimited/Fixed Width) Choose Options (Tab/
Semicolon/ Comma/ Space/ Other) Finish.
Limitations: Excel uses algorithms that are vulnerable to rounding and
truncation errors and may produce inaccurate results in extreme
cases.
Statistics Package
for the Social Science (SPSS)
A general purpose statistical package SPSS is widely used in the social
sciences, particularly in sociology and psychology.
SPSS can import data from almost any type of file to generate tabulated
reports, plots of distributions and trends, descriptive statistics, and
complex statistical analyzes.
Starting SPSS: Double Click on SPSS on desktop or ProgramSPSS.
Opening a SPSS file: FileOpen
Statistics Package
for the Social Science (SPSS)
MENUS AND TOOLBARS
FILE
EDIT
VIEW
DATA
TRANSFORM
Statistics Package
for the Social Science (SPSS)
MENUS AND TOOLBARS
ANALYZE
GRAPHS
UTILITIES
ADD-ons
WINDOW
HELP
Statistics Package
for the Social Science (SPSS)
MENUS AND TOOLBARS
Navigator (Output) Menus
When statistical procedures are run or charts are created, the output will appear
in the Navigator window. The Navigator window contains many of the pull-down
menus found in the Data Editor window. Some of the important menus in the
Navigator window include:
INSERT
FORMAT
Statistics Package
for the Social Science (SPSS)
Formatting Toolbar
When a table has been created by a statistical procedure, the user can edit the
table to create a desired look or add/delete information. Beginning with version
14.0, the user has a choice of editing the table in the Output or opening it in a
separate Pivot Table (DEFINE!) window. Various pulldown menus are activated
when the user double clicks on the table. These include:
EDIT
INSERT
PIVOT
FORMAT
Statistics Package
for the Social Science (SPSS)
Additional menus
CHART EDITOR
SYNTAX EDITOR
Statistics Package
for the Social Science (SPSS)
Importing data from an EXCEL spreadsheet:
Data from an Excel spreadsheet can be imported into SPSSWIN as follows:
1. In SPSSWIN click on FILE OPEN DATA. The OPEN DATA FILE Dialog
Box will appear.
2. Locate the file of interest: Use the "Look In" pull-down list to identify the folder
containing the Excel file of interest
3. From the FILE TYPE pull down menu select EXCEL (*.xls).
4. Click on the file name of interest and click on OPEN or simply double-click on
the file name.
5. Keep the box checked that reads "Read variable names from the first row of
data". This presumes that the first row of the Excel data file contains variable
names in the first row. [If the data resided in a different worksheet in the Excel
file, this would need to be entered.]
6. Click on OK. The Excel data file will now appear in the SPSSWIN Data
Editor.
Statistics Package
for the Social Science (SPSS)
Importing data from an EXCEL spreadsheet:
7. The former EXCEL spreadsheet can now be saved as an SPSS file (FILE
SAVE AS) and is ready to be used in analyses. Typically, you would label variable
and values, and define missing values.
Importing an Access table
SPSSWIN does not offer a direct import for Access tables. Therefore, we must follow
these steps:
1. Open the Access file
2. Open the data table
3. Save the data as an Excel file
4. Follow the steps outlined in the data import from Excel Spreadsheet to SPSSWIN.
Importing Text Files into SPSSWIN
Text data points typically are separated (or delimited) by tabs or commas.
Sometimes they can be of fixed format.
Statistics Package
for the Social Science (SPSS)
Importing tab-delimited data
In SPSSWIN click on FILE OPEN DATA. Look in the appropriate location for
the text file. Then select Text from Files of type: Click on the file name and then
click on Open. You will see the Text Import Wizard step 1 of 6 dialog box.
You will now have an SPSS data file containing the former tab-delimited data. You
simply need to add variable and value labels and define missing values.
Exporting Data to Excel
click on FILE SAVE AS. Click on the File Name for the file to be exported. For
the Save as Type select from the pull-down menu Excel (*.xls). You will notice the
checkbox for write variable names to spreadsheet. Leave this checked as you will
want the variable names to be in the first row of each column in the Excel
spreadsheet. Finally, click on Save.
Statistics Package
for the Social Science (SPSS)
Running the FREQUENCIES procedure
1. Open the data file (from the menus, click on FILE OPEN DATA) of
interest.
2. From the menus, click on ANALYZE DESCRIPTIVE STATISTICS
FREQUENCIES
3. The FREQUENCIES Dialog Box will appear. In the left-hand box will be a listing
("source variable list") of all the variables that have been defined in the data file. The
first step is identifying the variable(s) for which you want to run a frequency analysis.
Click on a variable name(s). Then click the [ > ] pushbutton. The variable name(s)
will now appear in the VARIABLE[S]: box ("selected variable list"). Repeat these
steps for each variable of interest.
4. If all that is being requested is a frequency table showing count, percentages
(raw, adjusted and cumulative), then click on OK.
Statistics Package
for the Social Science (SPSS)
Requesting STATISTICS
Descriptive and summary STATISTICS can be requested for numeric variables. To
request Statistics:
1. From the FREQUENCIES Dialog Box, click on the STATISTICS... pushbutton.
2. This will bring up the FREQUENCIES: STATISTICS Dialog Box.
3. The STATISTICS Dialog Box offers the user a variety of choices:
DESCRIPTIVES
The DESCRIPTIVES procedure can be used to generate descriptive statistics
(click on ANALYZE DESCRIPTIVE STATISTICS DESCRIPTIVES). The
procedure offers many of the same statistics as the FREQUENCIES procedure,
but without generating frequency analysis tables.
Statistics Package
for the Social Science (SPSS)
Requesting CHARTS
One can request a chart (graph) to be created for a variable or variables included in
a FREQUENCIES procedure.
1. In the FREQUENCIES Dialog box click on CHARTS.
2. The FREQUENCIES: CHARTS Dialog box will appear. Choose the intended chart
(e.g. Bar diagram, Pie chart, histogram.
Pasting charts into Word
1. Click on the chart.
2. Click on the pulldown menu EDIT COPY OBJECTS
3. Go to the Word document in which the chart is to be embedded. Click on EDIT
PASTE SPECIAL
4. Select Formatted Text (RTF) and then click on OK
5. Enlarge the graph to a desired size by dragging one or more of the black squares
along the perimeter (if the black squares are not visible, click once on the graph).
Statistics Package
for the Social Science (SPSS)
BASIC STATISTICAL PROCEDURES: CROSSTABS
1. From the ANALYZE pull-down menu, click on DESCRIPTIVE STATISTICS
CROSSTABS.
2. The CROSSTABS Dialog Box will then open.
3. From the variable selection box on the left click on a variable you wish to
designate as the Row variable. The values (codes) for the Row variable make up
the rows of the crosstabs table. Click on the arrow (>) button for Row(s). Next,
click on a different variable you wish to designate as the Column variable. The
values (codes) for the Column variable make up the columns of the crosstabs
table. Click on the arrow (>) button for Column(s).
4. You can specify more than one variable in the Row(s) and/or Column(s). A cross
table will be generated for each combination of Row and Column variables
Statistics Package
for the Social Science (SPSS)
Limitations: SPSS users have less control over data manipulation and
statistical output than other statistical packages such as SAS, Stata etc.
SPSS is a good first statistical package to perform quantitative research
in social science because it is easy to use and because it can be a good
starting point to learn more advanced statistical packages.