math 410 exam 2

pdf

School

Drexel University *

*We aren’t endorsed by this school

Course

410

Subject

Statistics

Date

Jan 9, 2024

Type

pdf

Pages

12

Uploaded by madnan12678

Report
Exercise 2.1A pnorm(42,35.29,4.49) 1-pnorm(42,35.29,4.49) 0.06753136 By hand: (45-35.29)/4.49= 1.49 prob= 0.9319 1-0.9319= 0.0681 Exercise 2.1B 1-pnorm(42,35.29,1.42) 1.148585e-06 By hand: 4.49/(sqrt(10))= 1.42 (standard error) (45-35.29)/1.42= 4.725 No probability because the value is too big Exercise 2.1C pnorm(41,35.29,4.49)-pnorm(33,35.39,4.49) 0.6010016 By hand: (41-35.29)/4.49=1.27 (33-35.29)/4.49= -0.51002 prob= 0.8980 prob= 0.3050 0.8980-0.3050= 0.593 Exercise 2.2A dbinom(0,20,0.53)+dbinom(1,20,0.53)+dbinom(2,20,0.53)+dbinom(3,20,0.53) 0.0005256292 Exercise 2.2B mean=(20*0.53) mean 10.6
sd=sqrt(20*0.53*0.47) sd 2.232039 normal_approximation=(3-mean)/sd pnorm(normal_approximation) 0.0003308714 The values are not that similar being 0.0005 and 0.0003. Although there is only a .0002 difference, there is a difference in r value and binomial distribution. Exercise 3.1A data=read.csv(file.choose()) data data=mfish mean(mfish) 23.59836 sd(mfish) 2.638705 hist(mfish,col="lightblue", xlim=c(0,30),ylim=c(0,250),breaks=15,xlab="Mosquito Fish Length (mm)",main="Histogram for Mosquito Fish Lengths") It is not normally distributed since the data can be seen as being skewed to the right.
Exercise 3.1B sample_means=replicate(500, mean(sample(fish$FishLength,10))) sample_means hist(sample_means, main="Histogram of Sample Means", xlab="Mean Length",breaks=20, col="lavender") sampling_distribution_mean=mean(sample_means) sampling_distribution_sd=sd(sample_means) sampling_distribution_mean sampling_distribution_sd Exercise 3.1C The data appears to be normally distributed
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
Exercise 3.1D Sampling_distribution_mean 28.7258 Sampling_distribution_sd 2.180124 Exercise 3.1E standard_error=sd(mfish)/sqrt(10) standard_error 0.8344318 mu=mean(mfish) lower=mu-1.96*standard_error upper=mu+1.96*standard_error confidence_interval=c(lower,upper) Confidence_interval 21.96287 25.23385 count=0 for(i in 1:500) {if(lower<=sample_means[i]&&sample_means[i]<=upper) count=count+1} count/500*100 3.6 3.6% of the sample means calculated fall between the confidence interval which is 21.96287 and 25.23385 Exercise 3.1F 50 sample_means=replicate(500, mean(sample(fish$FishLength,50))) sample_means hist(sample_means, main="Histogram of Sample Means", xlab="Mean Length",breaks=20, col="lightpink") sampling_distribution_mean=mean(sample_means) sampling_distribution_sd=sd(sample_means) sampling_distribution_mean sampling_distribution_sd
The sampling distribution appears to be normal Sampling_distribution_mean 28.75564 Sampling_distribution_sd 0.9571983 Standard_error=sd(mfish)/sqrt(50) Standard_error .9669477 mu=mean(mfish) lower=mu-1.96*standard_error upper=mu+1.96*standard_error confidence_interval=c(lower,upper) Confidence_interval 26.86553 30.65597
count=0 for(i in 1:500) {if(lower<=sample_means[i]&&sample_means[i]<=upper) count=count+1} count/500*100 95.6 95% of the sample is between 26.86553 and 30.65597 100 sample_means=replicate(500, mean(sample(fish$FishLength,100))) sample_means hist(sample_means, main="Histogram of Sample Means", xlab="Mean Length",breaks=20, col="turquoise") sampling_distribution_mean=mean(sample_means) sampling_distribution_sd=sd(sample_means) sampling_distribution_mean sampling_distribution_sd
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
The data is skewed to the right Sampling_distribution_mean 28.71972 Sampling_distribution_sd 0.6841676 standard_error=sd(mfish)/sqrt(100) Standard_error 0.2638705 mu=mean(mfish) lower=mu-1.96*standard_error upper=mu+1.96*standard_error confidence_interval=c(lower,upper) Confidence_interval 23.08117 24.11555 count=0 for(i in 1:500) {if(lower<=sample_means[i]&&sample_means[i]<=upper) count=count+1} count/500*100 0 95% of the values are between 23.08 and 24.12 Exercise 4.1A The data would be skewed to the right and would not be normally distributed library(psych) data=read.csv(file.choose()) data describe(bluegill$Length) vars n mean sd median trimmed mad min max range skew kurtosis se X1 1 888 120.03 41.95 135 119.98 53.37 46 220 174 -0.07 -1.37 1.41
hist(bluegill$length,col="hotpink",xlim=c(0,250),ylim=c(0,250),xlab="Bluegill Length", main="Bluegill Sunfish Lengths") This graph does not resemble a normal bell curve as can be seen in the graph above Exercise 4.1B qqnorm(bluegill$Length) qqline(bluegill$Length)
The data is not a straight line and deviates from the straight line Exercise 4.1C skew(bluegill$length) NA kurtosi(bluegill$length) NA There is no expected value for the skew or the kurtosi and thus the computed values are not close to the expected values Exercise 4.1D shapiro.test(bluegill$Length) Shapiro-Wilk normality test data: bluegill$Length W = 0.91704, p-value < 2.2e-16 Exercise 4.1E As can be seen in the above graphs, quartile plot, skew and kurtosi and the Shapiro-Wilk normality test we can conclude that the sample does not follow the normal distribution. Exercise 4.2A The data should be skewed towards the left library(psych) data=read.csv(file.choose()) data describe(data) hist(data,col="lightgreen",xlim=c(0,200),ylim=c(0,20),xlab="Income in thousands of dollars", main="Income in 1000's")
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
This graph does not resemble a normal cell curve Exercise 4.2B qqnorm(income_data$Incomes) qqline(income_data$Incomes)
As can be seen at the beginning the data follows a straight line, however towards the end it skews from the line Exercise 4.2C skew(income_data$Incomes) 2.425454 kurtosi(income_data$Incomes) 6.828991 The computed skew value is 2.425454 and the computed kurtosi value is 6.828991, these values can be seen as being close to the expected values Exercise 4.2D shapiro.test(income_data$Incomes) Shapiro-Wilk normality test
data: income_data$Incomes W = 0.73049, p-value =3.199e-07 Exercise 4.2E As can be seen in the above graphs, quartile plot, skew and kurtosi and the Shapiro-Wilk normality test we can conclude that the sample does not follow the normal distribution.
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