With an Emphasis on Contingency Tables Students in PSYC 2101 Skip to Slide 7 Random Variable A random variable is real valued function defined on a sample space The sample space ID: 288752
Download Presentation The PPT/PDF document "Basic Probability" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
Basic Probability
With an Emphasis on Contingency
TablesSlide2
Students in PSYC 2101Skip to Slide
# 7. Slide3
Random Variable
A
random variable
is real valued function defined on a sample space
.
The
sample space
is the set of all distinct outcomes possible for an experiment
.
Function
: two sets’ (well defined collections of objects) members are paired so that each member of the one set (
domain
) is paired with one and only one member of the other set (
range
)Slide4
The domain is the sample space, the range is a set of real numbers
.
A random variable is the set of pairs created by pairing each possible experimental outcome with one and only one real number.Slide5
Examples
the
outcome of rolling a die:
= 1,
= 2,
= 3, etc. (Each outcome has only one number, and, vice versa
)
= 1,
= 2,
= 1, etc. (each outcome has (odd-even) only one number, but not
vica
versa
)
The
weight of each student in my statistics class.Slide6
Probability Distribution
Each value of the random variable is paired with one and only one probability.
More on this later.Slide7
Probability Experiments
A
probability experiment
is a well-defined act or process that leads to a single well defined outcome
.
Flip a coin, heads or tails.
Roll a die, how many spots up.
Stand on a digital scale, what number is displayed.Slide8
Probability
The
probability
of an event,
P(A)
is the fraction of times that event will occur in an indefinitely long series of trials of the experiment
.
Cannot be known, can be estimated.Slide9
Estimating Probability
Empirically – perform experiment many times, compute relative frequencies.
Rationally – make assumptions and then apply logic.
Subjectively – strength of individual’s belief regarding whether an event will or will not happen – often expressed in terms of odds.Slide10
Odds of Occurrence of Event A
If the experiment were performed (a & b) times, we would expect A to occur
a
times and B to occur
b
times.
There are 20 students in a class, 14 of whom are women. If randomly select one, what are the odds it will be a woman?
14 to 6 = 7 to 3.Slide11
Convert Odds to Probability
Probability = a/(a & b).
14 women, 6 men.
Odds = 7
to
3.
Probability =
7 out of
10.Slide12
Convert Probability to Odds
Odds = P(A)/P(not A)
Probability = .70
Odds = .70/(1 - .70) = 7 to 3Slide13
Independence
Two events are
independent
iff
(if and only if) the occurrence or non-occurrence of the one has no effect on the occurrence or non-occurrence of the other
.
I roll a die twice. The outcome on the first roll has no influence on the outcome on the second roll.Slide14
Mutual Exclusion
Two events are
mutually exclusive
iff
the occurrence of the one precludes occurrence of the other (both cannot occur simultaneously on any one trial
).
You could earn final grade of A in this class.
You could earn a B.
You can’t earn both.Slide15
Mutual Exhaustion
Two (or more) events are
mutually exhaustive
iff
they include all possible outcomes
.
You could earn a final grade of A, B, C, D, or F.
These are mutually exhaustive since there are no other possibilities.Slide16
Marginal Probability
The
marginal probability
of event A,
P(A)
, is the probability of A ignoring whether or not any other event has also occurred.
P(randomly selected student is female) =
.70Slide17
Conditional Probability of A
the probability that A will occur given that B has
occurred
P(A|B), the probability of A given B.
Given that the selected student is wearing a skirt, the probability that the student is female is .9999
Unless you are in Scotland
If P(A|B) = P(A), the A and B are independent of each other.Slide18
Joint Probability
The probability that both A and B will occur.
P(A
B) = P(A)
P(B|A) = P(B)
P(A|B)
If A and B are independent, this simplifies to
P(A
B) = P(A)
P(B
)
This is known as the Multiplication RuleSlide19
The Addition Rule
If A and B are mutually exclusive, the probability that one or the other will occur is the sum of their separate probabilities.
Grade
A
B
C
D
F
Probability
.2
.3
.3
.15
.05Slide20
If A and B are not mutually exclusive, things get a little more complicated.
P(A
B) = P(A) + P(B) - P(A
B)Slide21
Two-Way Contingency Table
A matrix where rows represent values of one categorical variable and columns represent values of a second categorical variable.
Can be use to illustrate the relationship between two categorical variables.Slide22
Survey Questions
We have asked each of 150 female college students two questions:
Do you smoke (yes/no)?
Do you have sleep disturbances (yes/no)?
Suppose that we obtain the following data (these are totally contrived, not real): Slide23
Marginal ProbabilitiesSlide24
Conditional Probabilities Show Absolute Independence Slide25
Multiplication Rule Given Independence
Sixty of 150 have sleep disturbance and smoke, so P (Sleep
Smoke) = 60/150 = .40
P(A
B) = P(A) x P(B)Slide26
“Sleep” = Sexually Active
Preacher claims those who smoke will go to Hell.
And those who fornicate will go to Hell.
What is the probability that a randomly selected coed from this sample will go to Hell?Slide27
Addition Rule
A probability cannot exceed one.
Something is wrong here!Slide28
Welcome to Hell
The events (sleeping and smoking) are not mutually exclusive.
We have counted the overlap between sleeping and smoking (the 60 women who do both) twice.
30 + 40 + 60 = 130 of the women sleep and/or smoke.
The probability we seek = 130/150 = 13/15 = .87 Slide29
Addition Rule For Events That Are NOT Mutually ExclusiveSlide30
Sleep = Sexually Active,
Smoke = Use CannabisSlide31
Marginal ProbabilitiesSlide32
Conditional Probabilities Indicate NonindependenceSlide33
Joint Probability
What is the probability that a randomly selected coed is both sexually active and a cannabis user?
There are 60 such coeds, so the probability is 60/150 = .40.
Now let us see if the multiplication rule works with these data.Slide34
Multiplication Rule
Oops, this is wrong. The joint probability is .40. We need to use the more general form of the multiplication rule.Slide35
Multiplication Rule NOT Assuming Independence
Now that looks much better.Slide36
Actual Data From Jury Research
Castellow, Wuensch, and Moore (1990,
Journal of Social Behavior and Personality
, 5, 547-562
Male employer sued for sexual harassment by female employee.
Experimentally manipulated physical attractiveness of both litigantsSlide37
Effect of Plaintiff Attractiveness
P(Guilty | Attractive) = 56/73 = 77%.
P(Guilty | Not Attractive) = 39/72 = 54%.
Defendant found guilty more often if plaintiff was attractive.Slide38
Odds and Odds Ratios
Odds(Guilty | Attractive) = 56/17
Odds(Guilty | Not Attractive) = 39/33
Odds Ratio = 56/17
39/33 = 2.79.
Odds of guilty verdict 2.79 times higher when plaintiff is attractive.Slide39
Effect of Defendant Attractiveness
P(Guilty | Not Attractive) = 53/70 = 76%.
P(Guilty | Attractive) = 42/75 = 56%.
The defendant was more likely to be found guilty when he was unattractive.Slide40
Odds and Odds Ratio
Odds(Guilty | Not Attractive) = 53/17.
Odds(Guilty | Attractive) = 42/33.
Odds Ratio = 53/17
42/33 = 2.50
.
Odds of guilty verdict 2.5 times higher when defendant is unattractive.Slide41
Combined Effects of Plaintiff and Defendant Attractiveness
Plaintiff attractive, Defendant not = 83% guilty.
Defendant attractive, Plaintiff not = 41% guilty.
Odds ratio = 83/17
41/59 = 7.03.
When attorney tells you to wear Sunday best to trial, listen.Slide42
Odds Ratios and Probability Ratios
Odds of Success
90/10 = 9 for Antibiotic Group
40/60 = 2/3 for Homeopathy Group
Odds Ratio = 9/(2/3) =
13.5Slide43
Odds Ratios and Probability Ratios
Odds of Failure
10/90 = 1/9 for Antibiotic Group
60/40 = 1.5 for Homeopathy Group
Odds Ratio = 1.5/(1/9) =
13.5
Notice that the odds ratio comes out the same with both perspectives.Slide44
Odds Ratios and Probability Ratios
Probability of Success
90/100 = .9 for Antibiotic Group
40/100 = .4 for Homeopathy Group
Probability Ratio = .9/(.4) =
2.25Slide45
Odds Ratios and Probability Ratios
Probability of Failure
10/100 = .1 for Antibiotic Group
60/100 = .6 for Homeopathy Group
Odds Ratio = .6/(.1) =
6
Notice that the probability ratio differs across perspectives.Slide46
Another Example
According to Medscape, 0.5% of the general population has narcissistic personality disorder (NPD)
The rate is 20% among members of the US Military.Slide47
Odds Ratios
Odds of NPD
Military: .2/.8 = .25
General: .005/.995 = .005
Ratio: .25/.005 =
49.75
Odds of NOT NPD
Military: .8/.2 = 4
General: .995/.005 = 199
Ratio: 199/4 =
49.75Slide48
Probability Ratios
Probability of NPD
Military: 20%
General: 0.5%
Ratio: 20/0.5 =
40
.
Probability of NOT NPD
Military: 80%
General: 99.5%
Ratio: .995/.8 =
1.24Slide49
Probability Distributions
For a
discrete variable
, pair each value with the probability of obtaining that value.
For example, I flip a fair coin five times. What is the probability for each of the six possible outcomes?
May be a table, a chart, or a formula.Slide50
Probability Table
Number of Heads
Percent
0
3.1
1
15.6
2
31.2
3
31.2
4
15.6
5
3.1Slide51
Probability ChartSlide52
Probability Formulay
is number of heads,
n
is number of tosses,
p
is probability of heads,
q
is probability of tailsSlide53
Continuous VariableThere is an infinite number of values, so a table relating each value to a probability would be infinitely large.
The probability of any exact value is vanishingly small.
We can find the probability that a randomly selected case has a value between
a
and
b
.Slide54
Evolution of a Continuous Variable
I’ll start with a histogram for a discrete variable.
In each step I’ll double the number of values (and number of bars).
All the way up to an infinite number of values with each bar infinitely narrow.Slide55Slide56Slide57Slide58Slide59
Now one final step, to an uncountably large number of bars, each infinitely narrow, yielding a continuous, uniform distribution ranging from A to B.Slide60Slide61
Now I do the same but I start with a binomial distribution with
p
= .5 and three bars.
Note that the bars are not all of equal height.
Each time I split one, I lower the height of the tail-wards one more than the center-wards one.Slide62Slide63Slide64Slide65Slide66Slide67Slide68
Now one final leap to a continuous (normal) distribution with an uncountably large number of infinitely narrow bars.Slide69Slide70
Random Sampling
Sampling
N
data points from a population is random if every possible different sample of size
N
was equally likely to be
selected.
Random samples most often will be representative of the population.
Our stats assume random sampling.Slide71
Y Random, X Not
Probability
Sample
X
Y
AB
1/2
1/6
AC
0
1/6
AD
0
1/6
BC
0
1/6
BD
0
1/6
CD
1/2
1/6Slide72
Counting RulesPSYC 2101 students can skip the material in the rest of this slide show.Slide73
Arranging Y ThingsThere are
Y!
ways to arrange Y different things
.
I am getting a four scoop ice cream cone.
Chocolate, Vanilla, Coconut, and Mint.
How many different ways can I arrange these four flavors?
4! = 4(3)(2)(1) = 24.Slide74
PermutationsIf I have 10 different flavors, how many different ways can I select and arrange 4 different flavors from these 10?Slide75
Combinations
Same problem, but order of the flavors does not count.
The are Y! ways to arrange Y things, so just divide the number of permutations by Y!Slide76
Number of Different StringsC
L
= number of different strings
C
is the number of different characters
available
L
is the length of the
string.
Ten different characters (0 – 9) and two character strings
10
2
= 100 different stringsSlide77
Use letters instead (A through Z)
26
2
=
676 different strings
Use letters and numbers
36
2
=
1,296
different
strings
Use strings of length 1 or 2.
36 + 1,296 = 1,332 different stringsSlide78
Use strings of length up to 3.
36
3
=
46,656 three character strings
+ 1,332 one and two character strings
47,988 different strings.
Use lengths up to 4
1,679,616 + 47,988 =
1,727,604
Use lengths up to 5
60,466,176 + 1,727,604 = 62,193,780Slide79
Use strings of length up to 6
2,176,782,336 + 62,193,780 = 2,238,976,116 different
strings
That is over 2 BILLION different strings.