Question? Leave a message!




Introduction to Statistics for Psychology

Introduction to Statistics for Psychology 6
Introduction to Statistics for Psychology and Quantitative Methods for Human Sciences Jonathan MarchiniCourse Information There is website devoted to the course at http://www.stats.ox.ac.uk/marchini/phs.html This contains  Course timetable/information  Lecture slides (on the website before each lecture)  Lecture notes (a bit more detailed than the slides)  Exercise sheets (tutors may or may not use these)  Formulae booklet and definitions booklet  Links to past exam papers on the web PLEASE ENTER THE LECTURE THEATRE QUICKLYLecture 1 : Outline  Why we need Statistics The scientific process  Different types of data Discrete/Continuous Quantitative/Qualitative  Methods of looking at data Bar charts, Histograms, Dot plots, Scatter plots, Box plots  Calculating summary measures of data Location Mean, Median, Mode Dispersion SIQR, MAD, sample variance, sample standard deviationThe role of Statistics in the Scientific Process Examine the results of the statistical test Use statistics to test We start with a Propose a Collect our hypothesis based question/hypotheis study/experiment Data on a model of the data that aims to provide about a given i.e. take data to help test our population of a sample hypothesis objects/events from the population Study Design (How can we design STATISTICS our study to get the most information about our hypothesis)An Example Psychologists have long been interested in the relationship between stress and health. A focused question might involve the study of a specific psychological symptom and its impact on the health of the population. To assess whether the symptom is a good indicator of stress we need to measure the symptom and stress levels in a sample of individuals from the population. It is not immediately clear how we should go about collecting this sample, i.e. how we should design the study. We haven’t got very far before we need StatisticsThe general focus of this course Examine the results of the statistical test Use statistics to test We start with a Propose a Collect our hypothesis based question/hypotheis study/experiment Data on a model of the data that aims to provide about a given i.e. take data to help test our population of a sample hypothesis objects/events from the population Study Design (How can we design STATISTICS our study to get the most information about our hypothesis)Datasets consist of measured variables The datasets that Psychologists and Human Scientists collect will usually consist of one more observations on one or more “variables”. A variable is a property of an object or event that can take on different values. Example Suppose we collect a dataset by measuring the hair colour, resting heart rate and score on an IQ test of every student in a class. The variables in this dataset would then simply be hair colour, resting heart rate and score on an IQ test, i.e. the variables are the properties that we measured/observed.2 main types of variable 1 Measurement (Quantitative) Data occur when we ‘measure’ things e.g. height or weight. 2 Categorical (Qualitative) Data occur when we assign objects into labelled groups or categories e.g. when we group people according to hair colour or race. (i) Ordinal variables have a natural ordering e.g. gold/silver/bronze medal (i) Nominal variables do not have a natural ordering e.g. genderDiscrete and Continuous Variables Discrete Data No. of students late for a lecture 0 1 2 ................................................... 8 There are only a limited set of distinct values/categories i.e. we can’t have exactly 2.23 students late, only integer values are allowed. Continuous Data Time spent studying statistics (hrs) 3.76 5.67 0 In theory there are an unlimited set of possible values There are no discrete jumps between possible values.Summary of Data Types Types of data Quantitative Qualitative (Measurement) (Categorical) Discrete Continuous Discrete e.g. No. of students e.g.Height, Weight in a class Nominal Ordinal e.g. League position, e.g. Hair colour, Race, Medal awarded in Smoking status an Olympic eventPlotting Data One of the most important stages in a statistical analysis can be simply to look at your data right at the start. By doing so you will be able to spot characteristic features, trends and outlying observations that enable you to carry out an appropriate statistical analysis. Also, it is a good idea to look at the results of your analysis using a plot. This can help identify if you did something that wasn’t a good idea REMEMBER Data is messy No two datasets are the same ALWAYS LOOK AT YOUR DATAThe BabyBoom dataset Fortyfour babies (a new record) were born in one 24hour period at the Mater Mothers’ Hospital in Brisbane, Queensland, Australia, on December 18, 1997. For each of the 44 babies, The Sunday Mail recorded the time of birth, the sex of the child, and the birth weight in grams. Whilst, we did not collect this dataset based on a specific hypothesis, if we wished we could use it to answer several questions of interest.  Do girls weigh more than boys at birth  What is the distribution of the number of births per hour  Is birth weight related to the time of birth  Is gender related to the time of birth  Is there an equal chance of being born a girl or boyTime Gender Weight Time Gender Weight Time Gender Weight 5 1 3837 649 1 3746 1105 1 2383 64 1 3334 653 1 3523 1134 2 3428 78 2 3554 693 2 2902 1149 2 4162 115 2 3838 729 2 2635 1187 2 3630 177 2 3625 776 2 3920 1189 2 3406 245 1 2208 785 2 3690 1191 2 3402 247 1 1745 846 1 3430 1210 1 3500 262 2 2846 847 1 3480 1237 2 3736 271 2 3166 873 1 3116 1251 2 3370 428 2 3520 886 1 3428 1264 2 2121 455 2 3380 914 2 3783 1283 2 3150 492 2 3294 991 2 3345 1337 1 3866 494 1 2576 1017 2 3034 1407 1 3542 549 1 3208 1062 1 2184 1435 1 3278 635 2 3521 1087 2 3300Bar Charts A Bar Chart is a useful method of summarising Categorical Data. We represent the counts/frequencies/percentages in each category by a bar. Girl Boy Frequency 0 4 8 12 16 20 24Histograms ‘A Bar Chart is to Categorical Data as a Histogram is to Measurement Data’ 1500 2000 2500 3000 3500 4000 4500 Birth Weight (g) Frequency 0 0 5 5 10 10 15 15 20 20Constructing Histograms (an example) For the babyboom dataset we can draw a histogram of the birth weights. To draw the histogram I found the smallest and largest values smallest = 1745 largest = 4162 There are only 44 weights so I decided on 6 equal sized categories Interval 15002000 20002500 25003000 30003500 35004000 40004500 Frequency 1 4 4 19 15 1 Using these categories works well, the histogram shows us the shape of the distribution and we notice that distribution has an extended left ‘tail’.Too few categories Too many categories 1500 2500 3500 4500 1500 2500 3500 4500 Birth Weight (g) Birth Weight (g) Too few categories and the details are lost. Too many categories and the overall shape is obscured by too many details Frequency 0 5 10 15 20 25 30 35 Frequency 0 1 2 3 4 5 6 7Cumulative Frequency Plots and Curves Interval 15002000 20002500 25003000 30003500 35004000 40004500 Frequency 1 4 4 19 15 1 Cumulative 1 5 9 28 43 44 Frequency Cumulative Frequency Plot Cumulative Frequency Curve 1500 2000 2500 3000 3500 4000 4500 2000 2500 3000 3500 4000 4500 Birth Weight (g) Birth Weight (g) Cumulative Frequency 0 10 20 30 40 50 Cumulative Frequency 0 10 20 30 40 50Dot plots A Dot Plot is a simple and quick way of visualising a dataset. This type of plot is especially useful if data occur in groups and you wish to quickly visualise the differences between the groups. 1500 2000 2500 3000 3500 4000 4500 Birth Weight (g) Gender Girl BoyScatter Plots Scatter plots are useful when we wish to visualise the relationship between two measurement variables. 2000 2500 3000 3500 4000 Birth Weight (g) Time of birth (mins since 12pm) 0 200 400 600 800 1000 1200 1400Comparing Histograms −10 0 10 20 30 −10 0 10 20 30 −10 0 10 20 30Summary Measures There are 3 main measures of location  The Mode  The Median  The Mean There are 5 main measures of dispersion  The Interquartile Range (IQR) and SemiInterquartile Range (SIQR)  The Mean Deviation  The Mean Absolute Deviation (MAD) 2 2  The Sample Variance (s ) and Population Variance ( )  The Sample Standard Deviation (s) and Population Standard Devia tion ()The Mode The Mode of a set of numbers is simply the most common value e.g. the mode of the following set of numbers 1; 1; 2; 2; 2; 3; 3; 3; 3; 4; 5; 5; 6; 6; 7; 8; 10; 13 is 3: 0 1 2 2 3 4 4 5 6 6 7 8 8 9 10 10 11 12 12 13 14 14 Frequency 0 1 2 3 4Advantage The Mode has the advantage that it is always a score that actually occurred and can be applied to nominal data. Disadvantage There may be two or more values that share the largest frequency. In the case of two modes we would report both and refer to the distribution as bimodal. 5 10 15 20 25 Frequency 0 5 10 15 20 25 30 35The Median The Median can be thought of as the ‘middle’ value i.e. the value for which 50 of the data fall below when arranged in numerical order. For example, consider the numbers 15; 3; 9; 21; 1; 8; 4; When arranged in numerical order 1; 3; 4; 8; 9; 15; 21 we see that the median value is 8. If there were an even number of scores e.g. 1; 3; 4,8; 9; 15 then we take the midpoint of the two middle values. In this case the median is (4 + 8)=2 = 6.In general, if we have N data points then the median location is defined as follows: (N+1) Median Location = 2 For example, the median location of 7 numbers is (7 + 1)=2 = 4 and the median of 8 numbers is (8 + 1)=2 = 4:5 i.e. between observation 4 and 5 (when the numbers are arranged in order). Advantage The median is unaffected by extreme scores (a point it shares with the mode). We say the median is resistant to outliers. For example, the median of the numbers 1; 3; 4; 8; 9; 15; 99999 is still 8. This property is very useful in practice as outlying observations can and do occur (Data is messy remember).The Mean 1 The Mean of a set of scores is the sum of the scores divided by the number of scores. For example, the mean of 1 + 3 + 4 + 8 + 9 + 15 1; 3; 4; 8; 9; 15 is = 6:667 (to 3 dp) 6 In mathematical notation, the mean of a set of n numbers x ; :: :; x is 1 n denoted by x  where P P n x x i i=1 x  = or x  = (in the formula book) n n See the appendix of the notes for a brief description of the summation P notation ( ) 1 The total when we add them all upAdvantage The mean is the most widely used measure of location. Historically, this is because statisticians can write down equations for the mean and derive nice theoretical properties for the mean, which are much harder for the mode and median. Disadvantage The mean is not resistant to outlying observations. For example, the mean of 1; 3; 4; 8; 9; 15; 99999 is 14323.57, whereas the median (from above) is 8.Sometimes discrete measurement data are presented in the form of a frequency table in which the frequencies of each value are given. Data (x) 1 2 3 4 5 6 Frequency (f) 2 4 6 7 4 1 We calculate the sum of the data as (2 1) + (4 2) + (6 3) + (7 4) + (4 5) + (1 6) = 82 and the number of observations as 2 + 4 + 6 + 7 + 4 + 1 = 24 The the mean is given by 82 x  = = 3:42 (2 dp) 24In mathematical notation the formula for the mean of frequency data is given by P P n f x fx i i i=1 P P x  = or x  = n f f i i=1The relationship between the mean, median and mode Symmetric mean = median = mode −10 0 10 20 30 Positive Skew mean median mode 0 5 10 15 20 25 30 Negative Skew mean median mode 0 5 10 15 20 25 30IQR and SIQR The IQR is the range of the middle 50 of the data. The SIQR is simply half the IQR. IQR 25 75 −5 0 5 10 15 20 25 Frequency 0 50 100 150 200We calculate the IQR in the following way:  Calculate the 25 point (1st quartile) of the dataset. The location of  N+1 the 1st quartile is defined to be the th data point. 4  Calculate the 75 point (3rd quartile) of the dataset. The location of  3(N+1) the 3rd quartile is defined to be the th data point. 4  Calculate the IQR as IQR = 3rd quartile 1st quartile Example 1 Consider the set of 11 numbers (which have been arranged in order) 10; 15; 18; 33; 34; 36; 51; 73; 80; 86; 92 (11+1) The 1st quartile is the = 3rd data point = 18 4 3(11+1) The 3rd quartile is the = 9th data point = 80 4 ) IQR = 80 18 = 62 ) SIQR = 62 / 2 = 31.The Mean Deviation To measure the spread of a dataset it seems sensible to use the ‘deviation’ of each data point from the mean of the distribution. The deviation of each data point from the mean is simply the data point minus the mean. small spread = small deviations large spread = large deviationsData Deviations x x x  10 10 48 = 38 15 15 48 = 33 18 18 48 = 30 33 33 48 = 15 34 34 48 = 14 528 The mean is x  = = 48 36 36 48 = 12 11 51 51 48 = 3 The Mean Deviation of a set of numbers 73 73 48 = 25 is simply mean of deviations. 80 80 48 = 32 86 86 48 = 38 In practice, the mean deviation is 92 92 48 = 44 always zero. Sum = 528 Sum = 0 P P x = 528 (x x ) = 0Mean Absolute Deviation (MAD) We solve the problem of the deviations summing to zero by considering the absolute values of the deviations. The absolute value of a number is the value of that number with any minus sign removed, e.g.j 3j = 3. We then measure spread using the mean of the absolute deviations, denoted (MAD). This can be written in mathematical notation as P P n jx x j jx x j i i=1 or n nData Deviations jDeviationsj x x x  jx x j 10 10 48 = 38 38 15 15 48 = 33 33 18 18 48 = 30 30 33 33 48 = 15 15 34 34 48 = 14 14 36 36 48 = 12 12 51 51 48 = 3 3 284 MAD = 73 73 48 = 25 25 11 = 25:818 (to 3dp) 80 80 48 = 32 32 86 86 48 = 38 38 92 92 48 = 44 44 Sum = 528 Sum = 0 Sum = 284 P P P x = 528 (x x ) = 0 jx x j = 2842 2 The Sample Variance (s ) and Population Variance ( ) Another way to ensure the deviations don’t sum to zero is to look at the squared deviations. Thus another way of measuring the spread is to consider the mean of the squared deviations, called the Variance If our dataset consists of the whole population (a rare occurrence) then we 2 can calculate the population variance  (said ‘sigma squared’) as P P n 2 2 (x x ) (x x ) i 2 i=1 2  = or  = n n When we just have a sample from the population (most of the time) we can 2 calculate the sample variance s as P P n 2 2 (x x ) (x x ) i 2 i=1 2 s = or s = n 1 n 1 2 NB We divide by n 1 when calculating the sample variance as then s is 2 a ‘better estimate’ of the population variance  than if we had divided by n.2 Data Deviations Deviations 2 x x x  (x x ) 10 10 48 = 38 1444 15 15 48 = 33 1089 18 18 48 = 30 900 33 33 48 = 15 225 34 34 48 = 14 196 36 36 48 = 12 144 51 51 48 = 3 9 9036 2 s = = 903:6 73 73 48 = 25 625 11 1 80 80 48 = 32 1024 86 86 48 = 38 1444 92 92 48 = 44 1936 Sum = 528 Sum = 0 Sum = 9036 P P P 2 x = 528 (x x ) = 0 (x x ) = 9036The Sample and Population Standard Deviation (s and ) Notice how the sample variance in our example is much higher than the SIQR and the MAD. 2 SIQR = 31 MAD = 25.818 s = 903.6 This happens because we have squared the deviations transforming them to a quite different scale. We can recover the scale of the original data by simply taking the square root of the sample (population) variance.Thus we define the sample standard deviation s as s P n 2 (x x ) i i=1 s = n 1 and we define the population standard deviation  as r P n 2 (x x ) i i=1  = n Returning to Example 1 the sample standard deviation is p s = 903:6 = 30:05 (to 2dp) which is comparable with the SIQR and the MAD.Box Plots Upper Whisker 3rd quartile Median 1st quartile Lower Whisker Outliers 2000 2500 3000 3500 4000A box plot consists of three main parts 1 A box that covers the middle 50 of the data. The edges of the box are the 1st and 3rd quartiles. A line is drawn in the box at the median value. 2 Whiskers that extend out from the box to indicate how far the data extend either side of the box. The whiskers should extend no further than 1.5 times the length of the box, i.e. the maximum length of a whisker is 1.5 times the IQR. 3 All points that lie outside the whiskers are plotted individually as outlying observations.Plotting box plots of measurements in different groups side by side can be illustrative. For example, box plots of birth weight for each gender side by side and indicates that the distributions have quite different shapes. Girls Boys 2000 2500 3000 3500 4000
sharer
Presentations
Free
Document Information
Category:
Presentations
User Name:
JuliyaMadenta
User Type:
Researcher
Country:
Philippines
Uploaded Date:
15-07-2017