Probability Statistics

Cover

Topic 06 Continuous (Part 2)_261103_083038.pdf

Table of contents

  1. The Normal Distribution (Part2)
  2. The Central Limit Theorem
  3. Example 6-13: Hours of Television
  4. Example 6-14: Vehicle Age
  5. Example 6-15: Meat Consumption

1. The Normal Distribution (Part2)

1.1 Normal Distributions

A normal distribution, also known as a bell-shaped distribution, is one of many possible shapes for a data distribution. It is particularly important because many statistical methods assume that the data are normally or approximately normally shaped 2.

There are several methods statisticians use to check if data follows a normal distribution. This section focuses on three primary methods: constructing a histogram, calculating Pearson's Index of Skewness, and checking for outliers 2 3.

1.2 Checking for Normality

Statisticians employ various techniques to assess whether a dataset approximates a normal distribution. The methods covered include visual inspection via histograms, quantitative measures of skewness, and identification of extreme values 3.

The following methods are used to check for normality:

  • Histogram: A graphical representation of the data's frequency distribution. An approximately bell-shaped histogram suggests normality4.
  • Pearson’s Index of Skewness (PI): A statistical measure to quantify the asymmetry of a distribution. A PI value between -1 and +1 indicates that the distribution is not significantly skewed.
  • Outliers: Extreme values in a dataset that lie far from the other observations. The absence of outliers, determined using the Interquartile Range (IQR), supports the assumption of normality 3 5.

Other tests for normality include the Normal Quantile Plot, Chi-Square Goodness-of-Fit Test, Kolmogorov-Smirnov Test, and Lilliefors Test 3.

1.3 Example 6-11: Technology Inventories

A survey of 18 high-technology firms recorded the number of days’ inventory they had on hand. The data collected were: 5, 29, 34, 44, 45, 63, 68, 74, 74, 81, 88, 91, 97, 98, 113, 118, 151, 158 4 6.

The following steps were taken to determine if this data is approximately normally distributed:

Method 1: Construct a Histogram The histogram generated from this data was approximately bell-shaped 4 6.

Method 2: Check for Skewness The mean (Xˉ\bar{X}) was calculated as 79.5, the median (MD) as 77.5, and the standard deviation (ss) as 40.5. Pearson's Index of Skewness (PI) was calculated using the formula: PI=3(Xˉ−MD)sPI = \frac{3(\bar{X} - MD)}{s} Substituting the values: PI=3(79.5−77.5)40.5=3(2)40.5=640.5≈0.148PI = \frac{3(79.5 - 77.5)}{40.5} = \frac{3(2)}{40.5} = \frac{6}{40.5} \approx 0.148 Since the PI (0.148) is not greater than 1 or less than -1, the distribution is not significantly skewed 5 6.

Method 3: Check for Outliers The five-number summary of the data is: Minimum = 5, Q1 = 45, Median = 77.5, Q3 = 98, Maximum = 158. The Interquartile Range (IQR) is Q3 - Q1 = 98 - 45 = 53. To check for outliers, the following boundaries were calculated:

  • Lower boundary: Q1−1.5(IQR)=45−1.5(53)=45−79.5=−34.5Q1 - 1.5(\text{IQR}) = 45 - 1.5(53) = 45 - 79.5 = -34.5
  • Upper boundary: Q3+1.5(IQR)=98+1.5(53)=98+79.5=177.5Q3 + 1.5(\text{IQR}) = 98 + 1.5(53) = 98 + 79.5 = 177.5 No data points fall below -34.5 or above 177.5, indicating that there are no outliers in the dataset 5 6.

Conclusion Based on the approximately bell-shaped histogram, the absence of significant skewness (PI ≈ 0.148), and the lack of outliers, it can be concluded that the distribution of technology firm inventories is approximately normally distributed 6.

📝 The data for technology firm inventories, when analyzed using a histogram, Pearson's Index of Skewness, and outlier detection, collectively suggest an approximate normal distribution because the histogram is bell-shaped, the skewness index is within the acceptable range (-1 to 1), and no extreme outliers were found 4 5 6.

2. The Central Limit Theorem

2.1 Distribution of sample means

A sampling distribution of sample means is a distribution created by calculating the means from random samples of a specific size taken from a population. Sampling error is the difference between a sample measure and its corresponding population measure, arising because the sample is not a perfect representation of the population 8.

2.2 Properties of the distribution of sample means

The mean of the sample means is equal to the population mean. The standard deviation of the sample means, known as the standard error of the mean, is smaller than the population standard deviation and is calculated by dividing the population standard deviation by the square root of the sample size 9 10.

2.3 The Central Limit Theorem

The Central Limit Theorem states that as the sample size (nn) increases, the shape of the distribution of sample me

Cover

Topic 2 Sampling techniques & sample composition.pptx

Understanding sampling concepts and its importance

Sampling is a crucial research methodology that involves studying a smaller, representative subset of a larger population to gather insights and make inferences about the entire group.

1.1 The concept of sampling

The fundamental idea behind sampling is to obtain information about a larger population by interviewing or observing a smaller, manageable part of it. This approach is necessary when studying the entire population is impractical due to time, cost, or logistical constraints. The ultimate goal is to make statements about the whole population that are applicable and reliable based on the findings from the sample.

1.2 Objectives of sampling

The primary objectives of sampling are:

  • To gather information about a target population.
  • To generalize the findings from the sample to the entire population.
  • To do so in a scientifically sound and efficient manner.

1.3 Key terms and definitions

  • Population: The entire group about which the researcher needs to obtain information. This is also referred to as the target group of the research. For example, all students enrolled at UCLL constitute a population.
  • Sampling frame: An accessible list or enumeration of the population from which a sample can be drawn. An example would be a database of UCLL students.
  • Sample: The selected respondents who will participate in the survey or study.
  • Census: In certain specific cases, it may be opportune to survey the entire population instead of a sample.

1.4 The importance of representativeness

For the results of a sample to be generalized to the population, the sample must be representative. This means the sample should accurately reflect the characteristics of the population.

Tip: A sample is considered representative if it is selected in a scientific manner. For instance, if the population of UCLL students comprises 37% males and 63% females, a representative sample of 1,000 students should also ideally consist of 370 males and 630 females.

1.5 Sampling techniques

Sampling techniques are broadly categorized into probability sampling and non-probability sampling.

1.5.1 Probability sampling techniques

In probability sampling, respondents are selected randomly, ensuring that every member of the population has an equal chance of being chosen for the study.

1.5.1.1 Simple random sampling

This is considered the purest form of probability sampling.

  • Requirement: A complete sampling frame is necessary.
  • Process: Each member of the sampling frame is assigned a unique number. The sample is then composed by randomly selecting a subset of these numbers.
  • Problem: A complete sampling frame is not always available.
1.5.1.2 Systematic sampling

This is an alternative to simple random sampling.

  • Requirement: A complete sampling frame is necessary.
  • Process: Each member of the sampling frame is numbered. The researcher calculates an interval (kk), and respondents are selected based on this interval. For example, if the population size (NN) is 15,000 and the desired sample size (nn) is 1,500, the interval would be k=N/n=15000/1500=10k = N/n = 15000/1500 = 10. The researcher would then select every 10th person, starting from a randomly chosen point.
  • Advantage: Can be simpler to implement than simple random sampling.
1.5.1.3 Stratified sampling

This technique involves dividing the sampling frame into subgroups (strata) with similar characteristics.

  • Strata: These are often socio-demographic categories (e.g., age groups, gender, region). Strata are internally homogeneous.
  • Process: A number of respondents are selected from each stratum using simple random or systematic sampling.
  • Proportional stratified sample: The sample size from each stratum is made proportional to the size of that stratum in the population. This allows for generalization of results to the entire population.
  • Disproportional stratified sample: The sample sizes from strata are not proportional to their population sizes. While this can be useful for in-depth analysis of smaller strata, results from such a sample should not always be generalized to the entire population unless the data is re-weighted.
1.5.1.4 Cluster sampling

In cluster sampling, the population is divided into clusters, which are typically geographical areas.

  • Clusters: These are internally heterogeneous groups.
  • Process: One or more clusters are randomly selected, and all members within the selected cluster(s) are included in the sample.
  • Remark: The composition of the population frame must be reflected in the selected cluster(s). A cluster is considered a "mini-population."
Cover

Topic_4_Part_1_Student_.pdf

Introduction to probability distributions

This section introduces the foundational concepts of probability distributions, focusing on random variables, their types, and the characteristics and construction of discrete probability distributions.

1. Introduction to probability distributions

1.1 Random variables

A random variable is a variable whose value is determined by the outcome of an experiment. It assigns a numerical value to each outcome in the sample space. Random variables are typically denoted by uppercase letters like XX, YY, or ZZ, while their corresponding values are denoted by lowercase letters xx, yy, or zz 4 5.

There are two main types of random variables:

  • Discrete Random Variables: These are random variables that can assume only countable values 5.
  • Examples include the number of cars sold in a month the number of fish caught on a trip the number of telephone calls received daily or the number of road accidents in a month 6.
  • Continuous Random Variables: These are random variables that can assume any value within a given range. (Note: While mentioned, continuous random variables are not elaborated upon in the provided pages) 5.

Tip: Understanding the distinction between discrete and continuous random variables is crucial for selecting the appropriate probability distribution and analysis methods.

1.2 Probability distribution of a discrete random variable

The probability distribution of a discrete random variable lists all the possible values that the random variable can assume, along with their corresponding probabilities 8.

1.2.1 Characteristics of a probability distribution

A probability distribution must satisfy two essential characteristics 9:

  1. The probability of each value of the random variable must be non-negative: P(X=x)≥0P(X = x) \geq 0 for every possible value of xx 9.
  2. The sum of all probabilities for all possible values of the random variable must equal 1: ∑P(X=x)=1\sum P(X = x) = 1 9.

Tip: Always check these two conditions to validate if a given distribution is a true probability distribution.

1.2.2 Examples of determining valid probability distributions

Example 1: Determine if the following tables represent valid probability distributions 10 11.

Table 1:

xxP(X=x)P(X = x)
10.7
20.5
3-0.2
  • Analysis: This is not a valid probability distribution because P(X=3)<0P(X = 3) < 0 11.

Table 2:

xxP(X=x)P(X = x)
20.25
30.34
40.28
50.13
Total1.00
  • Analysis: This is a valid probability distribution because P(X=x)≥0P(X = x) \geq 0 for all xx, and ∑P(X=x)=1\sum P(X = x) = 1 11.

Table 3:

xxP(X=x)P(X = x)
00.08
10.11
20.39
30.27
Total0.85
  • Analysis: This is not a valid probability distribution because ∑P(X=x)≠1\sum P(X = x) \neq 1 11.

1.2.3 Constructing a probability distribution

Example 2: The number of breakdowns per week for a machine has the following probability distribution 12 13.

Breakdowns per week (xx)0123
Probability (P(X=x)P(X=x))0.150.200.350.30

(a) Present this probability distribution graphically. A graphical representation can be a bar chart where the x-axis represents the number of breakdowns and the y-axis represents the probability 13.

(b) Find the probability that during a given week, the number of breakdowns for this machine is:

  • (i) exactly 2: P(X=2)=0.35P(X = 2) = 0.35 14.
  • (ii) 0 to 2 (inclusive): P(0≤X≤2)=P(X=0)+P(X=1)+P(X=2)=0.15+0.20+0.35=0.70P(0 \leq X \leq 2) = P(X=0) + P(X=1) + P(X=2) = 0.15 + 0.20 + 0.35 = 0.70 14.
  • (iii) more than 1: P(X>1)=P(X=2)+P(X=3)=0.35+0.30=0.65P(X > 1) = P(X=2) + P(X=3) = 0.35 + 0.30 = 0.65 14.
  • (iv) at most 1: P(X≤1)=P(X=0)+P(X=1)=0.15+0.20=0.35P(X \leq 1) = P(X=0) + P(X=1) = 0.15 + 0.20 = 0.35 14.
  • (v) between 0 and 3: This implies P(0<X<3)P(0 < X < 3), which are P(X=1)+P(X=2)=0.20+0.35=0.55P(X=1) + P(X=2) = 0.20 + 0.35 = 0.55. If interpreted as inclusive (P(0≤X≤3)P(0 \leq X \leq 3)), the probability is 1.00. Based on the structure, it likely refers to the values strictly between 0 and 3.
  • (vi) between 1 and 3 inclusive: P(1≤X≤3)=P(X=1)+P(X=2)+P(X=3)=0.20+0.35+0.30=0.85P(1 \leq X \leq 3) = P(X=1) + P(X=2) + P(X=3) = 0.20 + 0.35 + 0.30 = 0.85 14.

Example 3: According to a survey, 60% of all students at a large university suffer from mathematics anxiety. Two students are randomly selected. Let XX denote the number of students in this sample who suffer from mathematics anxiety. Develop the probability distribution of XX 15.

  • Let AA be the event a student suffers from mathematics anxiety. P(A)=0.60P(A) = 0.60.
  • Let AcA^c be the event a student does not suffer from mathematics anxiety. $P(A^
Cover

Topic_4_Part_1_Student_.pdf

Random variables and their probability distributions

Random variables are fundamental to probability theory, assigning numerical values to the outcomes of random experiments.

1. Random variables and their probability distributions

A random variable is a variable whose value is determined by the outcome of an experiment. Random variables are typically denoted by uppercase letters like X,Y,X, Y, or ZZ, while their corresponding values are represented by lowercase letters such as x,y,x, y, or zz. For instance, if an experiment involves tossing a coin twice, the sample space is {HH, HT, TH, TT}. If XX represents the number of tails, its possible values are 0, 1, and 2, with each value assigned to specific outcomes (e.g., X=0X=0 for HH, X=1X=1 for HT and TH, X=2X=2 for TT) 4 5.

There are two main types of random variables: discrete and continuous 5.

1.1 Discrete random variables

A discrete random variable is characterized by its ability to assume only a countable number of values 6.

Common examples of discrete random variables include:

  • The count of cars sold at a dealership in a month 6.
  • The number of fish caught during a fishing trip 6.
  • The quantity of telephone calls received on a particular day 6.
  • The number of road accidents occurring within a month 6.

1.1.1 Probability distribution of a discrete random variable

The probability distribution of a discrete random variable is a comprehensive list that enumerates all possible values the random variable can take, along with their associated probabilities 8.

1.1.2 Characteristics of a probability distribution

For a probability distribution of a discrete random variable XX to be valid, it must satisfy two key characteristics 9:

  1. The probability of each possible value must be non-negative: 0≤P(X=x)≤10 \le P(X=x) \le 1 for every value of xx 9.
  2. The sum of the probabilities for all possible values must equal 1: ∑P(X=x)=1\sum P(X=x) = 1 9.

Tip: When evaluating a probability distribution, always check both conditions. A common mistake is to only verify that the sum of probabilities equals 1, forgetting the requirement for non-negative probabilities.

1.1.2.1 Verifying probability distributions: Examples

Example 1: Determine if the following tables represent valid probability distributions.

Table 1:

xP(X = x)
10.7
20.5
3-0.2
Total 1

Table 2:

xP(X = x)
20.25
30.34
40.28
50.13
Total 1

Table 3:

xP(X = x)
00.08
10.11
20.39
30.27
Total 0.85

Solution:

  • Table 1: This is not a valid probability distribution because P(X=3)=−0.2P(X=3) = -0.2, which is less than 0. The probabilities must be non-negative 11.
  • Table 2: This is a valid probability distribution because ∑P(X=x)=0.25+0.34+0.28+0.13=1\sum P(X=x) = 0.25 + 0.34 + 0.28 + 0.13 = 1, and P(X=x)≥0P(X=x) \ge 0 for all xx 11.
  • Table 3: This is not a valid probability distribution because ∑P(X=x)=0.08+0.11+0.39+0.27=0.85\sum P(X=x) = 0.08 + 0.11 + 0.39 + 0.27 = 0.85, which is not equal to 1 11.
1.1.2.2 Graphical presentation of probability distributions

Probability distributions can be presented graphically, typically using bar charts or histograms for discrete variables.

Example 2: The table below shows the probability distribution of the number of breakdowns per week for a machine.

Breakdowns per week (x)0123
Probability (P(X=x))0.150.200.350.30

Let XX be the number of breakdowns per week 13.

(a) Graphical presentation: A bar chart can be used to represent this distribution, with the number of breakdowns on the horizontal axis and the probabilities on the vertical axis 13.

(b) Finding probabilities: (i) Probability of exactly 2 breakdowns: P(X=2)=0.35P(X=2) = 0.35 14. (ii) Probability of 0 to 2 breakdowns (inclusive): P(0≤X≤2)=P(X=0)+P(X=1)+P(X=2)=0.15+0.20+0.35=0.70P(0 \le X \le 2) = P(X=0) + P(X=1) + P(X=2) = 0.15 + 0.20 + 0.35 = 0.70 12. (iii) Probability of more than 1 breakdown: P(X>1)=P(X=2)+P(X=3)=0.35+0.30=0.65P(X > 1) = P(X=2) + P(X=3) = 0.35 + 0.30 = 0.65. Alternatively, $P(X >

Cover

Topic_4_Part_2_Student_.pdf

Continuous probability distributions

Continuous probability distributions describe random variables that can take any value within a given range.

1.1 Continuous random variables

A continuous random variable is a variable whose values are not countable but measurable, meaning it can assume any value over intervals. Examples include the height of a person, the time taken to complete an examination, or the mass of an apple 4.

1.2 Probability density function (PDF)

For a continuous random variable XX, its probability is described by a probability density function (PDF), denoted as f(x)f(x), over the intervals of possible values for XX 4.

1.2.1 Properties of a PDF

A function f(x)f(x) is a valid probability density function for a continuous random variable XX if it satisfies the following properties 5 6:

  • f(x)≥0f(x) \geq 0 for all xx 5.
  • The total area between the curve of f(x)f(x) and the x-axis is always 1. This is mathematically expressed as: ∫−∞∞f(x) dx=1\int_{-\infty}^{\infty} f(x) \, dx = 1 5 6.
  • The probability that XX assumes a value in any interval lies in the range of 0 to 1 6.
  • The total probability of the intervals within which XX can assume a value is 1.0 6.

1.2.2 Calculating probabilities using a PDF

Probabilities for continuous random variables are calculated by finding the area under the curve of the PDF over a specific interval. For an interval [a,b][a, b], the probability that XX falls within this range is given by 5 7: P(a≤X≤b)=∫abf(x) dxP(a \leq X \leq b) = \int_{a}^{b} f(x) \, dx 5 7.

1.2.3 Probability of a single value

A crucial characteristic of continuous random variables is that the probability of the variable assuming any single specific value is always zero. This is because the area under a single point (a line) on the PDF curve is zero 8. P(X=a)=∫aaf(x) dx=0P(X = a) = \int_{a}^{a} f(x) \, dx = 0 8.

Tip: This property implies that for continuous random variables, P(a≤X≤b)=P(a<X≤b)=P(a≤X<b)=P(a<X<b)P(a \leq X \leq b) = P(a < X \leq b) = P(a \leq X < b) = P(a < X < b).

1.3 The definite integral

The definite integral is the fundamental tool used to calculate probabilities from a PDF. For a function f(x)f(x) that is continuous on the interval [a,b][a, b], the definite integral is defined as 9: ∫abf(x) dx=[F(x)]ab=F(b)−F(a)\int_{a}^{b} f(x) \, dx = [F(x)]_{a}^{b} = F(b) - F(a) where F(x)F(x) is an antiderivative of f(x)f(x) 9.

1.3.1 Power rule for definite integrals

A common rule used for integration is the power rule, which states: ∫abxn dx=[xn+1n+1]ab=bn+1n+1−an+1n+1\int_{a}^{b} x^n \, dx = \left[ \frac{x^{n+1}}{n+1} \right]_{a}^{b} = \frac{b^{n+1}}{n+1} - \frac{a^{n+1}}{n+1} for n≠−1n \neq -1 9.

1.3.2 Properties of definite integrals

The following properties are useful when working with definite integrals:

  • Constant multiple rule: ∫abk⋅f(x) dx=k∫abf(x) dx\int_{a}^{b} k \cdot f(x) \, dx = k \int_{a}^{b} f(x) \, dx 10.
  • Sum and difference rule: ∫ab[f(x)±g(x)] dx=∫abf(x) dx±∫abg(x) dx\int_{a}^{b} [f(x) \pm g(x)] \, dx = \int_{a}^{b} f(x) \, dx \pm \int_{a}^{b} g(x) \, dx 10.
  • Additivity property: If cc is between aa and bb: ∫abf(x) dx=∫acf(x) dx+∫cbf(x) dx\int_{a}^{b} f(x) \, dx = \int_{a}^{c} f(x) \, dx + \int_{c}^{b} f(x) \, dx 10.
  • Integral over a single point: ∫aaf(x) dx=0\int_{a}^{a} f(x) \, dx = 0 10.

1.3.3 Example of a definite integral

Consider the integral: ∫12(x2+x) dx\int_{1}^{2} (x^2 + x) \, dx Applying the power rule and the sum rule: ∫12x2 dx+∫12x dx=[x33]12+[x22]12\int_{1}^{2} x^2 \, dx + \int_{1}^{2} x \, dx = \left[ \frac{x^3}{3} \right]_{1}^{2} + \left[ \frac{x^2}{2} \right]_{1}^{2} =(233−133)+(222−122)= \left( \frac{2^3}{3} - \frac{1^3}{3} \right) + \left( \frac{2^2}{2} - \frac{1^2}{2} \right) =(83−13)+(42−12)= \left( \frac{8}{3} - \frac{1}{3} \right) + \left( \frac{4}{2} - \frac{1}{2} \right) =73+32=14+96=236= \frac{7}{3} + \frac{3}{2} = \frac{14 + 9}{6} = \frac{23}{6} 11.

1.4 Examples of continuous probability distributions

1.4.1 Example: Train delay time

Let XX be the delay time (in minutes) for a train to depart from KL Sentral, with the PDF:

f(x) = \begin{cases} 0.1 - 0.005x & \text{for } 0 \leq x \leq 20 \\ 0 & \text{otherwise} \end{cases} $$ [12](#page=12). **(a) Show that $f(x)$ is a valid PDF:** We need to check if $f(x) \geq 0$ for all $x$ and if $\int_{-\infty}^{\infty} f(x) \, dx = 1$ [12](#page=12) [13](#page=13). For $0 \leq x \leq 20$, $0.1 - 0.005x \geq 0.1 - 0.005 = 0.1 - 0.1 = 0$. Thus, $f(x) \geq 0$ [13](#page=13) . Now, calculate the total integral: $$ \int_{-\infty}^{\infty} f(x) \, dx = \int_{0}^{20} (0.1 - 0.005x) \, dx $$ $$ = \left[ 0.1x - \frac{0.005x^2}{2} \right]_{0}^{20} $$ $$ = \left( 0.1 - \frac{0.005 ^2}{2} \right) - $$ . $$ = 2 - \frac{0.005 }{2} = 2 - \frac{2}{2} = 2 - 1 = 1 $$ [13](#page=13) . Since $f(x) \geq 0$ and the total integral is 1, $f(x)$ is a valid PDF [13](#page=13). **(b) Find the probability that the train will be delayed for 5 to 10 minutes:** This requ
Cover

Topic 5 - Representativeness .pptx

Understanding representativeness in surveys

Understanding representativeness in surveys explores how well a sample reflects the characteristics of the larger population it is drawn from.

1. Understanding representativeness in surveys

The core aim of survey research is to draw conclusions about a larger group (the population) based on data collected from a smaller subset (the sample). For these conclusions to be valid, the sample must be representative of the population.

1.1 Ideal versus real-world situations

1.1.1 Ideal situation

In an ideal scenario, the actual sample collected perfectly mirrors the intended sample, which in turn accurately reflects the population. This means:

  • The actual sample size is equal to the intended sample size.
  • The proportions of different characteristics (e.g., age groups, housing types) within the sample are identical to the proportions in the population.

Consider a population with Characteristic A and Characteristic B. In an ideal situation: Population ⟺\Longleftrightarrow Sampling frame ⟺\Longleftrightarrow Sample (Actual sample = Intended sample)

1.2 Real situation and sources of error

In reality, the actual sample often deviates from the intended sample due to various errors encountered during data collection. This leads to a sample that is not representative, meaning the proportions of certain characteristics in the sample do not match those in the population. A common issue is that the actual sample is smaller than intended and biased, for example, overrepresenting groups with a specific characteristic (like Characteristic A) if they are more cooperative.

Population ⟺\Longleftrightarrow Sampling frame ⟺\Longleftrightarrow Intended sample   ⟹  \implies Actual sample ≠\neq Intended sample

1.2.1 Errors caused by interviewer

These errors stem from the actions or inactions of the person conducting the survey:

  • Lack of good contact with respondents: The interviewer might fail to establish rapport or communicate effectively, leading to incomplete or inaccurate responses.
  • Way of asking questions: The interviewer's phrasing or tone can influence how respondents answer, introducing bias.
  • Way of registering information: Errors in recording responses, whether due to manual mistakes or technical glitches, can distort the data.
  • Fraud: Deliberate falsification of data by the interviewer.

1.2.2 Errors caused by respondent

These errors originate from the individuals providing the information:

  • Lack of knowledge: Respondents may not have the information requested or may misunderstand the questions.
  • Misinterpretation of questions: Ambiguous or poorly worded questions can lead to incorrect answers.
  • Social desirability bias: Respondents may provide answers they believe are socially acceptable rather than their true opinions or behaviors.
  • Deliberate misinformation: Respondents might intentionally provide false answers.

1.3 Solutions to non-representativeness

When the actual sample is not representative, efforts can be made to address this, though some solutions can introduce their own biases.

1.3.1 Substitution

This involves replacing a non-cooperating respondent with another individual.

  • Problem: If the replacement respondent is chosen from a group that is more cooperative or shares similar characteristics (e.g., also has Characteristic A), the sample can become even more biased than the original intended sample.

1.3.2 Call back

This strategy involves attempting to re-contact respondents who were initially selected but did not cooperate or could not be reached.

  • Benefit: This method is more effective in increasing the representativeness of the sample because it ensures that the originally selected individuals are ultimately included, thus reducing bias.

1.4 Representativeness check

A crucial step after data collection is to check if the obtained sample is representative of the population. This is typically done by comparing the demographic or characteristic breakdown of the sample with known population data.

1.4.1 Example: Housing units in Leuven

  • Population Data (Leuven):

  • Owner-occupied flats: 3,000

  • Rental flats: 7,000

  • Owner-occupied houses: 6,000

  • Rental homes: 4,000

  • Total: 20,000 housing units

  • Sample Data (Fire safety check):

  • Owner-occupied flats: 100

  • Rental flats: 500

  • Owner-occupied houses: 150

  • Rental houses: 250

  • Total: 1,000 housing units

  • Sample Result: 56% of checked homes are not fire-safe.

  • Representativeness Question: Can this 56% result be generalized to all 20,000 housing units in Leuven?

  • Check: This can only be generalized if the sample is correctly composed. The breakdown by housing type is a critical criterion. We need to compare the proportions in the sample to the proportions in the population.

1.4.2 Statistical tests for representativeness

The Chi-square (χ2\chi^2) test

Cover

tutorial1_new.pdf

📚 tutorial1_new.pdf

Brief overview

This document introduces fundamental tools and techniques for data analysis using R and RStudio. It covers the initial setup, basic syntax, and practical methods for collecting and preparing data for analysis, laying the groundwork for subsequent statistical tasks.

Key points

  • Installing and navigating R and RStudio environments.
  • Understanding R's basic syntax and calculator functionality.
  • Collecting and recording demographic and preference data.
  • Creating and submitting data files in CSV format.
  • The purpose and role of practice assignments in learning.

1. Introduction to R and RStudio

1.1 Installing and using R and RStudio

  • R: A programming language and environment for statistical computing and graphics.
  • RStudio: An integrated development environment (IDE) that makes using R easier.
  • Installation: Download R and RStudio from their official websites if working on a personal computer.
  • Alternative: For devices like Chromebooks, use RStudio via "Apps at Otago."

1.2 R syntax basics

  • Arithmetic operators:
    • +: Addition
    • -: Subtraction
    • *: Multiplication
    • /: Division
    • ^: Exponentiation (raising to a power)
  • Case sensitivity: R distinguishes between uppercase and lowercase letters (e.g., LM() is different from lm()).
  • Spaces: R ignores extra spaces in commands, so x = 1 is the same as x=1.
  • Command history: Use the up arrow key to cycle through previous commands.
  • Command prompt:
    • >: Indicates R is ready for a new command.
    • +: Appears when R expects you to finish a previous command, like closing parentheses.

1.3 R as a calculator

  • Console panel: This is where you type commands and see results in RStudio.
  • Performing calculations: Directly type arithmetic expressions into the console.
  • Order of operations: R follows standard mathematical order of operations (PEMDAS/BODMAS).

Example: 3+4*5 will be calculated as 3+(4×5)=233 + (4 \times 5) = 23.

  • Sequence generation: The colon operator : creates a sequence of numbers.
    • 1:20 generates numbers from 1 to 20.
    • Applying operations to sequences: Operations can be applied element-wise to sequences. For example, (1:20)/2 divides each number from 1 to 20 by 2.

1.4 Expressions versus assignments

  • Expression:

    • A command that performs a calculation and displays the result.
    • The result is not saved for later use.
    • Example: 1+2+3+4+5+6+7+8+9+10
  • Assignment:

    • A command that stores the result of a calculation in a variable (or "object").
    • The result is not automatically displayed.
    • To see the stored result, you must then type the variable name.
    • Example: summation = 1+2+3+4+5+6+7+8+9+10 then summation to display it.

Assignment passes a result to a variable; an expression shows a result.

1.5 Collecting group data

  • Purpose: To gather basic demographic and preference data from a small group.
  • Information to collect:
    • Number of siblings (non-negative integer)
    • Netflix usage (yes/no)
    • Living on campus (on/off)
    • Main travel mode (walk, cycle, bus, drive, other)
    • Travel time from campus (in minutes)
    • Attitude towards statistics (strongly dislike, dislike, neutral, like, strongly like)
  • Exact keys: Use the precise wording provided for each answer (e.g., "yes", not "Yes" or "Y"). This ensures data consistency.

1.6 Creating a CSV file

  • CSV file (Comma Separated Values): A simple text file format for storing tabular data.
  • Spreadsheet software: Use programs like Excel to create the dataset.
  • Column names: Use the exact names: group_id, siblings, netflix, on_campus, travel_mode, travel_time, like_stat.
  • Each row: Represents one student's data.
  • Saving the file:
    • Save as groupX.csv, where X is your group number.
    • Ensure the file type is set to "CSV (Comma delimited)" to avoid common errors like .csv.xlsx.

A CSV file stores data with each value separated by a comma.

📝 Example:

group_idsiblingsnetflixon_campustravel_modetravel_timelike_stat
12yesonwalk10like
Cover

unit 1 ml extras.docx

Table of contents

  1. Real-World Examples

  2. False Positives and False Negatives

  3. Output

  4. Interpretation of Results

  5. Type I and Type II Errors

1. Real-World Examples

This section introduces the fundamental concepts of True Positive, True Negative, False Positive, and False Negative, explaining how these terms describe the accuracy of predictions compared to reality.

1.1 Core Definitions

  • True Positive (TP): The test predicts a positive outcome, and the reality is indeed positive.

    • Example: A sick person correctly tests positive for a disease.
  • True Negative (TN): The test predicts a negative outcome, and the reality is indeed negative.

    • Example: A healthy person correctly tests negative for a disease.
  • False Positive (FP): The test predicts a positive outcome, but the reality is negative.

    • This is also known as a Type I error or a false alarm.

    • Example: A healthy person is incorrectly told they have a disease.

  • False Negative (FN): The test predicts a negative outcome, but the reality is positive.

    • This is also known as a Type II error or a missed detection.

    • Example: A sick person is incorrectly told they are healthy.

1.2 Confusion Matrix Components

The four core definitions form the basis of a confusion matrix, used to evaluate the performance of classification models.

Scenario

Predicted Positive (Test says YES)

Predicted Negative (Test says NO)

Actual Positive (Reality is YES / Has Spam or Disease)

True Positive (TP) Spam email goes to the spam folder.

False Negative (FN) Spam email goes to your main inbox.

Actual Negative (Reality is NO / Safe or Healthy)

False Positive (FP) Safe email goes to the spam folder.

True Negative (TN) Safe email goes to your main inbox.

—

Actual Positive

Actual Negative

Predicted Positive

True Positive (TP)

False Positive (FP)

Predicted Negative

False Negative (FN)

True Negative (TN)

2. False Positives and False Negatives

This section details the impact of false positives and false negatives in machine learning and statistics, providing examples and explaining their connection to Type I and Type II errors.

2.1 False Positive (Type I Error)

A false positive occurs when a model incorrectly predicts a positive outcome for a sample that is actually negative. This is equivalent to a Type I error in hypothesis testing, where a true null hypothesis is rejected.

  • Example: In spam email detection, a false positive happens when a legitimate email is incorrectly flagged as spam.

  • Consequences can include unnecessary actions or misjudgments, such as healthy patients being diagnosed with illness, legitimate emails being missed, or non-fraudulent transactions being flagged as fraudulent.

2.2 False Negative (Type II Error)

A false negative occurs when a model incorrectly predicts a negative outcome for a sample that is actually positive. This is equivalent to a Type II error, where a false null hypothesis is not rejected.

  • Example: In disease detection, a false negative occurs when a test indicates a person is healthy, but they actually have the disease.

  • Consequences can be severe, including failure to detect diseases, allowing security breaches, or missing fraudulent transactions, leading to financial losses.

2.3 Key Evaluation Metrics

Several metrics are used to evaluate the impact of false positives and false negatives:

  • Precision: Measures the proportion of pre
Cover

unit 3 1.pdf

Table of contents

  1. Data Processing: Editing, Coding, Classification and Tabulation of Data, Data Cleaning and Graphical Representation using Excel. Statistical Analysis: Correlation and Regression Analysis, Univariate, Bivariate and Multivariate Analysis, Descriptive and Inferential Analysis, Introduction to Excel/SPSS/JMP for Data Analysis, Interpretation of Business Datasets and Case-based Analysis.
  2. Data Tabulation
  3. Construction of figures and graph
  4. Univariate Analysis, Bivariate and Multivariate Analysis
  5. Descriptive Statistics and Inferential Statistics

1. Data Processing: Editing, Coding, Classification and Tabulation of Data, Data Cleaning and Graphical Representation using Excel. Statistical Analysis: Correlation and Regression Analysis, Univariate, Bivariate and Multivariate Analysis, Descriptive and Inferential Analysis, Introduction to Excel/SPSS/JMP for Data Analysis, Interpretation of Business Datasets and Case-based Analysis.

1.1 Data editing

Editing is the initial phase of data processing, involving a thorough review of collected data to identify and correct errors. This step is crucial for ensuring the accuracy and reliability of research findings, especially in large-scale surveys.

Editors or supervisors are often appointed to meticulously check for missing or incorrectly entered information 1 2.

1.2 Example of data editing

Consider a survey on occupation status where a respondent's wife is listed as a "Housewife" but also reported to earn 800 per month. This earning suggests potential self-employment through activities like knitting, which should be accurately categorized.

Cross-checking such details helps minimize errors and strengthens research outcomes 2.

📝 "Married" might be coded as 01, "Separated" as 02, and "Widow" as 03 2.

1.3 Data coding

Data coding involves assigning numerical symbols to each response within a questionnaire. This process translates raw, qualitative data into a quantitative format that can be easily counted and tabulated, facilitating computer entry and analysis.

A code book is highly recommended to ensure consistency and accuracy during data collection and editing 2 3.

1.4 Example of data coding

Numerical codes are assigned to different categories for variables like marital status and education. For instance, "Married" might be coded as 01, "Separated" as 02, and "Widow" as 03 2.

Marital StatusCode
Married01
Separated02
Widow03
Divorced05
Never Married06
Any Other07

📝 Entering data into the SPSS statistical package, selecting the procedure from the menu, choosing variables for analysis, and then examining the output 3.

1.5 Master chart preparation

For manual data tabulation, a master chart is a large sheet used to consolidate codes for various variables. This organized structure simplifies the process of generating tables and analyzing data 3.

1.6 Entering data into the computer

Computers significantly accelerate data analysis. Software packages like Excel and SPSS are commonly used in social science research.

The typical process involves entering data into the chosen package, selecting the appropriate analysis procedure from the menu, choosing the variables for analysis, and then examining the generated output 3.

2. Data Tabulation

2.1 Definition and purpose of tabulation

Tabulation is the orderly and systematic arrangement of numerical data into rows and columns. Its primary purpose is to facilitate easy comprehension, prompt conclusion drawing, and effective comparison and interpretation of statistical information.

A statistical table thus summarizes data in a logical and orderly manner 4.

2.2 Components of a statistical table

A statistical table is composed of five essential parts:

  • Title: A clear, concise, and self-explanatory heading at the top that describes the table's content.
  • Stub: The leftmost column that lists and heads the items being presented in the rows.
  • Caption: The heading for the columns, located in the upper part of the table, often including units of measurement and column numbers in a "box head.".
  • Body: The main section of the table containing the actual data figures.
  • Source & Footnote: Information about the origin of secondary data and any necessary explanatory notes, such as clarifying percentages or specific data points 4.

2.3 Types of tabulation

Tabulation methods are chosen based on the nature of the data and the study objectives. The main types include the construction of frequency distribution tables, cross-tabulation, and the presentation of data in figures and graphs 5.

2.4 Frequency distribution tables6

Frequency distribution tables organize data by showing individual values or by g

Cover

Unit-4 central tendency measurement.pdf

Introduction to measures of central tendency and summation notation

This topic introduces measures of central tendency (MCT) as descriptive statistics summarizing data with a single value, alongside the fundamental summation notation used for mathematical manipulation of data sets.

1.1 Measures of central tendency (MCT)

Measures of central tendency (MCT) serve to summarize a set of data using a single representative value. A measure of center is defined as a value located at the center or middle point of a given data set.

The primary importance and uses of measures of central tendency include:

  1. Summarizing a set of data by a single value.

  2. Facilitating comparison among different data sets.

  3. Serving as a basis for further statistical analysis or manipulation.

1.1.1 Types of measures of central tendency

The three most common measures of central tendency are the Mean, Median, and Mode.

The types of Mean include:

  • Arithmetic mean.

  • Weighted mean.

  • Grand mean 2.

Tip: While the Mean, Median, and Mode are the core measures, understanding how they represent the "center" differently is crucial for selecting the appropriate summary statistic for a given data distribution.

1.2 Technical note on summation notation

Summation notation is a fundamental concept in statistics used to compactly represent the addition of a series of numbers.

1.2.1 Defining variables and subscripts

Let X_jX\_j denote any of the nn values x_1,x_2,dots,x_nx\_1, x\_2, \\dots, x\_n assumed by a variable XX. In the notation X_jX\_j, the letter jj acts as a subscript or index, which can stand for any of the numbers in the sequence.

Example: If variable XX represents employee income, then x_1=135x\_1 = 135 dollars, x_2=285x\_2 = 285 dollars, and x_3=500x\_3 = 500 dollars could represent the income levels of three specific employees.

1.2.2 The summation symbol (Sigma\\Sigma)

The symbol sum_j=1nX_j\\sum\_{j=1}^{n} X\_j is used to denote the sum of all values X_jX\_j starting from the index j=1j=1 up to j=nj=n. The symbol sum\\sum is the Greek letter sigma, which signifies summation.

The definition of the summation is: sum_j=1nX_j=X_1+X_2+dots+X_n\\sum\_{j=1}^{n} X\_j = X\_1 + X\_2 + \\dots + X\_n.

Example: Considering the income example where n=3n=3, the summation would be: sum_j=13X_j=X_1+X_2+X_3=135+285+500\\sum\_{j=1}^{3} X\_j = X\_1 + X\_2 + X\_3 = 135 + 285 + 500 3.

1.2.3 Properties of summation

Let X_jX\_j and Y_jY\_j denote the values assumed by two variables, XX and YY, respectively, and let kk be a constant. The following properties govern the summation operation:

  1. Sum of a constant multiplied by a variable: sum_j=1NkX_j=ksum_j=1NX_j\\sum\_{j=1}^{N} kX\_j = k \\sum\_{j=1}^{N} X\_j.

  2. Sum of a constant: sum_j=1Nk=Nk\\sum\_{j=1}^{N} k = Nk.

  3. Sum of the product of two variables (Note: This property is incomplete in the source material, but the subsequent page implies the general form for sums): sum_j=1NX_jY_j\\sum\_{j=1}^{N} X\_j Y\_j 4.

Further properties extending these rules are provided:

  1. Sum of a series of values (implicitly X_1+X_2+dots+X_NX\_1 + X\_2 + \\dots + X\_N): sum_j=1NX_j=X_1+X_2+dots+X_N\\sum\_{j=1}^{N} X\_j = X\_1 + X\_2 + \\dots + X\_N.

  2. Sum of a constant added to a variable: sum_j=1N(X_j+k)=sum_j=1NX_j+Nk\\sum\_{j=1}^{N} (X\_j + k) = \\sum\_{j=1}^{N} X\_j + Nk.

  3. Sum of the sum of two variables: sum_j=1N(X_j+Y_j)=sum_j=1NX_j+sum_j=1NY_j\\sum\_{j=1}^{N} (X\_j + Y\_j) = \\sum\_{j=1}^{N} X\_j + \\sum\_{j=1}^{N} Y\_j.

Tip: Properties 5 and 6 demonstrate that summation distributes over addition, but note that sum(X_jk)\\sum (X\_j k) is handled by property 1, and sum(X_j+k)\\sum (X\_j + k) requires both rules (property 6 for Y_j=kY\_j = k).

Example (Class Activity Application): Expressing combinations using summation notation, where NN is the upper limit (or nn in previous context):

  1. x_12+x_22+x_32+dots+x_102x\_1^2 + x\_2^2 + x\_3^2 + \\dots + x\_{10}^2 is expressed as: sum_j=110x_j2\\sum\_{j=1}^{10} x\_j^2.

  2. (y_1+8)+(y_2+8)+(y_3+8)+dots(y\_1+8) + (y\_2+8) + (y\_3+8) + \\dots is expressed as: sum_j=1N(y_j+8)\\sum\_{j=1}^{N} (y\_j + 8).

  3. (x_1+b)+(x_2+b)+(x_3+b)+dots+(x_N+b)(x\_1+b) + (x\_2+b) + (x\_3+b) + \\dots + (x\_N+b) is expressed as: sum_j=1N(x_j+b)\\sum\_{j=1}^{N} (x\_j + b) 5.