Docsity

Statistics: Sampling and Probability, Study notes of Art

Partial preview of the text

Download Statistics: Sampling and Probability and more Study notes Art in PDF only on Docsity!

A&S 100 − 007

Statistics for Teachers

Dr. Griffith

Department of Statistics

University of Kentucky

1 Lecture 1

1.1 Collecting Data

Individuals - objects desscribed by a data set. Variable - characteristic of an individual.

Example 1.1 Individuals - students, variables - age, gender, GPA, etc.

Observational Studies - observes individuals and measures variables of inter- est, but does not attempt to influence responses. Sample Surveys - a type of observational study.

population sample

Example 1.2 Public opinion polls, TV ratings, ...

Experiment - deliberately imposes some treatment on individuals to observe their response.

1.2 Sampling

Bad ways (Biaised - systematically favor certain outcomes.)

  • Convenience sampling - easiest to reach.
  • Wording of questions

Questions to ask when reading a poll:

  • Who carried out the survey?
  • What was the population?
  • How was the sample selected?
  • How large was teh sample? Margin of error?
  • What was the response rate?
  • How were subjects contacted?
  • When was the survey conducted?
  • What were the exact questions?

1.4 Exercises

Inserted copy of book material.

2 Lecture 2

2.1 Stratified Random Samples

STEP 1: Divide the sampling frame into distinct groups of individuals, called strata. Choose the strata because you have a special interest in these groups within the population or because the individuals within strata are like one another in some ways.

STEP 2: Choose a simple random sample from each stratum.

Example 2.1 Strata based on either of the following: gender, age group, education level.

This strategy can reduce the margin of error.

2.2 Systematic Random Sample

Example 2.2 Pick a random starting point and sample that and each fifth person (for example). STA 291 may have 130 in a lecture. Pick a number from 1 to 6 at random. Say you pick 3. Now 3, 8 , 13 ,... form your sample.

2.3 Exercises

Inserted book material.

2.4 Experiments(Comparative Experimentation)

Response variable - measures outcome of a study. Explanatory variable - we think it explains or causes changes in the response variable. Treatment - specific condition applied to subjects.

Example 2.3 Online versus classroom course; new drug versus old drug or placebo.

How do we assign individuals to treatments?

  • Self-select?
  • Selected by experiments, but not necessarily at random?
  • Confounding.

Randomized Comparative Experiment

Random

Group 1

Treatment 2

compare

Group 2

Treatment 1

Assignment outcomes

Treatment 2 Treatment 1 Treatment 2

Block 1- Women

Treatment 1

Block 2- Men

Nonrandom Assignment

4 Lecture 4

4.1 Measurement Scales

Nominal - puts things in categories

Example 4.1 male or female; employed, unemployed, or not in labor force.

Ordinal - puts things in order

Example 4.2 small, medium, or large; strongly disagree, disagree, neutral, agree, strongly agree.

Interval/Ratio - measures amount of something present.

Example 4.3 width of room, or temperature.

4.2 Organizing and Displaying Data

  • Frequency
  • Relative frequency
  • Histograms
  • Stemplots

4.3 Examples

Inserted book material.

5 Lecture 5

5.1 Numerical Summaries/ Graphical Techniques

Challenger data:

84 , 49 , 61 , 40 , 83 , 67 , 45 , 66 , 70 , 69 , 80 , 58

68 , 60 , 67 , 72 , 73 , 70 , 57 , 63 , 70 , 78 , 52 , 67 53 , 67 , 75 , 61 , 70 , 81 , 76 , 79 , 75 , 76 , 58 , 31

  • Stemplot
  • Measures of Location
  • Quartiles
  • Five Number Summary
  • Boxplot (Box and whisker display)

5.2 Measures of location: Mean, Median, Mode

Median - ”half above/ half below”. Notation: ˜x. For n = 36, there are two ”middle” observations, 67 and 68. We take the midpoint of these, 67.5, as the median. If n is odd, then there is only one ”middle” observation and we take that to be the median. Mean - arithmetic average, x = (^) n^1

∑n i=1 xi^ = 65.86. Mode - most frequently occuring value (not necessarily unique). 67 and 70 are modes.

6 Lecture 6

6.1 Measures of Spread or Variability

Range = max - min. Interquartile range = third quartile - first quartile. Five Number Summary: minimum - first quartile - median - third quartile - maximum

Range

Interquartile Range

6.2 Variance and Standard Deviation

A^2 =

∑n i=1(xi^ −^ x) 2 n − 1

Variance is measured in square of original unit.

s =

√ (s^2 )

Standard deviation is measured in original unit.

7 Lecture 7

7.1 Bivariate Data

Examples: (height, weight) or (weight of car, mpg). Positive Association increases in one associated with increases in the other. Negative Association increases in one associated with decreases in the other.

x x

(x 1 , y 1 ), (x 2 , y 2 ),... , (xn, yn) ”Five number summary” Mean and Standard Deviation of x 1 , x 2 ,... , xn:

x, sx.

Mean and Standard Deviation of y 1 , y 2 ,... , yn:

y, sy.

Correlation Coefficient:

r =

1 n− 1

∑n i=1(xi^ −^ x)(yi^ −^ y) sxsy

Properties of r

  1. measeure of association, unitless
  2. − 1 ≤ r ≤ 1
  3. if r ∈ {− 1 , 1 }, then points in scatterplot lie on a straight line
  4. measures how tightly points cluster about straight line
  5. measures straight line association in sense r^2 is the proportion of the variance of one variable that can be explained by straight line relation- ship.

(x1,y1)

(x2,y2)

(x4,y4)

(x3,y3)

x

y

least squares line

y1-y^

(x1,y^1)

(x1,y1)

enlarged view

Given the data (x 1 , y 1 ), (x 2 , y 2 ),... , (xn, yn), the least squares line mini- mizes (^) n ∑

i=

(yi − yˆi)^2.

Example 7. (1, 3), (2, 4), (4, 5), (5, 8) Concider L 1 : y = x + 2. Then ˆy 1 = 3, yˆ 2 = 4, yˆ 3 = 6, yˆ 4 = 7. ∑^4 i=

(yi − yˆi)^2 = 0 + 0 + (5 − 6)^2 + (8 − 7)^2 = 2.

Consider L 2 : y = 2x + 1. Then ˆy 1 = 3, yˆ 2 = 5, yˆ 3 = 9, yˆ 4 = 11.

∑^4

i=

(yi − yˆi)^2 = 0 + 1 + 16 + 9 = 26.

Consider L 3 : y = 2x − 1. Then ˆy 1 = 1, yˆ 2 = 3, yˆ 3 = 7, yˆ 4 = 9.

∑^4

i=

(yi − yˆi)^2 = 4 + 1 + 4 + 1 = 10.

Which of the lines L 1 , L 2 , L 3 fits best? How do we find the line which best fits? The line which best fits passes through (x, y) and has slope r s syx.

Homework: Find the regression line for the data set of the preceeding example.

8 Lecture 8

Given the data set (x 1 , y 1 ), (x 2 , y 2 ),... , (xn, yn), how can we find the line (i.e. the slope and y-intercept) which best fits the data in the sense of least squares?

(xk,y^k)

(xk,yk)

y=a+bx

y ˆk = α + βxk, k = 1, 2 ,... , n.

Find α,β which minimize

∑n k=1(yk^ −^ yˆk)

(^2). So think of

S(α, β) =

∑^ n

i=

(yi − α − βxi)^2.

Then ∂S ∂α

∑^ n

i=

2(yi − α − βxi)(−1)

∂S

∂β

∑^ n

i=

w(yi − α − βxi)(−xi)

Set the partial derivatives equal to 0. The resulting equations are equivalent to: (^) n ∑

i=

yi = nα + (

∑^ n

i=

xi)β

∑^ n

i=

xiyi = (

∑^ n

i=

xi)α + (

∑^ n

i=

x^2 i )β

  1. Go to the bank and observe how many customers are ahead of you.

Sample space - set of all possible outcomes.

S 1 = {(c, c, c), (c, c, n), (c, n, c), (n, c, c), (c, n, n), (n, c, n), (n, n, c), (n, n, n)}

S 2 = {(1, 1), (1, 2)),... , (1, 6), (2, 1),... , (6, 6)} S 3 = {x : x ≥ 0 } or [0, ∞) S 4 = { 0 , 1 , 2 , dots}

The members of the sample space are called sample points. An event is a collection of sample points.

Example 9.

E 1 = {(c, c, c), (c, c, n), (c, n, c), (n, c, c)} = ” at most one is nonconforming”

E 2 = {(1, 6), (2, 5), (3, 4), (4, 3), (5, 2), (6, 1)} = ”sum of faces is 7 E 3 = {x : x ≥ 10 } = wait at least 10 minutes

9.1 Venn Diagrams

A B

S

S

A

Example 9.3 Roll two dice. S 1 = {(1, 1), (1, 2),... , (1, 6), (2, 1),... , (6, 6)}.

A = {(1, 6), (2, 5), (3, 4), (4, 3), (5, 2), (6, 1)}

B = {(3, 1), (3, 2), (3, 3), (3, 4), (3, 5), (3, 6)}

Then

A ∩ B = {(3, 4)}

A∪B = {(1, 6), (2, 5), (3, 1), (3, 2), (3, 3), (3, 4), (3, 5), (3, 6), (4, 3), (5, 2), (6, 1)}

De Morgan’s Laws:

A ∪ B = A ∩ B and A ∩ B = A ∪ B

9.2 Assigning probabilities

S = sample space. Let A, A 1 ,... be events. Axiom 1 (Rule 1): P (A) ≥ 0. Axiom 2: P (S) = 1. Axiom 3: P (A 1 ∪ A 2 ∪.. .) =

∑ i P^ (Ai) if the^ Ais are disjoint (have no sample points in common). Let us illustrate these rules:

P (A 1 ∪ A 2 ∪ A 3 ) = P (A 1 ) + P (A 2 ) + P (A 3 )

P (A 1 ∪ A 2 ) = P (A 1 ) + P (A 2 )

Question: From n people, we fill k offices. In how many ways can this be done? Answer:

n(n − 1)(n − 2)... (n − (k − 1)) = n(n − 1)(n − 2)... (n − k + 1) =

n! (n − k)!

where m! = m(m − 1)... 3 × 2 × 1 and 0! = 1 by definition. [The number of permutations of the n people taken k at a time.] Question: From n people, how many ways are there to choose a committee of k people? Answer: Let

( n k

) be the symbol representing the answer. [Called a binomial coefficient; recall from algebra that

(x + y)n^ =

∑^ n

i=

( n i

) xiyn−i.

What is the value for

(n k

) ? Think of it this way: ( n k

) k! =

n! (n − k)!

Why?

or (^) ( n k

)

n! k!(n − k)!

Example 9.6 A committee of 3 is to be chosen from a group of 10 people, 6 of whom are men and 4 of whom are women. What is the probability that no women are on the committee if everyone has the same chance of being chosen? How many points are in the sample space? Ans:

( 10 3

) .

How many points are in the event? Ans:

( 6 3

) .

How much probability does each of these points have? Ans: 1 (^103 )

Probability that no women are selected is

( 6 3

) ( 10 3

6! 3!3! 10! 3!7!

6 × 5 × 4

10 × 9 × 8

Example 9.7 Suppose that any of the 365 days of the year are equally likely as birthdays. What is the probability that everyone in a room with 23 people, everyone will have a different birthday? Ans: How many possible birthdays for the 23 people - (365)^23. How many possibilities if all 23 peoople have different birthdays - (365)(364)... (343). Probability that all 23 have different birthdays:

(365)(364)... (343) (365)^23

(For 40 people, probability is .109; for 50 people, probability is .03.)

10 Lecture 10

10.1 Conditional Probability

Roll two fair dice.

S = {(1, 1), (1, 2),... , (1, 6), (2, 1),... , (6, 6)}

A = {(1, 6), (2, 5), (3, 4), (4, 3), (5, 2), (6, 1)} ”roll a sum of 7” B = {(3, 1), (3, 2), (3, 3), (3, 4), (3, 5), (3, 6)} ”roll a 3 on die 1 ” C = {(4, 6), (5, 5), (6, 4)} ”roll a sum of 10” D = {(3, 6), (4, 5), (5, 4), (6, 3)} ”roll a sum of 9”

P (A) =

P (C) =

P (D) =

What if I know that B has occured? Do I want to adjust those probabilities. The conditional probability of A given that B has occured is