Lab 7

.pdf

School

Drexel University *

*We aren’t endorsed by this school

Course

410

Subject

Computer Science

Date

Jan 9, 2024

Type

pdf

Pages

8

Uploaded by MegaOysterMaster676

Report
11/8/23, 5 : 06 PM Lab 7 Page 1 of 8 file:///Users/mathabib/Documents/R%20files/Lab-7.html Lab 7 Mathew H 2023-11-08 library (magrittr) library (formattable) library (LearningStats) library (knitr) Exercise 1: Hand calc: mean=3.5 sd=0.75 x=2 Z=(x-mean)/sd Z=-2 Using table, prob = 0.0228 Using r: pnorm1=pnorm(2,3.5,.75) pnorm1 ## [1] 0.02275013 Exercise 2: Mean=37 sd=3.5 x=43 Z=1.714 Using table, prob is .9564 for probability of finding squid LESS than 43 feet Prob of 43 feet or more is 1-.9564, so probability of squid longer than 43 feet is 0.0436 Using r:
11/8/23, 5 : 06 PM Lab 7 Page 2 of 8 file:///Users/mathabib/Documents/R%20files/Lab-7.html bigsquid=1-pnorm(43,37,3.5) bigsquid ## [1] 0.04323813 Exercise 3: By hand: mean=70 sd=3 x=77,79 Z for 77 = 2.33 prob of less than 77 from table = .9901 Z for 79 = 3.00 prob of less than 79 from table = .9987 Prob of being between 77 to 79 in is equal to .9987-.9901 = .0086 Using r: probtall=pnorm(79,70,3)-pnorm(77,70,3) probtall ## [1] 0.008465431 Exercise 4: By hand: Mean=82 sd=5 x=? top 10% prob=0.90 Z (from table) = 1.29 1.29=(x-82)/5 Score to be in top 10% = 88.45% using r:
11/8/23, 5 : 06 PM Lab 7 Page 3 of 8 file:///Users/mathabib/Documents/R%20files/Lab-7.html testprobs1=pnorm(80:90,82,5) testprobs1 ## [1] 0.3445783 0.4207403 0.5000000 0.5792597 0.6554217 0.7257469 0.7881446 ## [8] 0.8413447 0.8849303 0.9192433 0.9452007 testprobs2=pnorm(c(88.1,88.2,88.3,88.4,88.5,88.6,88.7,88.8,88.9),82,5) testprobs2 ## [1] 0.8887676 0.8925123 0.8961653 0.8997274 0.9031995 0.9065825 0.9098773 ## [8] 0.9130850 0.9162067 top 10% is about 88.5% on test Exercise 5: probnegheight=pnorm(-10,70,3) probnegheight ## [1] 5.734783e-157 The return of this value is not a problem for the normal distribution because while it is above zero, it is such a small chance that it can be said to be statistically impossible. Exercise 6: heights=read.csv("/Users/mathabib/Documents/R files/heights.csv") heights=heights$Height hist(heights,main="Histogram of Heights",xlim=c(60,100),breaks=20)
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