Man(Francis) Yuan
333 Assignment 2 Q2 Question a: i) Within the random sampling, half of the people will have A card, and the other half of the people will have B card. Also, the trade will only happen on the people who have B card. The fraction of people who have B card is 50%. That means only 50% of the people will trade their cards. Let L be the probability of people having B cards, and let 1-L be the probability of people having A cards. Therefore, the fraction of people that will trade their cards is L1+(1-L)0=L, and with random sampling, L=0.5.
There are people with the 50% of getting a B card, and the 50% of probability getting A card. Also, the 50%’s probability that they will trade their card, it does not matter what card you have. Therefore, the percentage of fraction of people that will trade their cards are: (50% of getting a B card)(50% chance to trade)+(50% of getting A card)(50% chance to trade)=0.50.5+0.50.5=0.5
Let’s make the b equals the fraction of people prefer good A to good B, and (1-b) be the fractoin of people who prefer good B to good A. Total fraction of people that will trade their goods=b(probability that they receive card B)+(1-b)(probability that they receive card A)=b0.5+(1-b)0.5=0.5
Question b:
require(foreign)
## Loading required package: foreign
mydata<-read.dta("C:/Users/francisyuan/Downloads/Sportscards.dta")
a=c(mydata$trade)
a
## [1] 1 1 0 1 0 1 0 1 0 0 1 1 0 0 0 1 1 0 1 0 0 1 1 0 1 1 1 0 0 1 1 0 1 1 0
## [36] 0 1 0 0 0 1 1 0 0 1 0 0 1 0 1 0 0 1 1 0 0 1 0 0 0 0 0 0 1 1 1 0 0 0 0
## [71] 1 0 1 0 0 0 0 1 0 1 1 0 1 1 1 1 0 1 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0
## [106] 0 0 0 0 0 0 0 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## [141] 0 0 1 0 0 0 0 0
mean(a)
## [1] 0.3378378
We already calculated the fraction of people that will trade their cards are 0.3378, which means is that the 33.78% of people will be going to trade their cards. And the 0.3378 is also my sample mean. We will have to do t test to determine whether the sample mean statistically different from 0.5.
t.test (a,mu=0.5)
##
## One Sample t-test
##
## data: a
## t = -4.1569, df = 147, p-value = 5.456e-05
## alternative hypothesis: true mean is not equal to 0.5
## 95 percent confidence interval:
## 0.2607447 0.4149310
## sample estimates:
## mean of x
## 0.3378378
Therefore, with the t test results, we can see clearly that the absolute value of t-value is 4.1569, that means the p-value is very small and it is less than 0.05, at 95% confidence interval(0.2607447, 0.4149310). Thus, we must reject the null hypothesis of true mean=0.5, since the 0.5 is not included in the 95% confidence interval, and at 5% significance level, we can safely to reject mean=0.5.
The sample mean is different from population mean of 0.5 is because of the endowment effect, and that means the experiment changed the actual fraction outcome.
Question c: Require us to calculate the dealer’s fraction of trade.
dealerdata<-subset(mydata,dealer>0)
b=c(dealerdata$trade)
t.test (b, mu=0.5)
##
## One Sample t-test
##
## data: b
## t = -0.92912, df = 73, p-value = 0.3559
## alternative hypothesis: true mean is not equal to 0.5
## 95 percent confidence interval:
## 0.3299982 0.5618937
## sample estimates:
## mean of x
## 0.4459459
The people with the fraction of trade are dealers will be 0.4459, and with the t test result, we see that at 95% confidence interval, and the true mean will be between(0.3299, 0.56189). And thus we can conclude, that at 5% significance level, we have enough evidence to determine the fraction of dealers that will trade will be 0.5.
The fraction of trade for non-dealer.
nondealer<-subset(mydata,dealer<1)
m=c(nondealer$trade)
t.test (m, mu=0.5)
##
## One Sample t-test
##
## data: m
## t = -5.4895, df = 73, p-value = 5.559e-07
## alternative hypothesis: true mean is not equal to 0.5
## 95 percent confidence interval:
## 0.1316057 0.3278538
## sample estimates:
## mean of x
## 0.2297297
The fraction of trade for non-dealer is 0.2297, and at 95% confidence interval(0.1316,0.3278), it does not contain 0.5. Therefore, we can safely to say that at 5% significance level, the fraction of the trade of nondealer will not be equal to 0.5.
To understand whether the two fraction is significantly different from each other, we need to do the t.test. Let Ho be the fraction of trade in dealer-fraction of trade in nondealer=0 Let Ha be the fraction of trade in dealer-fraction of trade in nondealer not equal to 0. If we reject Ho at 5% significance level, this means the fractions of two kinds of people are statistically significant.
t.test(b,m, var.equal=TRUE, paired=FALSE)
##
## Two Sample t-test
##
## data: b and m
## t = 2.8369, df = 146, p-value = 0.005203
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## 0.0655899 0.3668425
## sample estimates:
## mean of x mean of y
## 0.4459459 0.2297297
Overall, the T-value of the t-test is 2.8369, and at 5% significance level, the t-critical number is 1.96. We can see the t-value exceed t-critical, and that means we have enough evidence to reject Ho. At 5% significance level, the two fraction of dealers and nondealers are statistically different from each other. Therefore, the endowment effect is diminishing with the increasing experience in dealers, as we see that the fraction of trade for dealers can be 0.5 at 5% significance level, at the same significance level, nondealers will not have fraction of trade of 0.5.