0% found this document useful (0 votes)
3 views3 pages

Bivariate Statistics Tutorial Guide

The document outlines a tutorial for AB1202 Statistics & Analysis at Nanyang Business School, focusing on bivariate distributions and correlations. It includes instructions for downloading data files, performing calculations in R, and answering specific probability-related questions based on the data. Additionally, it discusses the relationship between smoking and lung cancer, prompting analysis of marginal and conditional probabilities.

Uploaded by

lejh2296
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views3 pages

Bivariate Statistics Tutorial Guide

The document outlines a tutorial for AB1202 Statistics & Analysis at Nanyang Business School, focusing on bivariate distributions and correlations. It includes instructions for downloading data files, performing calculations in R, and answering specific probability-related questions based on the data. Additionally, it discusses the relationship between smoking and lung cancer, prompting analysis of marginal and conditional probabilities.

Uploaded by

lejh2296
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Nanyang Business School

AB1202 Statistics & Analysis

Tutorial :5
Topics : Bivariate Distributions and Correlations

1. Please download the data file “W5-Question [Link]” from the course website. Then you
can use the following command in R to load the data into R for calculation:
[Link]([Link](),header=T)
The file contains a discrete bivariate distribution of X and Y. To calculate the answers for
the question below, you must know how to calculate the sum of probabilities based on
certain “conditions,” let’s call it conditional sum. To impose a condition, we use “[]” in R.
Again, if you don’t know how, please refer to the lecture video/ppt.

Determine each of the following probabilities:


(1) Pr(X=2)
(2) Pr(X≤2 and Y≤ 2)
(3) Pr(X=Y)

2. Please download the data file “W5-Question [Link]” from the course website. Then you
can use the following command in R to load the data into R for calculation.

[Link]([Link](),header=T)

The file contains data from a collection of 200 households surveyed (use the “View()”
command to view the loaded csv file). The first variable X is the number of members in a
randomly selected household from the survey, and the second variable Y is the number
of cars owned by the household. The last column is the frequencies of observations. The
200 surveyed households are equally likely to be selected.

To proceed, you must first calculate the probabilities for different values of X and Y. You
can do that based on the frequency column in the data. If you don’t know how, please
refer to the lecture video/ppt.

(1) What is the joint probability Pr(X=4, Y=0)?


(2) What is the marginal probability Pr(X=4)?
(3) What is the conditional probability distribution of Y given X=4?

1
Nanyang Business School

(4) What is the conditional mean of Y given X=4?

3. Suppose that X and Y are random variables such that Var(X)=9, Var(Y)=4, and ρ (X,Y)=
−0.15 . Use the data to estimate the following: (1) Var(X+Y). (2) Var(X-Y) (3) Var(2X-
3Y+4). (4) Var(-X-Y)

4. Let X be an RV representing the weather of the day. For simplicity, suppose X can
only be rainy, sunny, and cloudy. Let Y be the average temperature (degree Celsius)
of a day, and Z be the amount of iced tea sold at Canteen-1 in a day.
(1) How would you define the meaning of the conditional distribution Pr(X|Y=20)?
How is it different from Pr(X)?
(2) What does E(Y|X=”sunny”) mean?
(3) Use common sense to compare E(Z|Y=35) and E(Z). Which one should be larger?

2
Nanyang Business School

5. Before 1950, most medical scientists believed that lung cancers were caused by air
pollution, such as coal burning. However, some scientists started to conjecture that
smoking may play a more significant role.

In the first study about the link between smoking and lung cancer, 1 scientists
considered the data collected from several hospitals in London. The table below
shows a simplified version of the data used in the study. The first “Yes” column (X=1)
indicates the number of cancer patients. The second “No” column shows the number
of non-cancer patients (X=0). The rows further divide the patients into the smoking
(Y=1) and non-smoking (Y=0) groups. It is not a coincidence that the “X=0” group also
has 709 patients: For each cancer patient, the scientists matched him/her with a
non-cancer patient of the same gender, age group, and from the same hospital.

Lung cancer
Smoker Yes (X=1) No (X=0)
Yes (Y=1) 688 650
No (Y=0) 21 59
Total 709 709

Prepare your answers for (1) to (5) based on the table:


(1) What is the marginal probability of X, Pr(X=1)=? and Pr(X=0)=?
(2) What is the marginal probability of Y, Pr(Y=1)=? and Pr(Y=0)=?
(3) Pr(X=1|Y=1)=? Pr(X=1|Y=0)=?
(4) Do X and Y appear independent of each other?
(5) Why did the scientist not just look at the column of Yes (X=1) and make the
conclusion of the study (i.e., 688 vs 21 patients -> smoking and lung cancer are not
independent)? Why is the No (X=0) column also essential? Reflect on (3) and (4) to
prepare your answer.

1
Source: Doll, R., & Hill, A. B. (1950). Smoking and carcinoma of the lung. British medical journal,
2(4682), 739-748.
3

You might also like