Docsity

Statistics: Understanding Data and Statistical Analysis - Prof. Bianconcini, Appunti di Statistica

Toggle sidebar
bg1
INTRODUCTION (1)
Statistics is the study of data and how it can be organized & analyzed to obtain insights.
➢ DESCRIPTIVE STATISTICS = focuses on summarizing and organizing the data to better
understand it. Based on facts and proven outcomes. There is no uncertainty because you are
describing only what you actually measured. E.g. when you organize your expenses in a table
and calculate your average spending, you use descriptive stat to better understand your budget
➢ INFERENTIAL STATISTICS = uses data from a small group to arrive at conclusions
about the entire population, so conclusions from a sample. E.g. to understand how Italians will
vote at the election you cannot ask everybody, but you must make a selection and ask a subgroup
of Italians, a sample.
BASIC CONCEPTS
• VARIABLE = any characteristic that can be measured. E.g students’ grades, height, and
income; Variables may be words (Qualitative) or numbers (Quantitative)
• DATA = refers to a set of values, organized by variables; so the observed values of the
variables. In and of themselves, data do not really tell us much, but when we classify and
summarize, they draw important conclusions.
Data can be:
➢ QUALITATIVE: they are categorical (use of words). E.g. eye color.
➢ QUANTITATIVE data are numerical (e.g. height, age). Plus they can be either:
- Continuous (measured; decimals/real numbers; e.g. average time: 2,5min)
- Discrete (counted; natural numbers; e.g. number of customers: 5670).
SCALES OF MEASUREMENT
Data can be collected using different scales of measurement, which define how we measure the
values of a given variable.
Qualitative values can be measured:
➢ on a NOMINAL SCALE: used to name or identify people … cannot be ordered. E.g. gender.
➢ on a ORDINAL SCALE: used to measure variables in a natural order, such as ranking. E.g.
level of education. (A – B – C)
Quantitative values can be measured:
➢ on an INTERVAL SCALE = information about the amount of difference between values.
Often used for temperature and time, allowing for precise comparisons and calculations. Do not
have a meaningful zero value and, therefore, all arithmetic operations except ratio are allowed.
E.g. temperature: 0 degrees does not mean no temperature! It means ‘a temperature of 0 °C
➢ on a RATIO SCALE = Has a well-defined zero value, so zero means “nothing”. They are
not restricted in arithmetic operations. Great for research in fields like science and finance, where
you need to use ratios, percentages, proportion and averages to understand the data. Between 0-1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Anteprima parziale del testo

Scarica Statistics: Understanding Data and Statistical Analysis - Prof. Bianconcini e più Appunti in PDF di Statistica solo su Docsity!

INTRODUCTION ( 1 )

Statistics is the study of data and how it can be organized & analyzed to obtain insights. ➢ DESCRIPTIVE STATISTICS = focuses on summarizing and organizing the data to better understand it. Based on facts and proven outcomes. There is no uncertainty because you are describing only what you actually measured. E.g. when you organize your expenses in a table and calculate your average spending, you use descriptive stat to better understand your budget ➢ INFERENTIAL STATISTICS = uses data from a small group to arrive at conclusions about the entire population, so conclusions from a sample. E.g. to understand how Italians will vote at the election you cannot ask everybody, but you must make a selection and ask a subgroup of Italians, a sample.

BASIC CONCEPTS

  • VARIABLE = any characteristic that can be measured. E.g students’ grades, height, and income; Variables may be words ( Qualitative ) or numbers ( Quantitative )
  • DATA = refers to a set of values, organized by variables; so the observed values of the variables. In and of themselves, data do not really tell us much, but when we classify and summarize, they draw important conclusions. Data can be: ➢ QUALITATIVE : they are categorical (use of words). E.g. eye color. ➢ QUANTITATIVE data are numerical (e.g. height, age). Plus they can be either:
  • Continuous (measured; decimals/real numbers; e.g. average time: 2,5min)
  • Discrete (counted; natural numbers; e.g. number of customers: 5670).

SCALES OF MEASUREMENT

Data can be collected using different scales of measurement, which define how we measure the values of a given variable. Qualitative values can be measured: ➢ on a NOMINAL SCALE : used to name or identify people … cannot be ordered. E.g. gender. ➢ on a ORDINAL SCALE : used to measure variables in a natural order, such as ranking. E.g. level of education. (A – B – C) Quantitative values can be measured: ➢ on an INTERVAL SCALE = information about the amount of difference between values. Often used for temperature and time, allowing for precise comparisons and calculations. Do not have a meaningful zero value and, therefore, all arithmetic operations except ratio are allowed. E.g. temperature: 0 degrees does not mean no temperature! It means ‘a temperature of 0 °C ➢ on a RATIO SCALE = Has a well-defined zero value , so zero means “nothing”. They are not restricted in arithmetic operations. Great for research in fields like science and finance, where you need to use ratios, percentages, proportion and averages to understand the data. Between 0- 1

POPULATION

The entire set of statistical units which you study (e.g. Facebook users; Italian voters). POPULATION PARAMETERS : A population parameter is a numerical value that describes a characteristic of a population (e.g. the height of all students in a school is a population parameter) CENSUS = it is a survey that studies every member of a population. When we collect data from all members of the population, we are conducting a census; But, it is often difficult to conduct.

SAMPLE

A subset of the population which we study. We use the sample to obtain knowledge about the population. Samples are used when population sizes are too large for the test (e.g. you select 800 Italian voters to record their preference). Data obtained from a sample is called a statistic. SAMPLING is the statistical procedure.

• RANDOMNESS

A key concept in sampling is randomness, and it has to do with the chances of each person/object in the population to be selected for the study. RANDOM SAMPLING means that there is an equal chance of being chosen → 2 uti t is important to prevent bias! (if a certain group is over/underrepresented, the sample is considered to be biased, and it could lead to inaccurate conclusions about a population). There are several causes of sampling bias:

  • TIMEFRAME at which data are collected
  • BIASED SELECTION by either researchers (choose friends) or subjects themselves (people respond to surveys when do not really care about the topic) To understand voting intention, you may select a sample consisting of:
  • 100 Italian voters in the classroom
  • 400 Italian voters that I personally know
  • 50 randomly selected Italian voters The first 2 samples are convenient since you have easy access to these people, and they are likely to give you the data you are looking for. But they are not representative of the entire Italian electorate. Thus, the results you’d obtain will likely be biased. The third sample may instead be more representative, but consists of only 50 people, so we need to consider the sample size and whether it is appropriate for our study

DATA COLLECTION

We can collect data directly ( PRIMARY DATA ) or we can use data collected by others ( SECONDARY DATA ). To obtain data, we need to decide on the most suitable data collection method:

  • SURVEYS : questionnaires distributed to members of a sample, asking them to respond to a set of predefined questions. They may be paper-based (require data to be typed into a database by someone so errors are inevitable) or online (automatically registered, cheaper & easier but they have a lower response rate than paper-based surveys). Surveys are considered generalizable if they allow us to draw conclusions about the wider population from our sample. However, by using surveys we cannot control external interference (we cannot know when, where, and by whom it was completed)
  • EXPERIMENTS : commonly conducted in controlled laboratory where the researcher controls the conditions under which data are collected → but the results are less generalizable as the sample is usually smaller than surveys’.
  • OBSERVATIONS : allows researchers to record various types of data. For example, people’s body language : the data is collected based on the interpretations of the observer
  • INTERVIEWS : conducted face-to-face or by telephone; they allow for collection of more qualitative data. They are very resource-intensive (require someone to personally interview each subject).

DATA PRESENTATION (2)

Goal : presenting data that we have collected in a way that enables us to make sense of data Through the right visualization it is much easier to interpret data.

FREQUENCY

Refers to the number of times a value occurs in a data set. The tables help you understand which data values are common and which are rare. E.g. in a table presenting data of students’ grade on a quiz (out of 100 possible points), the frequency of a grade in the 80s is 3 , and the frequency of <50 is 9 → quantitative, discrete FREQUENCY TABLE : A frequency table lists a set of values and how often each one appears. FREQUENCY DENSITY = height of the bars

  • FREQUENCY TABLE FOR QUALITATIVE DATA We use bar chart or pie chart. E.g. “ Which country dominated the 2016 Summer Olympics ?”. Based on your data, you construct the frequency table, which lists the medals for the top 10 countries. Each row provides a value (country) alongside with frequency (number of gold medals won by the country). Another example: you survey 30 co-workers (statistical unit) to obtain the following data on their mobile providers (variable)
  • FREQUENCY TABLE FOR QUANTITATIVE DATA Quantitative data are numeric and can be either discrete (countable) or continuous (non- countable). With quantitative data we cannot simply list all the values in our data set since often that would result in very large frequency tables. For example, if we wish to observe the frequencies of grades, it does not make sense to have a table with 100 rows for each possible grade, so we group values into CLASSES before constructing a frequency table. Classes must be mutually exclusive (each data falls into just 1 class) and exhaustive (all data values are represented in the table) Creating classes - 3 steps: 1) NUMBER OF CLASSES = No strict rules. Guided by the number of observations in the data set. Nevertheless, any number between 5 and 20 classes is acceptable, depending on the above considerations. Alternatively, use Sturges’ formula calculate the number of classes: Number of classes = 1+3.3log(n)* E.g. if there are 200 observations, we can use Sturges’ formula as: 1+3.3*log(200)= 8.59 = 9 classes

STEAM AND LEAF PLOT

A Stem and Leaf Plot is a special table where each data value is split into a " stem " (left side) and a " leaf " (right side). If we are dealing with grades, we divide each grade into two parts: e.g. 3 is the stem in 34, while the units become the leaves (e.g. 4 would be the leaf in 34) It helps us visualise the shape and distribution of the data in a manner similar to a histogram. However, with this graph, we do not lose useful information about the data itself, and we can still see where the majority of grades are.

RELATIVE FREQUENCY

Indicates how often a specific event occurs within the total number of observations. It is a type of frequency that uses percentages and fractions. Relative frequencies help you place a type of event into a larger context. For example, a survey indicates that 20 students like their statistics course the most. But you don’t know if that’s a large or small proportion. However, if you knew that 75% respondents indicated that statistics was their favorite, you’d consider it a high number. To create the RELATIVE FREQUENCY TABLE , we divide the frequency of each class by the total number of observations We use a new notation in this table: we use the notation fi to represent the frequency (f) of class i. So f 3 (frequency of class 3). To find the relative frequency we divide the frequency of each class (fi) by the total number of observations (N) → rfi = fi/N relative frequency related to… look book. Relative frequency can be illustrated through a PIE CHART shows, which shows how the whole pie is divided among the classes: the larger the slice, the larger the relative frequency of that class is. Each slide = value.

CUMULATIVE RELATIVE FREQUENCY

The cumulative relative frequency is the sum of all relative frequencies. Ordinal variables. The first number in the Cumulative Relative Frequency’ is the same as the relative frequency of the first class (0.1 5 ). The second was obtained by adding the relative frequency of the second class to the one of the first class, etc..

OGIVE

A graph representing the cumulative relative frequency. The cumulative relative frequencies are shown on the y-axis and class boundaries on the x- axis. We have also added the value of 800, the highest value.

MEASURES OF CENTRALITY & VARIATION (3)

You have just graduated and were offered a job that pays $40,000 per year. You are very happy about the offer but then you discover that the median annual earnings of is $51,940. Are you still happy? Fundamental to any interpretation of data in statistics, is the context in which these data lie. Context refers to the circumstances or conditions in which an event occurs. A commonly used context is the distribution. We describe distribution using:

  • CENTRAL TENDENCIES : describe the centre of the frequency distribution → mean, median, mode.
  • VARIATION : dispersion of data around the centre → range, standard deviation, variance.

• MEASURES OF CENTRALITY

The central tendency of a frequency refers to where its centre lies, but there are different ways to statistically define a distribution’s centre:

  • MODE → most common value with highest absolute frequency
  • MEDIAN → value that splits the distribution in half
  • MEAN → actual centre

< MEAN >

The mean is the usual average, so I'll add and then divide: 13, 18, 13, 14, 13, 16, 14, 21, 13 → (13 + 18 + 13 + 14 + 13 + 16 + 14 + 21 + 13) ÷ 9 = 15 ARITHMETIC MEAN : most commonly used. Calculated by summing all values and dividing this sum by the number of observations Example: you take all the grades obtained by your 20 classmates, sum them up, and divide them by 20. Result: what would be the value of your variable if we all had the same n. GEOMETRIC MEAN : multiplies all values and finds a root (fai la radice) of the number. WEIGHTED MEAN : You took three 3-credit courses whose grades are: 80; 75; 85. You also took two 4-credit courses with grades of 90 and 95. The simple average of all five courses would be 85, but it does not account for the different credit values. Your weighted average is:

< MEDIAN >

The value that divides the data in half, you first put them from lowest to highest.

  • If n is odd (dispari): the median is the middle observation
  • If n is even (pari): the median is the average of the middle 2 (1,2, 3,4 ,5,6 = 3+4/2=3,5) Otherwise you use L = 0.5(n (numeri che hai) +1)* = o.5*11 = 5.5 (so the value of the median will be in between value in location 5 and value in location 6) Although the mean is the most commonly used measure of centrality, the median is often viewed as being more accurate. Why? Because the mean has 1 key limitation: if most students received grades around 70% on a quiz but two students missed the test and thus received a zero, then the mean would be pulled down by these two extreme values. By contrast, the median is less sensitive to extreme data values relative to the mean, and can therefore provide a more accurate view of the centre of data distribution.

< MODE >

The most common value. For example, in the set {1, 2, 2, 3, 4, 5} the mode is the value 2, which appears twice in this data set. There is no mode when each value appears exactly once. For population and for large samples, we report the MODAL CLASS rather than a specific mode value. The modal class is the class with the highest frequency. In the example below, the modal class is the last one, counting schools with an annual cost greater than $39k. For this reason, we more often create a histogram first and then identify the modal class (the peak of the histogram) rather than compute a specific mode value. A distribution with a single modal class (one peak) is called unimodal , and a distribution with two modal classes (two peaks) is called bimodal. Which is best?

  • Mean, median, and mode are affected differently by extreme observations
  • The mean is generally pulled towards the extreme values in the data set
  • While the mean is often our first choice, in skewed distributions we may opt for the median instead

< VARIANCE >

Variance measures how far each number in the set is from the mean. Variance is often depicted by this symbol: σ^2. It is used by both analysts and traders to determine volatility and market security. It is calculated as the average of the squared deviations of a data set

  • For population variance , dividi la somma of squared deviations by the population size
  • For sample variance , dividi la somma of squared deviation by the sample size minus 1 (n-1) So in the example, which is a sample, you do: 694 : 9 = 77.

< STANDARD DEVIATION >

It’s calculated as the square (radice) of the variance. In our example: √77.11 = 8. The standard deviation is the average amount of variability in your dataset. It tells you, on average, how far each value lies from the mean. A high standard deviation means that values are generally far from the mean, while a low standard deviation indicates that values are clustered close to the mean. Here the standard deviation is higher for Section 2 than for Section 1 Another use for the standard deviation is to gain information about the location of a specific data value. We can say that a specific value lays, for example, 2 standard deviations above the mean, or three below the mean, and so on When data are normally distributed, the mean, the median, and the mode are identical, and the distribution is symmetrical around these values. For normal distributions THE EMPIRICAL RULE states that:

  • Approximately 68% of the values are within 1σ from the mean (± one standard deviation) → e.g. if the grades of 100 students are normally distributed with a mean of 73 and a standard deviation of 8, the empirical rule tells us that approximately 68 students have grades between 65 (73-8) and 81 (73+8)
  • Approximately 95% of the values are within 2σ from the mean
  • Nearly all values are within 3σ from the mean When we compare the variation of two distributions:

< COEFFICENT OF VARIATION >

Statistical measure of the dispersion of data points in a data series around the mean ➢ If the mean is the same – direct comparison of the width of the distribution ➢ If the mean is different – ratio of the standard deviation to the mean EXAMPLE Compare two companies’ stocks: one company have an average price of $26.05, and a standard deviation of $7.00; the other has average price of $0.77 and a standard deviation of $1. You need to do = 7/26.05 * 100 = 26.87% = 1/0.77 * 100 = 129.87% The penny stock is much more volatile (which exhibits more variation over time)

MEASURES OF RELATIVE STANDING

PERCENTILE

Percentiles show how a given value compares to others providing information about the positions of particular values relative to the entire data set The general rule is that if a value is in the kth percentile, it is greater than K per cent of the total values. When you get a score on the SAT, CAT, or GRE, the units themselves are meaningless. A total CAT score of 120 isn't significant. Instead, you're more interested in knowing what percentage of test-takers you outperformed. A total score of 120 on the CAT is roughly in the 90th percentile. Congratulations, you scored better than 90% of the other test-takers. Only 10% scored better than you. E.g. In the case of SAT scores you want to know the 60th percentile so do: → the value located in place 6.6 is the 60th percentile To calculate the actual value of the 60th percentile, you can use