# MONTE CARLE ON STATA SOFTWARE Case Solution & Answer

## MONTE CARLE ON STATA SOFTWARE Case Solution

Appendix

Results of Tests before Simulation

Two Sample Mean Comparison test

. ttest MilesperGallonforUSCars == MilesPerGallonforJapaneseCa, unpaired

Two-sample t test with equal variances

——————————————————————————

Variable |Â Â Â Â  ObsÂ Â Â Â Â Â Â  MeanÂ Â Â  Std. Err.Â Â  Std. Dev.Â Â  [95% Conf. Interval]

———+——————————————————————–

Milesp~s |Â Â Â Â Â  80Â Â Â Â Â  15.975Â Â Â  .4689657Â Â Â  4.194556Â Â Â  15.04155Â Â Â  16.90845

MilesP~a |Â Â Â Â Â  80Â Â Â Â  30.4625Â Â Â  .6755082Â Â Â  6.041929Â Â Â  29.11793Â Â Â  31.80707

———+——————————————————————–

combined |Â Â Â Â  160Â Â Â  23.21875Â Â Â  .7056974Â Â Â  8.926444Â Â Â Â Â  21.825Â Â Â Â  24.6125

———+——————————————————————–

diff |Â Â Â Â Â Â Â Â Â Â  Â -14.4875Â Â Â  .8223382Â Â Â Â Â Â Â Â Â Â Â Â Â Â  -16.11169Â Â  -12.86331

——————————————————————————

diff = mean(MilesperGallon~s) – mean(MilesPerGallon~a)Â Â Â Â Â Â Â  t = -17.6174

Ho: diff = 0Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Â Â Â Â Â degrees of freedom =Â Â Â Â Â  158

Ha: diff < 0Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Ha: diff != 0Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Ha: diff > 0

Pr(T < t) = 0.0000Â Â Â Â Â Â Â Â  Pr(|T| > |t|) = 0.0000Â Â Â Â Â Â Â Â Â  Pr(T > t) = 1.0000

Mann-Whitney Test

. ranksum MilesPerGallon, by(GroupingVariableCars)

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

GroupingVa~s |Â Â Â Â Â  obsÂ Â Â  rank sumÂ Â Â  expected

————-+———————————

0 |Â Â Â Â Â Â  37Â Â Â Â Â Â Â  1530Â Â Â Â Â  1498.5

1 |Â Â Â Â Â Â  43Â Â Â Â Â Â Â  1710Â Â Â Â Â  1741.5

————-+———————————

combined |Â Â Â Â Â Â  80Â Â Â Â Â Â Â  3240Â Â Â Â Â Â Â  3240

unadjusted varianceÂ Â Â  10739.25

adjustment for tiesÂ Â Â Â Â  -37.64

———-

adjusted varianceÂ Â Â Â Â  10701.61

Ho: MilesP~n(Groupi~s==0) = MilesP~n(Groupi~s==1)

z =Â Â  0.304

Prob > |z| =Â Â  0.7607

Results of Tests after Simulation

Two Sample Mean Comparison Test

. ttest MilesPerGallon == SimulatedrMilesPerGallon, unpaired

Two-sample t test with equal variances

——————————————————————————

Variable | Â Â Â Â ObsÂ Â Â Â Â Â Â  MeanÂ Â Â  Std. Err.Â Â  Std. Dev.Â Â  [95% Conf. Interval]

———+——————————————————————–

MilesP~n |Â Â Â Â Â  80Â Â Â  23.21875Â Â Â  .3903345Â Â Â  3.491258Â Â Â  22.44181Â Â Â  23.99569

Simula~n |Â Â Â Â Â  80Â Â Â Â  22.0625Â Â Â  .3455613Â Â Â  3.090794Â Â Â  21.37468Â Â Â  22.75032

———+——————————————————————–

combined |Â Â Â Â  160Â Â Â  22.64063Â Â Â  .2638525Â Â Â Â Â  3.3375Â Â Â  22.11952Â Â Â  23.16173

———+——————————————————————–

diff |Â Â Â Â Â Â Â Â Â Â Â Â  1.15625Â Â Â  .5213191Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  .1265967Â Â Â  2.185903

——————————————————————————

diff = mean(MilesPerGallon) – mean(SimulatedrMile~n)Â Â Â Â Â Â Â Â Â  t =Â Â  2.2179

Ho: diff = 0Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  degrees of freedom =Â Â Â Â Â  158

Ha: diff < 0Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Ha: diff != 0Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Ha: diff > 0

Pr(T < t) = 0.9860Â Â Â Â Â Â Â Â  Pr(|T| > |t|) = 0.0280Â Â Â Â Â Â Â Â Â  Pr(T > t) = 0.0140

Mann-Whitney Test

. ranksum SimulatedrMilesPerGallon, by(GroupingVariableCars)

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

GroupingVa~s |Â Â Â Â Â  obsÂ Â Â  rank sumÂ Â Â  expected

————-+———————————

0 |Â Â Â Â Â Â  37Â Â Â Â Â  1615.5Â Â Â Â Â  1498.5

1 |Â Â Â Â Â Â  43 Â Â Â Â Â 1624.5Â Â Â Â Â  1741.5

————-+———————————

combined |Â Â Â Â Â Â  80Â Â Â Â Â Â Â  3240Â Â Â Â Â Â Â  3240

unadjusted varianceÂ Â Â  10739.25

adjustment for tiesÂ Â Â Â  -114.16

———-

adjusted varianceÂ Â Â Â Â  10625.09

Ho: Simula~n(Groupi~s==0) = Simula~n(Groupi~s==1)

z =Â Â  1.135

Prob > |z| =Â Â  0.2563…………….

This is just a sample partial work. Please place the order on the website to get your own originally done case solution