Lecture 10
Dr. Elijah Meyer
Duke University
STA 199 - Spring 2023
February 15th, 2023
– Exam-1 is over! Congratulations on your hard work
– Clone ae-09
– HW-2 coming FRIDAY
– HW’s, labs, AE’s and exam; there are a lot of submissions to keep track of
– I wish there was a cheat sheet for all the appropriate formatting for our HWs and labs.
– Structure of ae’s (i.e. consistently not finishing ae material in class)
– I think that sometimes it would be helpful to do a quick review in the lecture of what we’ve learned the class before.
\(\checkmark\) Data Viz
– Probability
– Modeling Data
have a working understanding of the terms probability, sample space, event, population and sample.
compute probabilities of events from data
create a contingency table using pivot_wider() and kable()
use a contingency table to explore the relationship between two categorical variables.
– The probability of an event tells us how likely an event is to occur
takes on values from 0 to 1
the proportion of times the event would occur if it could be observed an infinite number of times
our degree of belief an event will happen
– is the basic element to which probability is applied, e.g. the result of an observation or experiment
Example: A is the event a student in STA 199 is a sophomore
We use capital letters, e.g. A to denote events
– If A is the event a student in STA199 is a sophomore, what is the opposite?
For any event A and its complement is \(A^c\)
Can think about c as “not”
Pr(A) + Pr(\(A^c\)) = 1
– A sample space is the set of all possible outcomes
– The sample space for year in school is….?
{Freshman, Sophmore, Junior, Senior}
each item brackets is a distinct outcome
The probability of the entire sample space is 1
Suppose you are interested in the probability of landing on heads.
Define the following:
Event (and compliment)
Sample space
– And
– Or
– Conditional
– “Given an event has already happened…..”
– A | B
– Cuts up our contingency table
– What is probability
– Event
– Sample Space
– Calculate probabilities in R
– And / Or / Conditional Probabilities