![Page 1: DON’T FORGET TO SIGN IN FOR CREDIT! jrfinley/p235/ Special Lecture: Random Variables](https://reader030.vdocuments.us/reader030/viewer/2022032611/56649e0f5503460f94afa050/html5/thumbnails/1.jpg)
DON’T FORGET TO SIGN IN FOR CREDIT!
http://www.psych.uiuc.edu/~jrfinley/p235/
Special Lecture: Random Variables
![Page 2: DON’T FORGET TO SIGN IN FOR CREDIT! jrfinley/p235/ Special Lecture: Random Variables](https://reader030.vdocuments.us/reader030/viewer/2022032611/56649e0f5503460f94afa050/html5/thumbnails/2.jpg)
Announcements
• Assessment Next Week Same procedure as last time. AL1: Monday, Rm 289 between 9-5 BL1: Wednesday, Rm 289 between 9-5 Can schedule a specific time by contacting TA Remember: Bring photo ID
• Get as far through the material in ALEKS as you can before the test. You should aim to be at least halfway through the Inference slice.
![Page 3: DON’T FORGET TO SIGN IN FOR CREDIT! jrfinley/p235/ Special Lecture: Random Variables](https://reader030.vdocuments.us/reader030/viewer/2022032611/56649e0f5503460f94afa050/html5/thumbnails/3.jpg)
Random Variables
• Random Variable: variable that takes on a particular
numerical value based on outcome of a random experiment
• Random Experiment (aka Random Phenomenon):
trial that will result in one of several possible outcomes
can’t predict outcome of any specific trial can predict pattern in the LONG RUN that is, each possible outcome has a certain
PROBABILITY of occurring
![Page 4: DON’T FORGET TO SIGN IN FOR CREDIT! jrfinley/p235/ Special Lecture: Random Variables](https://reader030.vdocuments.us/reader030/viewer/2022032611/56649e0f5503460f94afa050/html5/thumbnails/4.jpg)
Random Variables
• Examples:# of heads in 3 coin tosses a student’s score on the ACT points scored by Illini basketball team in
first game of the seasonmean snowfall in February in Urbana height of the next person to walk in the
door
![Page 5: DON’T FORGET TO SIGN IN FOR CREDIT! jrfinley/p235/ Special Lecture: Random Variables](https://reader030.vdocuments.us/reader030/viewer/2022032611/56649e0f5503460f94afa050/html5/thumbnails/5.jpg)
Random Variable Example & Notation
• X= how many years a UIUC psych grad student takes to complete PhD this is our random variable
• xi=some particular value that X can take on i=1 --> x1=smallest possible value of X i=k --> xk=largest possible value of X
• so for example: x1=4 years x2=5 years x3=6 years ... xk=x7=10 years
![Page 6: DON’T FORGET TO SIGN IN FOR CREDIT! jrfinley/p235/ Special Lecture: Random Variables](https://reader030.vdocuments.us/reader030/viewer/2022032611/56649e0f5503460f94afa050/html5/thumbnails/6.jpg)
Discrete vs. Continuous Random Variables
• Discrete Finite number of possible outcomes
ex: ACT score
• Continuous Infinitely many possible outcomes
ex: temperature in Los Angeles tomorrow
• ALEKS problems: only calculating expected value and variance for DISCRETE random variables
![Page 7: DON’T FORGET TO SIGN IN FOR CREDIT! jrfinley/p235/ Special Lecture: Random Variables](https://reader030.vdocuments.us/reader030/viewer/2022032611/56649e0f5503460f94afa050/html5/thumbnails/7.jpg)
Probability Distributions
• Probability Distribution: the possible values of a Random Variable, along
with the probabilities that each outcome will occur
• Graphic Depictions: Discrete:
Continuous:
Values of X
Probability
Values of X
Probability
![Page 8: DON’T FORGET TO SIGN IN FOR CREDIT! jrfinley/p235/ Special Lecture: Random Variables](https://reader030.vdocuments.us/reader030/viewer/2022032611/56649e0f5503460f94afa050/html5/thumbnails/8.jpg)
Probability Distributions
• Probability Distribution: the possible values of a Random Variable, along
with the probabilities that each outcome will occur
• Graphic Depictions: Discrete:
• Table: Discrete:
Values of X
Probability
Value of X: X1 X2 ... Xk
Probability: p1 p2 ... pk
![Page 9: DON’T FORGET TO SIGN IN FOR CREDIT! jrfinley/p235/ Special Lecture: Random Variables](https://reader030.vdocuments.us/reader030/viewer/2022032611/56649e0f5503460f94afa050/html5/thumbnails/9.jpg)
Expected Value (aka Expectation) of a Discrete Random Variable
• Expected Value: central tendency of the probability distribution of a random variable
€
E(X) = x ipii=1
k
∑
![Page 10: DON’T FORGET TO SIGN IN FOR CREDIT! jrfinley/p235/ Special Lecture: Random Variables](https://reader030.vdocuments.us/reader030/viewer/2022032611/56649e0f5503460f94afa050/html5/thumbnails/10.jpg)
Expected Value (aka Expectation) of a Discrete Random Variable
• Expected Value:
€
E(X) = x ipii=1
k
∑Value of X: X1 X2 ... Xk
Probability: p1 p2 ... pk
E(X) = x1p1 + x2p2 + ... + xkpk
Note: the Expected Value is not necessarily a possible outcome...
![Page 11: DON’T FORGET TO SIGN IN FOR CREDIT! jrfinley/p235/ Special Lecture: Random Variables](https://reader030.vdocuments.us/reader030/viewer/2022032611/56649e0f5503460f94afa050/html5/thumbnails/11.jpg)
Expected Value example
• Say you’re given a massive set of data:well-being scores for all senior citizens
in Champaign County possible scores: 0-3
• Random Variable:X=Well-being score of a Champaign
County senior
![Page 12: DON’T FORGET TO SIGN IN FOR CREDIT! jrfinley/p235/ Special Lecture: Random Variables](https://reader030.vdocuments.us/reader030/viewer/2022032611/56649e0f5503460f94afa050/html5/thumbnails/12.jpg)
0.10
0.20
0.40
0.30
0.000.050.100.150.200.250.300.350.400.45
0 1 2 3
X (Well-being score)
P (Probability)
Expected Value example
Value of X: X1 X2 ... Xk
Probability: p1 p2 ... pk
Well-being score: 0 1 2 3
Probability: 0.10 0.20 0.40 0.30
E(X) = x1p1 + x2p2 + x3p3 + x4p4
Value of X: X1 X2 X3 X4
Probability: p1 p2 p3 p4
E(X) = (0)(.1) + (1)(.2) + (2)(.4) + (3)(.3) =1.9
![Page 13: DON’T FORGET TO SIGN IN FOR CREDIT! jrfinley/p235/ Special Lecture: Random Variables](https://reader030.vdocuments.us/reader030/viewer/2022032611/56649e0f5503460f94afa050/html5/thumbnails/13.jpg)
Variance of a Discrete Random Variable
• Variance (of Random Variable): measure of the spread (aka dispersion) of the probability distribution of a random variable
€
Var (X) = (x i − E(X))2 pii=1
k
∑
![Page 14: DON’T FORGET TO SIGN IN FOR CREDIT! jrfinley/p235/ Special Lecture: Random Variables](https://reader030.vdocuments.us/reader030/viewer/2022032611/56649e0f5503460f94afa050/html5/thumbnails/14.jpg)
Expected Value & Variance: ALEKS Example
Random variables (9 new topic areas, to be completed by February 27) One random variable (7 topic areas) Classification of variables and levels of measurement Discrete versus continuous variables Discrete probability distribution: Basic Discrete probability distribution: Word problems Cumulative distribution function Expectation and variance of a random variable Rules for expectation and variance of random variables Two random variables (2 topic areas) Marginal distributions of two discrete random variables Joint distributions of dependent or independent random variables
![Page 15: DON’T FORGET TO SIGN IN FOR CREDIT! jrfinley/p235/ Special Lecture: Random Variables](https://reader030.vdocuments.us/reader030/viewer/2022032611/56649e0f5503460f94afa050/html5/thumbnails/15.jpg)
Expected Value & Variance: ALEKS Example
QuickTime™ and a decompressor
are needed to see this picture.
![Page 16: DON’T FORGET TO SIGN IN FOR CREDIT! jrfinley/p235/ Special Lecture: Random Variables](https://reader030.vdocuments.us/reader030/viewer/2022032611/56649e0f5503460f94afa050/html5/thumbnails/16.jpg)
Expected Value & Variance: ALEKS Example
0.35
0.25
0.15
0.25
0.00
0.05
0.10
0.15
0.20
0.25
0.30
0.35
0.40
3 4 5 6
Value of X
P (Probability)
Xi pi
3 0.354 0.255 0.156 0.25
Xi pi xipi
3 0.354 0.255 0.156 0.25
Xi pi xipi
3 0.35 1.054 0.255 0.156 0.25
Xi pi xipi
3 0.35 1.054 0.25 15 0.156 0.25
Xi pi xipi
3 0.35 1.054 0.25 15 0.15 0.756 0.25
Xi pi xipi
3 0.35 1.054 0.25 15 0.15 0.756 0.25 1.5
E(X)= 4.3
E(X)
€
E(X) = x ipii=1
k
∑
![Page 17: DON’T FORGET TO SIGN IN FOR CREDIT! jrfinley/p235/ Special Lecture: Random Variables](https://reader030.vdocuments.us/reader030/viewer/2022032611/56649e0f5503460f94afa050/html5/thumbnails/17.jpg)
Expected Value & Variance: ALEKS Example
0.35
0.25
0.15
0.25
0.00
0.05
0.10
0.15
0.20
0.25
0.30
0.35
0.40
3 4 5 6
Value of X
P (Probability)
Xi pi xipi
3 0.35 1.054 0.25 15 0.15 0.756 0.25 1.5
E(X)= 4.3
E(X)
€
Var (X) = (x i − E(X))2 pii=1
k
∑Xi pi xipi Xi-E(X)3 0.35 1.054 0.25 15 0.15 0.756 0.25 1.5
Xi pi xipi Xi-E(X)3 0.35 1.05 -1.34 0.25 15 0.15 0.756 0.25 1.5
- =
Xi pi xipi Xi-E(X)3 0.35 1.05 -1.34 0.25 1 -0.35 0.15 0.756 0.25 1.5
Xi pi xipi Xi-E(X)3 0.35 1.05 -1.34 0.25 1 -0.35 0.15 0.75 0.76 0.25 1.5
Xi pi xipi Xi-E(X) (X i-E(X)) 2
3 0.35 1.05 -1.34 0.25 1 -0.35 0.15 0.75 0.76 0.25 1.5 1.7
2
Xi pi xipi Xi-E(X) (X i-E(X)) 2
3 0.35 1.05 -1.3 1.694 0.25 1 -0.3 0.095 0.15 0.75 0.7 0.496 0.25 1.5 1.7 2.89
![Page 18: DON’T FORGET TO SIGN IN FOR CREDIT! jrfinley/p235/ Special Lecture: Random Variables](https://reader030.vdocuments.us/reader030/viewer/2022032611/56649e0f5503460f94afa050/html5/thumbnails/18.jpg)
Xi pi xipi Xi-E(X) (X i-E(X)) 2
3 0.35 1.05 -1.3 1.694 0.25 1 -0.3 0.095 0.15 0.75 0.7 0.496 0.25 1.5 1.7 2.89
Expected Value & Variance: ALEKS Example
0.35
0.25
0.15
0.25
0.00
0.05
0.10
0.15
0.20
0.25
0.30
0.35
0.40
3 4 5 6
Value of X
P (Probability)
E(X)= 4.3
E(X)
€
Var (X) = (x i − E(X))2 pii=1
k
∑Xi pi xipi Xi-E(X) (X i-E(X)) 2 (X i-E(X)) 2pi
3 0.35 1.05 -1.3 1.694 0.25 1 -0.3 0.095 0.15 0.75 0.7 0.496 0.25 1.5 1.7 2.89
Xi pi xipi Xi-E(X) (X i-E(X)) 2 (X i-E(X)) 2pi
3 0.35 1.05 -1.3 1.69 0.5924 0.25 1 -0.3 0.095 0.15 0.75 0.7 0.496 0.25 1.5 1.7 2.89
* =Xi pi xipi Xi-E(X) (X i-E(X)) 2 (X i-E(X)) 2pi
3 0.35 1.05 -1.3 1.69 0.5924 0.25 1 -0.3 0.09 0.0235 0.15 0.75 0.7 0.49 0.0746 0.25 1.5 1.7 2.89 0.723
Var(X)= 1.41
![Page 19: DON’T FORGET TO SIGN IN FOR CREDIT! jrfinley/p235/ Special Lecture: Random Variables](https://reader030.vdocuments.us/reader030/viewer/2022032611/56649e0f5503460f94afa050/html5/thumbnails/19.jpg)
Properties of Expectation & Variance of a Random
Var.
![Page 20: DON’T FORGET TO SIGN IN FOR CREDIT! jrfinley/p235/ Special Lecture: Random Variables](https://reader030.vdocuments.us/reader030/viewer/2022032611/56649e0f5503460f94afa050/html5/thumbnails/20.jpg)
Expected Value of a Constant
• E(a) = a
Value of X: X1
Probability: p1
Value of a: aProbability: 1.00 a*1=a
Value of 5: 5Probability: 1.00 5*1=5
![Page 21: DON’T FORGET TO SIGN IN FOR CREDIT! jrfinley/p235/ Special Lecture: Random Variables](https://reader030.vdocuments.us/reader030/viewer/2022032611/56649e0f5503460f94afa050/html5/thumbnails/21.jpg)
Adding a constant
• E(X+a) = E(X) + a• Var(X±a) = Var(X)• How is this relevant to anything?
TRANSFORMING data.
• Ex: say you had data on the initial weights of all patients in a clinical trial for a new drug to treat depression...
![Page 22: DON’T FORGET TO SIGN IN FOR CREDIT! jrfinley/p235/ Special Lecture: Random Variables](https://reader030.vdocuments.us/reader030/viewer/2022032611/56649e0f5503460f94afa050/html5/thumbnails/22.jpg)
Adding a Constant
Value of X(Weight in pounds): 100 120 140 160 180
Probability: 0.10 0.15 0.30 0.25 0.20
E(X)=146 lb.
But wait!! The scale was off by 20 lb! Have to add 20 to all values...
0.10
0.15
0.30
0.25
0.20
0.00
0.05
0.10
0.15
0.20
0.25
0.30
0.35
100 120 140 160 180 200
Value of X (weight in pounds)
P (Probability)
![Page 23: DON’T FORGET TO SIGN IN FOR CREDIT! jrfinley/p235/ Special Lecture: Random Variables](https://reader030.vdocuments.us/reader030/viewer/2022032611/56649e0f5503460f94afa050/html5/thumbnails/23.jpg)
Adding a Constant
Value of X(Weight in pounds): 100 120 140 160 180
Probability: 0.10 0.15 0.30 0.25 0.20
E(X)=146 lb.
0.10
0.15
0.30
0.25
0.20
0.00
0.05
0.10
0.15
0.20
0.25
0.30
0.35
100 120 140 160 180 200
Value of X (weight in pounds)
P (Probability)
Value of X(Weight in pounds): 120 140 160 180 200
Probability: 0.10 0.15 0.30 0.25 0.20
E(X)= 166 lb. =146+20 E(X+a) = E(X) + a
![Page 24: DON’T FORGET TO SIGN IN FOR CREDIT! jrfinley/p235/ Special Lecture: Random Variables](https://reader030.vdocuments.us/reader030/viewer/2022032611/56649e0f5503460f94afa050/html5/thumbnails/24.jpg)
Adding a Constant
Value of X(Weight in pounds): 100 120 140 160 180
Probability: 0.10 0.15 0.30 0.25 0.20
E(X)=146 lb.
0.10
0.15
0.30
0.25
0.20
0.00
0.05
0.10
0.15
0.20
0.25
0.30
0.35
100 120 140 160 180 200
Value of X (weight in pounds)
P (Probability)
0.10
0.15
0.30
0.25
0.20
0.10
0.15
0.30
0.25
0.20
0.00
0.05
0.10
0.15
0.20
0.25
0.30
0.35
100 120 140 160 180 200
Value of X (weght in pounds)
P (Probability)
Value of X(Weight in pounds): 120 140 160 180 200
Probability: 0.10 0.15 0.30 0.25 0.20
E(X)= 166 lb. =146+20 E(X+a) = E(X) + a
Note: the whole distribution shifts to the right, but it doesn’t change shape! The variance (spread) stays the same.
Var(X±a) = Var(X)
![Page 25: DON’T FORGET TO SIGN IN FOR CREDIT! jrfinley/p235/ Special Lecture: Random Variables](https://reader030.vdocuments.us/reader030/viewer/2022032611/56649e0f5503460f94afa050/html5/thumbnails/25.jpg)
Multiplying by a Constant
• E(aX) = a*E(X)• Var(aX) = a2*Var(X)• How is this relevant to anything?
TRANSFORMING data.
• Ex: say you had data on peoples’ heights...
![Page 26: DON’T FORGET TO SIGN IN FOR CREDIT! jrfinley/p235/ Special Lecture: Random Variables](https://reader030.vdocuments.us/reader030/viewer/2022032611/56649e0f5503460f94afa050/html5/thumbnails/26.jpg)
Multiplying by a Constant
E(X)=1.7 meters
But wait!! We want height in feet! To convert, have to multiply all values by 3.28...
0.10
0.25
0.30
0.25
0.10
0.00
0.05
0.10
0.15
0.20
0.25
0.30
0.35
1.5 1.6 1.7 1.8 1.9
Value of X (height in meters)
P (Probability)
Value of X(height in meters) 1.5 1.6 1.7 1.8 1.9
Probability: 0.10 0.25 0.30 0.25 0.10
![Page 27: DON’T FORGET TO SIGN IN FOR CREDIT! jrfinley/p235/ Special Lecture: Random Variables](https://reader030.vdocuments.us/reader030/viewer/2022032611/56649e0f5503460f94afa050/html5/thumbnails/27.jpg)
Multiplying by a Constant
E(X)=1.7 meters
E(X)= 5.58 ft =3.28*1.7 E(aX) = a*E(X)
0.10
0.25
0.30
0.25
0.10
0.00
0.05
0.10
0.15
0.20
0.25
0.30
0.35
1.5 1.6 1.7 1.8 1.9
Value of X (height in meters)
P (Probability)
Value of X(height in meters) 1.5 1.6 1.7 1.8 1.9
Probability: 0.10 0.25 0.30 0.25 0.10
Value of X(height in feet): 4.92 5.25 5.58 5.90 6.23
Probability: 0.10 0.25 0.30 0.25 0.10
![Page 28: DON’T FORGET TO SIGN IN FOR CREDIT! jrfinley/p235/ Special Lecture: Random Variables](https://reader030.vdocuments.us/reader030/viewer/2022032611/56649e0f5503460f94afa050/html5/thumbnails/28.jpg)
Multiplying by a Constant
E(X)=1.7 meters
E(X)= 5.58 ft =3.28*1.7 E(aX) = a*E(X)
0.10
0.25
0.30
0.25
0.10
0.00
0.05
0.10
0.15
0.20
0.25
0.30
0.35
1.5 1.6 1.7 1.8 1.9
Value of X (height in meters)
P (Probability)
Value of X(height in meters) 1.5 1.6 1.7 1.8 1.9
Probability: 0.10 0.25 0.30 0.25 0.10
Value of X(height in feet): 4.92 5.25 5.58 5.90 6.23
Probability: 0.10 0.25 0.30 0.25 0.10
Note: the whole distribution shifts to the right, AND it gets more spread out! The variance has increased!
Var(aX) = a2*Var(X)
[Draw new distribution on chalkboard.]
![Page 29: DON’T FORGET TO SIGN IN FOR CREDIT! jrfinley/p235/ Special Lecture: Random Variables](https://reader030.vdocuments.us/reader030/viewer/2022032611/56649e0f5503460f94afa050/html5/thumbnails/29.jpg)
Usefulness of Properties
• Don’t have to transform each possible value of a random variable
• Can just recalculate the expected value and variance.
![Page 30: DON’T FORGET TO SIGN IN FOR CREDIT! jrfinley/p235/ Special Lecture: Random Variables](https://reader030.vdocuments.us/reader030/viewer/2022032611/56649e0f5503460f94afa050/html5/thumbnails/30.jpg)
Two Random Variables
• E(X+Y)=E(X)+E(Y)• and if X & Y are independent:
E(X*Y)=E(X)*E(Y)Var(X+Y)=Var(X)+Var(Y)
• How is this relevant?Difference scores (pretest-posttest)Combining Measures
![Page 31: DON’T FORGET TO SIGN IN FOR CREDIT! jrfinley/p235/ Special Lecture: Random Variables](https://reader030.vdocuments.us/reader030/viewer/2022032611/56649e0f5503460f94afa050/html5/thumbnails/31.jpg)
All properties
Expected Value• E(a)=a• E(aX)=a*E(X)• E(X+a)=E(X)+a• E(X+Y)=E(X)+E(Y)• If X & Y ind.
E(XY)=E(X)*E(Y)
Variance• Var(X±a) = Var(X)• Var(aX)=a2*Var(X)• Var(X2)=Var(X)+E(X)2
• If X & Y ind. Var(X+Y)=Var(X)
+Var(Y)
Var(X) = E(X2) - (E(X))2
E(X2) = Var(X) + (E(X))2
![Page 32: DON’T FORGET TO SIGN IN FOR CREDIT! jrfinley/p235/ Special Lecture: Random Variables](https://reader030.vdocuments.us/reader030/viewer/2022032611/56649e0f5503460f94afa050/html5/thumbnails/32.jpg)
Expected Value & Variance: ALEKS Example
Random variables (9 new topic areas, to be completed by February 27) One random variable (7 topic areas) Classification of variables and levels of measurement Discrete versus continuous variables Discrete probability distribution: Basic Discrete probability distribution: Word problems Cumulative distribution function Expectation and variance of a random variable Rules for expectation and variance of random variables Two random variables (2 topic areas) Marginal distributions of two discrete random variables Joint distributions of dependent or independent random variables
![Page 33: DON’T FORGET TO SIGN IN FOR CREDIT! jrfinley/p235/ Special Lecture: Random Variables](https://reader030.vdocuments.us/reader030/viewer/2022032611/56649e0f5503460f94afa050/html5/thumbnails/33.jpg)
QuickTime™ and a decompressor
are needed to see this picture.
ALEKS problem
E(X+a)E(aX)E(X+Y) algebra!
Var(aX)Var(X±a)
Var(X) = E(X2) - (E(X))2
E(X2) = Var(X) + (E(X))2
![Page 34: DON’T FORGET TO SIGN IN FOR CREDIT! jrfinley/p235/ Special Lecture: Random Variables](https://reader030.vdocuments.us/reader030/viewer/2022032611/56649e0f5503460f94afa050/html5/thumbnails/34.jpg)
QuickTime™ and a decompressor
are needed to see this picture.
![Page 35: DON’T FORGET TO SIGN IN FOR CREDIT! jrfinley/p235/ Special Lecture: Random Variables](https://reader030.vdocuments.us/reader030/viewer/2022032611/56649e0f5503460f94afa050/html5/thumbnails/35.jpg)
QuickTime™ and a decompressor
are needed to see this picture.
![Page 36: DON’T FORGET TO SIGN IN FOR CREDIT! jrfinley/p235/ Special Lecture: Random Variables](https://reader030.vdocuments.us/reader030/viewer/2022032611/56649e0f5503460f94afa050/html5/thumbnails/36.jpg)
QuickTime™ and a decompressor
are needed to see this picture.