概率分布作业
/*导入数据*/
import excel "C:\Users\86138\Desktop\20231213-发布作业-20231223 1540前提交\DowMarketCap.xlsx", sheet("DATA") firstrow clear
/*查看数据*/
describe
/*描述性统计*/
summarize
/*详细描述*/
summarize, detail
/*画出正态概率图*/
pnorm MarketCap ($billions)
/*画直方图*/
histogram MarketCap ($billions)
瑞典咖啡
a. What is the probability that someone in Sweden consumed more than 10 pounds of coffee in 2008?
解:
Z=(X-u)/rou=(10-18.04)/5=-1.608
查表得出Z= -1.608对应的百分比为5.37%,此概率为消费小于等于10磅咖啡的概率,因此消费大于10磅咖啡的概率为100%-5.37%=94.63%
b. What is the probability that someone in Sweden consumed between 3 and 5 pounds of coffee in 2008?
解:
Z=(X-u)/rou=
查表得出Z= -3.008对应的百分比为0.13%,Z= -2.608对应的百分比为0.45%
因此消费咖啡量在3<X<5磅之间的百分比为0.45% -0.13%= 0.32%
c. What is the probability that someone in Sweden consumed less than 5 pounds of coffee in 2008?
解:
Z=(X-u)/rou=
查表得出Z= -2.608对应的百分比为0.45%,因此消费咖啡小于5磅的概率为0.45%。
d. 99% of the people in Sweden consumed less than how many pounds of coffee?
答:因为假设瑞典人均咖啡消费量近似分布为正态随机变量,概率99%对应的Z值查表为Z=2.33
根据公式Z=(X-u)/rou变形得出X=Zrou+u,所以X=2.33*5+18.04=29.69磅
因此,99%的瑞典人喝的咖啡少于29.69磅。
区间估计
a. Construct a 95% confidence interval estimate for the population mean difference between the actual length of the steel part and the specified length of the steel part.
答:首先导入数据,使用命令summarize得出样本均值X-bar=-0.00023,标准方差S=0.0016958
已知n=100,可求df=100-1=99
置信区间估计为95%,因为假设总体分布为正态分布,所以拒绝区域对应alpha/2=0.025
查表得出t=1.9842
得出95%的置信区间为-0.00053到0.00007之间
We are 95% confident that the length error is between -0.00053 and 0.00007 inch.
b. What assumption must you make about the population distribution in order to construct the confidence interval estimate in (a)?
答:为了构造(a)中的置信区间估计,需要假设总体分布为正态分布。
c. Do you think that the assumption needed in order to construct the confidence interval estimate in (a) is valid? Explain.
答:我认为在(a)中构造置信区间估计所需的假设是有效的。
因为样本均值-0.00023英寸,落在95%的置信区间-0.00053到0.00007英寸之间。
所以假设有效。
d. Compare the conclusions reached in (a) with those of Problem 2.41 on page 53
答:教材53页第2.41题,第一问绘制直方图,如下:
汽车公司规定的误差范围是±0.005英寸以内,从直方图的结果来看误差从-0.003英寸开始,一直到0.005英寸(10*0.0008-0.003=0.005),该范围在汽车公司规定的±0.005英寸以内,所以钢厂的工作达到了汽车公司的要求。
根据(a)中得出的结论,与教材题目相比,假设总体分布为正态分布都是成立的。
/*导入数据*/
import excel "C:\Users\86138\Desktop\20231213-发布作业-20231223 1540前提交\Steel.xlsx", sheet("DATA") firstrow clear
/*计算样本均值*/
summarize
/*教材53页第2.41题第一问绘制直方图*/
histogram Error