Docsity

Frequency Distribution Tables and Bivariate Analysis - Prof. Vilá, Ejercicios de Administración de Empresas

Vista previa parcial del texto

¡Descarga Frequency Distribution Tables and Bivariate Analysis - Prof. Vilá y más Ejercicios en PDF de Administración de Empresas solo en Docsity!

Notes on Statistics I

Xavier Vilà

Universitat Autònoma de Barcelona

Year 2017-

2 Statistics I

4 Statistics I

Contents

  • 1 Data Analysis
    • 1.1 Collecting data: sampling and properties
      • 1.1.1 Simple random sampling (SRS).
      • 1.1.2 Systematic sampling.
      • 1.1.3 Stratified sampling.
      • 1.1.4 Step by step sampling.
    • 1.2 Types of variables and frequency distribution tables
      • 1.2.1 Types of variables
      • 1.2.2 Univariate frequency distribution - titative variables 1.2.2.1 Frequency distribution of qualitative or discrete quan- - ables 1.2.2.2 Frequency distribution of continuous quantitative vari-
      • 1.2.3 Multivariate frequency distributions.
      • 1.2.4 Marginal and conditional distributions of frequencies
        • 1.2.4.1 Marginal distribution of frequencies
        • 1.2.4.2 Conditional distributions of frequencies
    • 1.3 Graphical representations
      • 1.3.1 Graphical representation of discrete variables
        • 1.3.1.1 Bar diagrams
        • 1.3.1.2 Circle diagrams
      • 1.3.2 Graphical representation of continuous variables
        • 1.3.2.1 Histograms
        • 1.3.2.2 Box plots
    • 1.4 Measures of position, dispersion, and shape
      • 1.4.1 Measures of position
        • 1.4.1.1 The mean 6 CONTENTS
        • 1.4.1.2 The median
        • 1.4.1.3 Quartiles
        • 1.4.1.4 Percentiles
      • 1.4.2 Measures of dispersion
        • 1.4.2.1 Mean quadratic error
        • 1.4.2.2 The variance
        • 1.4.2.3 The standard deviation
        • 1.4.2.4 The coefficient of variation
        • 1.4.2.5 Interquartile range
      • 1.4.3 Measures of shape
        • 1.4.3.1 The mode
        • 1.4.3.2 The asymmetry coefficient
        • 1.4.3.3 The kurtosis coefficient
    • 1.5 Covariance and correlation coefficient
    • 1.6 Mean and variance of linear combinations of variables
    • 1.7 Mean vector and covariance matrix
  • 2 Probability Theory
    • 2.1 Sample Space and Random Events
      • 2.1.1 Random Events.
      • 2.1.2 σ-algebra of events (A).
      • 2.1.3 Types of events
      • 2.1.4 Operations with events
      • 2.1.5 Venn diagrams
      • 2.1.6 Properties of events.
    • 2.2 Probability: axiomatic definition and interpretations
      • 2.2.1 Axiomatic definition of probability
      • 2.2.2 Probability interpretations
    • 2.3 Combinatorics
      • 2.3.1 Permutations
      • 2.3.2 Combinations
    • 2.4 Probability computation and its properties
    • 2.5 Conditional probability and stochastic independence.
  • CONTENTS - 2.5.1 Conditional probability - 2.5.2 Stochastic independence
    • 2.6 Total probability and Bayes theorems
      • 2.6.1 Total probability theorem
      • 2.6.2 Bayes theorem
  • 3 Discrete random variables
    • 3.1 Definition of random variable
    • 3.2 Probability function and distribution function
      • 3.2.1 Probability function
      • 3.2.2 The distribution function
    • 3.3 Numeric characteristics: Expectation and Variance
      • 3.3.1 Expectation
      • 3.3.2 Variance
    • 3.4 Multidimensional random variables
    • 3.5 Joint and marginal probability functions
      • 3.5.1 Joint probability function
      • 3.5.2 Marginal probability functions
      • cept of independence 3.6 Conditional probability function and conditional expectation. The con-
      • 3.6.1 Conditional probability functions
      • 3.6.2 Conditional expectation
      • 3.6.3 Stochastic independence
    • 3.7 Covariance and Correlation coefficient. Covariances matrix
      • 3.7.1 Covariances Matrix
    • 3.8 Classical discrete distributions: Bernoulli, Binomial, Poisson
      • 3.8.1 Bernoulli distribution
      • 3.8.2 Binomial distribution
      • 3.8.3 Geometric distribution.
      • 3.8.4 Poisson distribution.
  • 4 Continuous Random Variables 8 CONTENTS
    • 4.1 Density function and distribution function
      • 4.1.1 The density function
      • 4.1.2 The distribution function
    • 4.2 Numeric characteristics: Expectation and Variance
      • 4.2.1 Expectation
      • 4.2.2 Variance
    • 4.3 Joint and marginal density functions
      • 4.3.1 Joint density function
      • 4.3.2 Marginal density functions
    • 4.4 Conditional density functions and conditional expectation
    • 4.5 Classical continuous distributions: Uniform, Exponential, Normal
      • 4.5.1 Uniform distribution
      • 4.5.2 Exponential distribution
      • 4.5.3 Normal distribution
        • 4.5.3.1 Standard Normal distribution
    • 4.6 Normal approximation to the Binomial distribution
  • A Statistical Tables
    • A.1 The Standard Normal Distribution
    • A.2 The t − student Distribution
    • A.3 The χ^2 Distribution
    • A.4 The Snedecor ’s F Distribution
    • A.5 Values for the Kolmogorov-Smirnov test

10 CONTENTS

mainly to the research by Kolmogorov, was developed in the XXth century, and is the approach that we follow in these notes.

Chapter 1

Data Analysis

The power of Averages, it means a lot if you can understand Means, a lot. Anubis the Philosomancer

Statistics can be defined, in short, as follows

Definition 1.0.1 Statistics is a set of techniques whose goal is to understand and draw conclusions about a phenomenon (or phenomena), in a particular place and time, using the information contained in a set of data

For example, we may study the unemployment in Catalonia this year using the “En- cuesta de Población Activa (EPA)”, or the opinion poll of the electorate before any call for elections using surveys published in the media

Technically, the "phenomenon" to study is called variable, while that "particular place and time" is the population. In the same sense, "data" is usually called sample data (or observations). In this way,

Definition 1.0.2 Population is the set of elements to study from which we want to draw a conclusion with respect to some of its features (or variables)

Definition 1.0.3 Sample is a subset of the population used to collect information and draw conclusions

Definition 1.0.4 Variables are those features or phenomena of the population that we want to study

Definition 1.0.5 Data are the specific values of the considered variables that we ob- serve in the sample at hand

1.1. COLLECTING DATA: SAMPLING AND PROPERTIES 13

Vallès. By law, All homes must be registered in the Registry of the Property, with the corresponding declaration of their cadastral value. Therefore, in this case we have all the necessary information for all the elements of the population at study, that is, all the houses in Cerdanyola. The same happens, in many cases, when we want to study some macroeconomic variables. Many international or- ganizations (World Bank, International Monetary Fund, EUROSTAT, etc.) have exhaustive databases with information on a large number of socioeconomic vari- ables of interest. These databases can be downloaded from the electronic sites of these organizations, and used in statistical research.

  • Finally, it might be the case that this sort of comprehensive records are not avail- able at all, or that the population at study is so large that it is not possible to have information about each and every one of the elements of that population. For example, if we want to study the consumption habits in Cerdanyola, we should interview more than 50,000 individuals and that, in practice, is unfeasible. It is in these cases when it becomes necessary to obtain one sample from the population.

We will see next what a sample is, that is, how a sample can be selected out of a population. Since we want to study this sample to produce conclusions about the pop- ulation, it can not be selected arbitrarily. In this sense, there exist rigorous techniques specially tailored for this purpose. In what follows, the more basic techniques will be introduced, while more sophisticated analysis are out of the scope of these notes. The following definition introduces the idea of sampling

Definition 1.1.1 Sampling is a systematic technique to select a sample out of a popu- lation in such a way that it is representative of that population

Here, the keyword is representative. Indeed, if we want our sample to be used in order to produce "reliable" conclusions regarding the original population, we would better have a sample that closely resembles (in its structure) the original population. For instance, if we want to conduct an electoral survey and we only interview people living in a "rich" neighborhood, then it is clear that their answers will not be representative of the whole population.

There are different types of sampling techniques, depending on the specific features of the study at hand. The more important are:

1.1.1 Simple random sampling (SRS).

This is the "most random" of all the sampling methods, and throughout this notes we will normally assume that samples are obtained using this technique. Its main feature is that all elements in the population have the same probability of being selected to be incorporated to the sample. In other words, the sample is constructed completely at random. If we think for a moment of all the possible different samples of a given size that can be selected from a given population, simple random sampling means that each of these samples has the same probability of been selected as "the sample", i.e., they are equally likely

Example 1.1.2 Consider a population consisting of only 4 elements

14 CHAPTER 1. DATA ANALYSIS

Population = {A, B, C, D}

If, for instance, we want to draw a sample of size 2, there are 6 possible samples

Sample 1 Sample 2 Sample 3 Sample 4 Sample 5 Sample 6 {A, B} {A, C} {A, D} {B, C} {B, D} {C, D}

Table 1.1: Possibles Samples

Hence, in a simple random sampling (SRS), each of this samples has the same proba- bility of being selected, 16 in this case. Analogously, we may also say that each of the four elements in the Population has the same probability of being drawn to enter the selected sample. Indeed, since each of the elements belongs to exactly 3 of the possible sample and each possible sample has probability 16 of being the selected sample, then the probability for any of the elements in the Population of entering the selected sample is 16 + 16 + 16 = 12.

This probability ( 12 ) can also be understood as each element in the Population having probability 14 of being the first element to enter the sample and probability 1334 of being selected as the second element in the sample given that it has not been selected in the first place, which yields a total of 12 probability of being one of the two elements in the sample.

1.1.2 Systematic sampling.

The Systematic Sampling consists of a variant of a SRS. It is useful when the popu- lation to sample is not "static", but changes often. The following example shows how this method works.

Example 1.1.3 Consider a factory that manufactures Intel "chips". The managers want to study how many of these chips turn out to be faulty every day. The factory has a "chain" process so that once the "chip" has been assembled, it automatically enters in the packaging process and then moves into warehouse. Let us suppose that the factory produces 100 "chips" a day, and that a sample of size 5 is going to be se- lected. It is clear that the managers can not wait until the end of the day, then stop all processes, randomly select 5 chips, and start all processes over again. This would be very costly. What is needed is a way to randomly select "chips" but without having to stop the manufacturing chain process. Here is what can be done in cases like this.

  1. Select "a priori" which "chips" will be systematically taken out from the chain process to enter the sample. In this example, if 100 chips are produced daily and only 5 need to go to the sample, then we must select one chip out of every 20 produced chips.
  2. Randomly pick a number between 1 and 20 (here is were "randomness" play a role). Let us suppose that the selected number is 6.

16 CHAPTER 1. DATA ANALYSIS

  1. Finally, within each of the selected cities perform one SRS more to select one public school to visit.

In this way, we have selected 200 public schools to visit in Catalonia with travel costs lower than using a SRS. The problem, though, is that the sample obtained will be less representative.

In some cases the sample is obtained without any randomness at all. For instance, if we want to test a new drug against malaria, we can not just randomly select "subjects" and force them to take the drug. In cases like this, a call for volunteers is made. This techniques are usually much less representatives that a random technique. Furthermore, since there are no random components in the sample, we can not use probabilistic tools to study the sample and, therefore, statistical inference techniques can not be properly applied.

1.2 Types of variables and frequency distribution ta-

bles

In order to conduct an statistical analysis using the data in the sample, it is necessary first to organize and present in a clear, simplified and understandable way this infor- mation. Descriptive Statistics is a sub-field within statistics that deals with the task of arranging the data in such a way that the analysis becomes easier.

Definition 1.2.1 Descriptive statistics deals with the study of a set of data, correspond- ing to one or more variables of a population, and its arrangement in order to facilitate its understanding and use

Once all the information is arranged in a clear and efficient way, the researcher can use "statistical inference" techniques, which use probabilistic tools, to extend the conclu- sions obtained from the sample to the entire population that is under study.

1.2.1 Types of variables

As we have seen before, the characteristic of the population that is to be studied is represented by means of a variable (unemployment, income, etc.) As in other branches of mathematics, variables are usually denoted using the last letters of the alphabet (in uppercase), X, Y, Z. If we need to consider many variables at the same time the use subscripts becomes convenient, X 1 , X 2 ,... , Xn.

The different data points (or observations) for each variable that we obtain from a sample are often denoted using subscripts of the corresponding variable (in lowercase). For instance, if we have 3 data points corresponding to the variable labeled X 3 we will represent them as x 31 , x 32 , x 33. If we only have one variable, X, then we simply use the notation x 1 , x 2 , x 3.

When variables have meaningful names, it is customary to use acronyms that match their description to ease the interpretation of those variables (for instance, GDP for Gross Domestic Product).

According to their nature there are two types of variables:

1.2. TYPES OF VARIABLES AND FREQUENCY DISTRIBUTION TABLES 17

  1. Qualitative variables. These are variables that, by their own nature, are not measured numerically. There are two types:

(a) Nominal (or categorical) variables. These are variables whose values are categories, such as the profession, the gender, or the studies of a person. Each observation is usually associated, for convenience, with a number (or letter) according to some established criteria. For example, for the variable profession we could have: 1: Entrepreneur 2: Employee 3: Unemployed 4: Retiree An important feature of this type of variable is that it does not make sense doing calculations with their values. For example, from the list of values of the profession variable considered above, saying that the average profession is 2.35 can not be interpreted in any meaningful way. (b) Ordinal (or scale) variables. These are variables whose values correspond to the elements of a scale or ranking, such as the degree of satisfaction with a given product, or the position in a given classification. For example, for the variable Degree of satisfaction with the Statistics I course we could have: 1: Very unsatisfied 2: Not satisfied 3: Satisfied 4: Very satisfied

In this case, since the values that the variable can take determine an order, it makes sense to do some calculations with these values. For example, if we get an average satisfaction level of 3.35 in a sample, we can conclude that the degree of satisfaction is between Satisfied and Very satisfied.

  1. Quantitative (or numerical) variables. These are variables than can be mea- sured numerically. There are two types

(a) Continuous variables: can take any value within a range. Usually corre- spond to measurement values. For example the temperature or the weight of electronic parts. (b) Discrete variables: can take any value from a finite (or countable) list of values^1. For example, the number of students that pass a given subject, or the number of times that we obtain “heads” when tossing a coin a given number of times.

Example 1.2.2 Consider the table 1.2, which summarizes a survey of 10 families living in Cerdanyola. Here we consider 5 variables.

(^1) In practice, to study these variables we will use the same techniques as with qualitative variables.

1.2. TYPES OF VARIABLES AND FREQUENCY DISTRIBUTION TABLES 19

  • X 3 → Quantitative continuous

X 3 [0, ∞]

  • X 4 → Quantitative continuous

X 4 [0, ∞]

  • X 5 → Qualitative nominal
    1. X 5 ∈ { 0 , 1 }, where

0 Without fiber at home 1 With fiber at home

1.2.2 Univariate frequency distribution

The “raw” data of a variable provides very little useful information, specially if the dataset is large. It is necessary to classify it so that it becomes informative. This is done differently depending on whether we deal with a continuous quantitative variable or a discrete quantitative or qualitative variable. The question, ultimately, is to know how many times each data value appears in the sample (how many people are unemployed, how many people will vote for the PP, etc.), or maybe some other type of summary.

1.2.2.1 Frequency distribution of qualitative or discrete quantitative variables

In the case of quantitative discrete or qualitative variables (they are treated alike^2 ), what we do is first to look at how many different values the variable has taken, and then count how many times each of theses values appears in the sample.

In the previous example, X 1 , X 2 , i X 5 can be thus treated in the same way.

Let us take, for example, X 1. We have the following data

{x 11 , x 12 , x 13 , x 14 , x 15 , x 16 , x 17 , x 18 , x 19 , x 110 } = { 2 , 3 , 4 , 5 , 8 , 2 , 4 , 5 , 7 , 2 }

We observe that we have 10 observations of the variable X 1 , but it only takes 6 differ- ent values which we represent with v. Thus, the list of different values that X 1 takes in our sample is: {v 1 , v 2 , v 3 , v 4 , v 5 , v 6 } = { 2 , 3 , 4 , 5 , 7 , 8 }

From this list we can create a frequency distribution consisting on counting how many times each of these values is found in the data. In this sense, we define below the important concepts of absolute frequency and relative frequency

(^2) Statistically they can be treated in the same way because in both cases we work with an enumerable list of values that the variable has taken. We will see that for the case of continuous quantitative variables this is not useful.

20 CHAPTER 1. DATA ANALYSIS

Definition 1.2.3 The absolute frequency (ni) of a value vi is the number of times this value is found in the data set

Definition 1.2.4 The relative frequency (fi) (o proportion) of a value vi is the per- centage of times this value is found in the data set

Clearly, if n the total number of observations in the data set we have,

fi =

ni n

Moreover, we can compute^3 the cumulative frequencies (absolute (Ni) and relative (Fi)) for each value as the sum of all the frequencies (absolute (ni) or relative (fi)) of the lower values including that of the value for which we are computing the cumulative frequency. Thus, such cumulative frequencies are interpreted as:

Ni → number of data points (observations) of the variable that are less or equal than vi

Fi → proportion of data points (observations) of the variable that are less or equal than vi

Table1.3 summarizes all such frequencies for the variable X 1. Notice, for example, the following interpretations:

n 3 = 2 → There are 2 observations of the variable that are equal to v 3 = 4

f 3 = 0. 2 → 20% of the observations of the variable are equal to v 3 = 4

N 3 = 6 → There are 6 observations of the variable that are less or equal than v 3 = 4

F 3 = 0. 6 → 60% of the observations of the variable are less or equal than y 3 = 4

Absolute Relative Absolute Cumulative Relative Cumulative Value of Frequency Frequency Frequency Frequency X 1 (ni) (fi = n ni ) (Ni) (Fi = N ni ) 2 3 0.3 3 0. 3 1 0.1 4 0. 4 2 0.2 6 0. 5 2 0.2 8 0. 7 1 0.1 9 0. 8 1 0.1 10 1

Table 1.3: Table of frequencies for the variable X 1

The frequencies of any variable always satisfy the properties below, where k represents the number of different values the variable takes^4 (^3) It does not make any sense to do this for nominal qualitative variables since this computation requires a natural ordering of the values vi (^4) In our example, k = 6.