In: Statistics and Probability
1. A local electronics retailer recently conducted a study on purchasers of large screen televisions. The study recorded the type of television and the credit account balance of the customer at the time of purchase. They obtained the following results.
Credit Balance |
Standard TV |
LCD |
Plasma |
Projection |
Under $200 |
11 |
11 |
38 |
3 |
$200-$800 |
7 |
8 |
21 |
12 |
Over $800 |
14 |
12 |
13 |
30 |
Then answer the following questions: a. What is the probability of
a customer having a credit balance of less than $200
b. What is the probability of randomly selecting a customer who purchased a Standard TV and had a credit balance of under $200?
c. What is the probability of randomly selecting a customer who purchased an LCD or Plasma TV?
d. What is the probability of randomly selecting a customer who purchased a Plasma TV?
e. What is the probability of randomly choosing a customer who purchased a Plasma TV given that they had a credit balance of more than $800?
f. Are the two variables shown in this table, credit balance and type of TV purchased, statistically independent? Please provide a mathematical justification for your answer.
question number (a)- (e) are solved using basic theorems of probability after constructing the two way table.
Find the solution attached.
for question (e), find the R-code celow with outputs:
#input the two way table in a matrix format by using ncol,
define the number of columns and byrow=TRUE tells R to read the
values row wise
>
> data =
matrix(c(11,11,38,3,7,8,21,12,14,12,13,30),ncol=4,byrow=TRUE)
>
> #enter the column names
> colnames(data) = c("std_tv","LCD","Plasma","Projection")
>
> #enter the row names
> rownames(data) = c("under$200","$200-$800","Over $800")
>
> #create the data as a table
> data=as.table(data)
> data
std_tv LCD Plasma Projection
under$200 11 11 38 3
$200-$800 7 8 21 12
Over $800 14 12 13 30
>
>
> #to test for statistical independence of balance and type of
tv purchased, we can perform chi square test of independence with
the null hypothesis that the row and the columns are
independent.
> #the chisq.test function in R performs a chi sq test of
independence between rows and columns of a table
> chisq.test(data)
Pearson's Chi-squared test
data: data
X-squared = 34.675, df = 6, p-value = 4.982e-06
>
> #conclusion: Let the level of significance = 5%, then the
p-value of the test is less than the level of significance. hence,
we reject the null hypothesis of row column independence. at 5%
level of significance, the balance and the type of tv bought are
dependent.
>