Introduction to Data Analysis Levels of measurement and

  • Slides: 46
Download presentation
Introduction to Data Analysis. Levels of measurement and Descriptive statistics

Introduction to Data Analysis. Levels of measurement and Descriptive statistics

What’s this course about? n Introduction to the use of quantitative data in social

What’s this course about? n Introduction to the use of quantitative data in social science. ¨ The tools we need in order to use numerical data (i. e. anything we can count) to better understand the world. ¨ Very basic introduction, students intending to write theses using primarily quantitative data should also attend the intermediate/ advanced lectures. 2

Why am I here? n Your own research. Using quantitative data as an integral

Why am I here? n Your own research. Using quantitative data as an integral part of your thesis. n Using quantitative data as supplementary evidence. n Making better use of qualitative data. n n Other people’s research. Understanding work in your area. n Criticising work in your area. n n It’s compulsory…. 3

What is Statistics? n Methods for: ¨ Designing and carrying out research studies ¨

What is Statistics? n Methods for: ¨ Designing and carrying out research studies ¨ Describing collected data ¨ Making decisions/inferences about phenomena represented by data 4

Some key terms (1) n Population—the total set of individual objects of persons of

Some key terms (1) n Population—the total set of individual objects of persons of interest in a study n Sample—a subset of the population that is actually observed 5

Key Terms (2) Descriptive Stats consist of methods of graphical and numerical techniques for

Key Terms (2) Descriptive Stats consist of methods of graphical and numerical techniques for summarizing the information in a collection of data n Inferential stats consist of procedures for making generalizations about characteristics of a population, based on info from a sample. n 6

Key terms (3) n Parameters are the characteristics of the population about which we

Key terms (3) n Parameters are the characteristics of the population about which we make inferences using sample data n Statistics are the corresponding characteristics of the sample data, upon which we base our inferences about parameters. 7

Some key terms (1) n Population—the total set of individual objects of persons of

Some key terms (1) n Population—the total set of individual objects of persons of interest in a study n Sample—a subset of the population that is actually observed 8

Variables and their measurement n Variable = measurement of a characteristic of a subject

Variables and their measurement n Variable = measurement of a characteristic of a subject (something or someone) that varies across subjects in a population of subjects. n Different levels of measurement, which means that we have to examine different types of data in different ways. 9

Some key terms (1) n Population—the total set of individual objects of persons of

Some key terms (1) n Population—the total set of individual objects of persons of interest in a study n Sample—a subset of the population that is actually observed 10

Nominal level measures (1) n Just represent a category. e. g. Male Female. n

Nominal level measures (1) n Just represent a category. e. g. Male Female. n e. g. Single Married Divorced. n Since there is no ordering, these are nominal measures. n Often called qualitative, since two values differ in quality not quantity. n 11

Nominal level measures (2) n n n Can quantify these data by tabulating them.

Nominal level measures (2) n n n Can quantify these data by tabulating them. Normally represent nominal data in a simple table with percentages. Take the marital status of all of my 25 friends (i. e. the population we are looking at is “all Ryan’s friends”). Marital status Number % 18 72% Married 6 24% Divorced 1 4% 25 100% Single Total 12

Ordinal level measures n Categories again, but these categories are ordered. n n e.

Ordinal level measures n Categories again, but these categories are ordered. n n e. g. Many polling/survey questions. “It was right for Britain to send troops to Iraq” ¨ ¨ n Strongly agree Agree Disagree Strongly disagree. The distance between each category is unknown. n n “Strong agreers” are more hawkish than “agreers”, but we have no idea how much more hawkish they are. We can say on observation is greater in rank than another. Can be ranking in class (for example) or from naturally ordered categories Called quantitative because different values represent different magnitudes. 13

Interval level measures n Numbers represent a quantitative variable. n n n We can

Interval level measures n Numbers represent a quantitative variable. n n n We can not only say that my sister is younger than I am, but that she is 2 years younger. n n e. g. Income, number of pupils per teacher, age, etc. There is a specific distance between each level. Age is a continuous variable, one can also subdivide the measure (784 days, 3 hours and 2 minutes younger…). It is also true that my parents have only 2 children. n Number of children is a discrete variable, you cannot sub-divide children, you have 1, or 2, or 3. You can’t have 2 ½ children. 14

Descriptive statistics Most statistics that we will cover today apply to variables that are

Descriptive statistics Most statistics that we will cover today apply to variables that are interval level measures. n Descriptive statistics are just that. They describe a large amount of data in a summary form. n n Why bother? Because we’re often interested in what a typical person (or country or school or parliament etc. ) looks like. 15

Measuring the central tendency n n n What we want to do is reduce

Measuring the central tendency n n n What we want to do is reduce a lot of interval level measurements to a few numbers. The salaries of all of my best friends (the population is Ryan’s best friends). What is the typical annual salary of a best friend of mine. Name Salary Ellen £ 75, 000 Jenny £ 13, 000 Justin £ 31, 000 Andrew £ 26, 000 Mungo £ 15, 000 16

The mean The most usual way of measuring the central tendency is to use

The mean The most usual way of measuring the central tendency is to use the mean (or average). n This is simply the sum of the measurements divided by the number of observations. n For our salaried people: n n = n Mean = £ 32, 000 17

A (very) little bit of math n To introduce some terms which will be

A (very) little bit of math n To introduce some terms which will be useful later, the mean is calculated as follows. Suppose we have n observations, with each value denoted by X 1, X 2 and so on until Xn. Then the mean is described as follows: Or, to put it another way; 18

The mean’s properties n Shift of origin of measurement. n n Change of scale.

The mean’s properties n Shift of origin of measurement. n n Change of scale. n n If everyone earns £ 2000 more, then the new mean salary is just the old mean salary (£ 32, 000) PLUS £ 2000. If we calculate salary in dollars (say £ 1 = $2), then the new mean salary is simply twice the old mean salary. Sum of two variables. Imagine that income = salary + savings interest. n Mean income = mean salary + mean savings interest. n 19

The median Another common way deriving one number to describe many is to use

The median Another common way deriving one number to describe many is to use the median. n Imagine we ranked all observations, the median is simply the observation in the middle (½ of observations above and ½ below). n n In ascending order the salaries are: 13, 000; 15, 000; 26, 000; 31, 000; 75, 000. Median = = ½(26, 000+31, 000) £ 26, 000. §n Median = 28, 500. 20

The median’s properties (1) Shift of origin of measurement. YES n Change of scale.

The median’s properties (1) Shift of origin of measurement. YES n Change of scale. YES n Sum of two variables. NO n The lack of this property is somewhat important (which will become apparent in the following weeks), and is related to one of the reasons why we generally use the mean in most statistical analysis. n Nonetheless, the median does have some advantages over the mean in describing some types of data. n 21

The median’s properties (2) n n n For our salary example, the mean of

The median’s properties (2) n n n For our salary example, the mean of my best friends’ salaries gives a substantially higher value than the median (£ 6000 more). This is due to the distribution of the observations. For the mean and median to be the same the distribution of observations needs to be symmetrical. Imagine we now look at all my friends and acquaintances (the population of 25 people as before), and plot the frequency of each salary for all 25. 22

Frequency graph of salaries Median = 26, 000 Mean = 34, 000 23

Frequency graph of salaries Median = 26, 000 Mean = 34, 000 23

Positions of the median and mean n n For distributions with a long tail

Positions of the median and mean n n For distributions with a long tail to the right, the mean will take a higher value than the median. This is generally true across the world for income distributions, and is captured by Pen’s “parade of dwarfs and a few giants”. n n n If such a parade were organised today, then the person of mean height (and income) would be taller (and richer) than 65% of the population and so would pass by after 40 minutes had elapsed. Mean income is ~£ 24, 000, median income is ~£ 16, 000. For data with ‘outliers’ the median can give a better idea of what the “typical” observation is like. 24

Ordinal level data n n The median can be used for ordinal level data.

Ordinal level data n n The median can be used for ordinal level data. Imagine we had asked my 5 best friends about their position on the Iraq war; 2 strongly agreed with sending British troops, one agreed, one disagreed and one strongly disagreed. ¨ We can rank these answers and then find the median. Strongly agree; strongly agree; disagree; strongly disagree. ¨ Thus the median answer is agree. 25

Nominal level data n In general, we can’t use the median or mean for

Nominal level data n In general, we can’t use the median or mean for nominal data. ¨ Normally use the mode. This is the most commonly occurring value. n e. g if 53 people here are politics students, 40 sociology students, and 46 are other subjects, then the modal value is politics. ¨ There is one special case in which we can use the mean for nominal data however… 26

Nominal binary data n …binary data is an exception as we can use the

Nominal binary data n …binary data is an exception as we can use the mean. Binary data (e. g. Yes/No, Male/Female) can be coded as 0 or 1. n n A variable measuring sex, men are coded 1 and women coded 0. The mean score for those 0 s and 1 s is the proportion of men. There were 2 women and 3 men amongst my best friends. n n The median does NOT make sense for binary data. It just tells us what the majority of the population is. 27

Measures of dispersion n n The mean (or median) tells us something about the

Measures of dispersion n n The mean (or median) tells us something about the centre of the distribution, but what about its dispersion? The means/medians of the below distributions of children’s scores on a maths test in three different classes are all the same (48 observations, mean of 7, median of 7), but each tells a quite different story. 28

The range is simply a measure of the distance between the largest and smallest

The range is simply a measure of the distance between the largest and smallest observations. n The range for our salary example is therefore: 75, 000 – 13, 000 = 62, 000. n Clearly this is not ideal as it relies on only two observations. n n Say we have 1000 poker players. 999 win nothing, and 1 wins £ 1 million. The range indicates lots of variation, when most people are actually identical. 29

The variance and standard deviation A better way of assessing how much values of

The variance and standard deviation A better way of assessing how much values of a variable vary around the mean is to use the standard deviation or variance. n Basic idea is to measure how different individual values are from the mean value. n Some of these deviations from the mean will be positive and some negative, so we square each deviation. n 30

The variance n n Take my 5 best friends. The mean salary was £

The variance n n Take my 5 best friends. The mean salary was £ 32, 000. If we added up all the differences then we would get zero, so we need to square the differences (i. e. multiply them by themselves). Jenny Andrew Justin Mungo (15, 000) = 15, 000 - 32, 000 = -17, 000 Ellen (75, 000) Difference = 75, 000 - 32, 000 = 43, 000 Mean=£ 32, 000 31

Calculating variance n Salary example, with 5 obs, and mean of 32, 000. Salary

Calculating variance n Salary example, with 5 obs, and mean of 32, 000. Salary (000 s) Deviation from mean Squared deviation 75 75 - 32 = 43 43 * 43 = 1849 13 13 – 32 = -19 -20 * -20 = 361 31 31 – 32 = -1 -1 * -1 = 1 26 26 – 32 = -6 -6 * -6 = 36 15 15 – 32 = -17 * -17 = 289 32

Calculating standard deviation n The standard deviation is the most common way to measure

Calculating standard deviation n The standard deviation is the most common way to measure deviation from the mean and is simply the square root of the variance. n We normally call the variance s 2 and the standard deviation s. Thus for our example, s 2 = 507. 2, and s = 22. 5. **we usually use n-1 in the denominator 33

Examples of standard deviation s = 1. 67 s = 4. 01 s =

Examples of standard deviation s = 1. 67 s = 4. 01 s = 1. 02 Clustered distribution Dispersed distribution Tight distribution (Most children perform to a similar level, with some variation) (One group of geniuses, one group of idiots) (All children perform similarly) 34

But what does it mean…? Our salary example had a standard deviation of 22.

But what does it mean…? Our salary example had a standard deviation of 22. 5, but for the distributions above the s varied between 1 and 4, what does this tell us? n Best way to think of it is as a kind of rough average distance of an observation to the mean. n Thus the standard deviation depends on the units we are measuring in. n 35

Standard deviation summary Broadly speaking, high levels of s indicate greater variation, and the

Standard deviation summary Broadly speaking, high levels of s indicate greater variation, and the value of s gives a broad idea of a typical distance from the mean. n The concept of standard deviation is an important one, and next week I’ll talk more about particular types of distributions and their properties. n 36

How to (not) lie with statistics Even simple descriptive statistics can be misused in

How to (not) lie with statistics Even simple descriptive statistics can be misused in order to mislead. n Particularly the case for simple graphs. n Most examples I will use here are from Edward Tufte The Visual Display of Quantitative Information (1983, and later reprints). n See any copy of any of the Sunday papers for similar glaring errors however. n 37

Too little information Presenting too little summary information. n Example courtesy of Tukey (1979)

Too little information Presenting too little summary information. n Example courtesy of Tukey (1979) in JASA. n Take Washoe County in Nevada, USA. There is a mean population density of 13 ½ people per square mile. n The mean is not informative without information on the distribution however, for in fact 80% of the inhabitants live in two cities. n The cities have population densities of ~5000 per square mile. ¨ The rest of the county has a population density of 2 ½ people per square mile. ¨ 38

Base years (1) n Picking your base year (Tufte 1983). 39

Base years (1) n Picking your base year (Tufte 1983). 39

Base years (2) 40

Base years (2) 40

Measures over time (1) 41

Measures over time (1) 41

Measures over time (2) 42

Measures over time (2) 42

The lie factor n Are doctors really becoming smaller? 43

The lie factor n Are doctors really becoming smaller? 43

Small differences Just because something’s top or bottom of a list, doesn’t imply anything.

Small differences Just because something’s top or bottom of a list, doesn’t imply anything. n The difference between top and bottom might be very small. n Close to home, look at the Norrington table for this. The difference between the middle 10 colleges is essentially zero, but it’s the ranking that everyone cares about. n Ranking of countries by something like literacy rates is often similarly futile. There has to be one at the top with 99. 9% but all Western countries will have 99%+ rates… n 44

(very) Small samples 9 out of 10 cats prefer ‘Whiskers’… n We may think

(very) Small samples 9 out of 10 cats prefer ‘Whiskers’… n We may think that the evidence for this is strong if thousands of cats had their opinion solicited, but maybe weak if only 10 cats were ‘questioned’ out of the population of millions. n n Knowing when a small sample is too small is one of the topics we will cover the next two weeks and is a critical part of understanding commonly used statistics. 45

“How to talk back to a statistic” n Who says so? n n How

“How to talk back to a statistic” n Who says so? n n How does he know? n n Is the data reputable? What’s missing? n n We all want to prove our own theories correct… e. g. means are no use without standard deviations. Does it make sense? n Social science is the science of the bloody obvious most of the time. Don’t let numbers confuse or fool you; if it sounds wrong, it probably is. 46