HW04

pdf

School

University Of Chicago *

*We aren’t endorsed by this school

Course

22000

Subject

Statistics

Date

Apr 3, 2024

Type

pdf

Pages

6

Uploaded by PresidentKnowledgeButterfly40

Report
HW04 2023-10-25 library (lattice) library (tidyverse) ## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ── ## dplyr 1.1.3 readr 2.1.4 ## forcats 1.0.0 stringr 1.5.0 ## ggplot2 3.4.3 tibble 3.2.1 ## lubridate 1.9.3 tidyr 1.3.0 ## purrr 1.0.2 ## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ── ## dplyr::filter() masks stats::filter() ## dplyr::lag() masks stats::lag() ## Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors Question 1) (a) Payout 0 = 1 - 0.21264 - 0.04325 - 0.00306 ## [1] 0.74105 ( - 1 * 0.74105 ) + ( 0 * 0.21264 ) + ( 2 * 0.04325 ) + ( 119 * 0.00306 ) ## [1] -0.29041 Thus expected payout is $ -0.29041 (c) standard dev first we calculate variance (((( - 1+0.29041 ) ^ 2 ) * 0.74105 ) + ((( 0 + 0.29041 ) ^ 2 ) * 0.21264 ) + ((( 2 + 0.29041 ) ^ 2 ) * 0.04325 ) + ((( 119 + 0.29041 ) ^ 2 ) * 0.00306 )) ## [1] 44.16237 std dev sqrt ( 44.16237 ) ## [1] 6.645477
std dev = 6.645 (d) if played 100 times expected net profit 100 * - 0.29041 ## [1] -29.041 -$29.041 (e) Since independant, variance of 100 days = 100 * 44.16237 ## [1] 4416.237 std dev = sqrt ( 4416.237 ) ## [1] 66.45477 std dev = 66.454 Question 2 EX = 35 * 1 / 38 - 1 * 37 / 38 EX ## [1] -0.05263158 Expected value = -1/19 VX = ( 1 / 38 * ( 35 + 1 / 19 ) ^ 2 ) + ( 37 / 38 * ( - 1 + 1 / 19 ) ^ 2 ) VX ## [1] 33.20776 Variance of x = 33.21 EY = 17 * 2 / 38 - 1 * 36 / 38 EY ## [1] -0.05263158 Expected value of Y = -1/19 VX = ( 2 / 38 * ( 17 + 1 / 19 ) ^ 2 ) + ( 36 / 38 * ( - 1 + 1 / 19 ) ^ 2 ) VX ## [1] 16.15512 Variance of Y = 16.15 (c) New expected value = -0.105 ( 34 * ( 1 / 38 )) + ( 16 * 2 / 38 ) + ( - 2 * 35 / 38 )
## [1] -0.1052632 New Variance = 47.57 ( 1 / 38 * ( 34 + 2 / 19 ) ^ 2 ) + ( 2 / 38 * ( 16 + 2 / 19 ) ^ 2 ) + ( 35 / 38 * ( - 2 + 2 / 19 ) ^ 2 ) ## [1] 47.56787 (d) variance of T = 47.57 V X + V Y = 33.21 + 16. 15 = 49.36 49.36 is not equal to 47.57 They are not the same since X and Y are not independent. Question 3 Drug A - ( 40 * 0.01 ) + ( 60 * 0.04 ) + ( 68 * 0.05 ) + ( 70 * 0.8 ) + ( 72 * 0.05 ) + ( 80 * 0.04 ) + ( 100 * 0.01 ) ## [1] 70 Expected value for drug A = 70 Drug B - ( 40 * 0.4 ) + ( 60 * 0.05 ) + ( 68 * 0.04 ) + ( 70 * 0.02 ) + ( 72 * 0.04 ) + ( 80 * 0.05 ) + ( 100 * 0.4 ) ## [1] 70 Expected value for Drug B - 70 (b) Variance for Drug A = 26.4 ( 30 ^ 2 * ( 0.01 )) + ( 10 ^ 2 * ( 0.04 )) + ( 2 ^ 2 * ( 0.05 )) + ( 0 ^ 2 * ( 0.8 )) + ( 2 ^ 2 * ( 0.05 )) + ( 10 ^ 2 * ( 0.04 )) + ( 30 ^ 2 * ( 0.01 )) ## [1] 26.4 Variance for Drug B = 730.32 ( 30 ^ 2 * ( 0.4 )) + ( 10 ^ 2 * ( 0.05 )) + ( 2 ^ 2 * ( 0.04 )) + ( 0 ^ 2 * ( 0.02 )) + ( 2 ^ 2 * ( 0.04 )) + ( 10 ^ 2 * ( 0.05 )) + ( 30 ^ 2 * ( 0.4 )) ## [1] 730.32 (c) While both Drugs produce the same avergae heartbeat at 70, they would not have identical effects as Drug B varies significantly more than Drug A. This variety means results have are less consistent than Drug A.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Question 4 ( 60-55 ) / 15.5 ## [1] 0.3225806 P(Z > 0.32) 1-P(Z < 0.32) Using z-score table , 0.3745 37.45% (b) to be above 40 , 40-mean/SD = 40-55 / 15.5 = -0.97 to be below 60 , 60-mean/SD = 60-55 / 15.5 = 0.32 P(-0.97 < Z < 0.32) = P(Z < 0.32) - P(-0.97 < Z) = 0.6244 - 0.1660 = 0.4595 45.95% (c) For P = 0.85 , z = 1.04 1.04 = (x - 55) / 15.5 x = 71.12 (d) For P = 0.2 , z = -0.84 -0.84 = (x - 55) / 15.5 x = 41.98 Question 5 (a) u = 10 , v = 9 , sd = 3 z = (15 - 10)/3 = 1.67 P(z<1.67) = 0.9522 95.22% chance (b) z = (12 -10)/3 = 0.67 P(z>0.67) = 1 - P(z<0.67) = 1- 0.7486 = 0.2514 25.14 % chance (c) For P = 0.05 , z= -1.645 -1.645 = (x - 10)/ 3 = 5.065 fastest 5% of repairs take 5.065 hours
Question 6 bdims = read.table ( "https://www.openintro.org/data/tab-delimited/bdims.txt" , header= TRUE ) fdims = subset (bdims, sex == 0 ) fhgtmean = mean (fdims $ hgt) fhgtsd = sd (fdims $ hgt) (b) Taller than 5’ 7 norm dist = 20.78% Taller according to data = 18.46 % 1 - pnorm ( q = 170.2 , mean = fhgtmean, sd = fhgtsd) ## [1] 0.2078056 with (fdims, sum (hgt > 170.2 ) / length (hgt)) ## [1] 0.1846154 (c) Norm dist 25% percentile = 160.45 According to data = 160 qnorm ( 0.25 , mean= fhgtmean, sd= fhgtsd) ## [1] 160.458 quantile (fdims $ hgt, prob= 0.25 ) ## 25% ## 160 library (lattice) library (tidyverse) hist (fdims $ age, breaks= 10 , freq= F, xlab= "Women's Age in year" ) fagemean = mean (fdims $ age) fagesd = sd (fdims $ age) x = seq ( 0 , 70 , length.out= 100 ); y = dnorm (x, fagemean, fagesd) lines (x, y)
(e) From data = 40.38% Normal Dist = 33.51% Since the actual data did not follow a normal distribution, I did not expect the two percentages to be equal with (fdims, sum (age < 25 ) / length (age)) ## [1] 0.4038462 pnorm ( 25 , mean = fagemean, sd = fagesd) ## [1] 0.3351456
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help