Math 410 Exam 1

.pdf

School

Drexel University *

*We aren’t endorsed by this school

Course

410

Subject

Statistics

Date

Jan 9, 2024

Type

pdf

Pages

16

Uploaded by madnan12678

Report
Problem 1 Pond ID 1 2 3 4 5 6 7 8 9 10 11 Bullfrogs 32 70 23 33 21 23 20 73 11 22 35 Rank 7 10 6 8 3 5 2 11 1 4 9 bullfrogs=c(32,70,23,33,21,23,20,73,11,22,35) sort(bullfrogs)#assign each number a rank in numerical order rank(bullfrogs) bullfrogs=c(32,70,23,33,21,23,20,73,11,22,35) sort(bullfrogs)#assign each number a rank in numerical order 11 20 21 22 23 23 32 33 35 70 73 rank(bullfrogs) 7.0 10.0 5.5 8.0 3.0 5.5 2.0 11.0 1.0 4.0 9.0 Problem 2 female=student_data[student_data$Gender=="female",] f=female$Pulse hist(f,breaks=10,xlim=c(20,160),ylim=c(0,35),main="Frequency of Pulse Rates in Females", xlab="Pulse Rates", col="pink")
male=student_data[student_data$Gender=="male",] m=male$Pulse hist(m,breaks=10,xlim=c(40,120),ylim=c(0,25),main="Frequency of Pulse Rates in Males", xlab="Pulse Rates", col="lightblue") The histograms differ slightly from eachother, for example, the male histogram has more pulse rate frequencies while the female histogram is more compact. Furthermore, while the female histogram goes up to the 30’s the male histogram goes up to the 20’s. The one similarity that I can see from the graphs is that their mode would fall somewhere around the value of 80. Problem 3 bass=read.csv(file.choose()) bass lengths=bass$length.mm. bins=seq(50,500, by=50) cut_data=cut(lengths,bins) tlengths=table(cut_data) tfish=transform(tlengths) names(tfish)[1]="Length(mm)"
names(tfish)[2]="Frequency" tfish Length(mm) Frequency 1 (50,100] 3 2 (100,150] 6 3 (150,200] 12 4 (200,250] 18 5 (250,300] 10 6 (300,350] 25 7 (350,400] 15 8 (400,450] 10 9 (450,500] 1 hist(lengths,breaks=20,main="Frequency of the Lengths of Largemouth Bass (mm)",col="lavender",xlim=c(0,500),ylim=c(0,15),xlab="Length(mm)")
Problem 4 cum_data=cumsum(table(cut_data)) cum_col=transform(cum_data)$X_data cum_tlengths=data.frame(tlengths, cum_col) names(cum_tlengths)[1]="Length(mm)" names(cum_tlengths)[2]="Frequency" names(cum_tlengths)[3]="Cumulative Frequency" table(cum_tlengths) transform(table(cum_tlengths)) data=read.csv2(file.choose()) x=data$length.mm y=cumsum(x) hist_info=hist(y,breaks=20,main="Cumulative Frequencies for Base Lengths", col="turquoise", xlim=c(0,34000),ylim=c(0,10),xlab='Cumulative Sum')
bin=seq(50,500, by=50) bin freq.data=cut(bass$lengths,bin) freq.data hb=transform(table(freq.data)) names(hb)[1]='Length(mm)' names(hb)[2]='Frequency' hb cumbass=cumsum(table(freq.data)) cumbass bruh=data.frame(hb,cumbass) names(bruh)[3]='Cumulative Sum' names(bruh)[1]='Length(mm)' bruh=data.frame(hb,cumbass) Bruh library(LearningStats) freq.pol(bass$length.mm.,main=’Polygon of Cumulative Frequencies for Length’, xlab=’Length(in mm)’, ylab=’Cumulative Frequency’,freq=T)
This data shows the impact that the cumulative frequencies range from 0-8 while on the other hand, the frequencies range from 0-15. Problem 5 kingfisher=read.csv(file.choose()) kingfisher_data=kingfisher$Bill_length Mean mean(kingfisher_data) 55.9119 Median median(kingfisher_data) 56.5 Mode sort(kingfisher_data) [1] 41.6 46.3 46.6 47.5 48.3 49.4 50.8 50.9 51.5 51.6 52.0 53.0 53.4 53.4 [15] 54.5 54.6 54.6 55.0 55.2 55.5 56.5 56.5 56.5 56.6 57.2 57.2 57.5 58.1 [29] 58.8 58.8 58.8 59.4 59.4 60.6 61.2 62.7 62.8 64.0 64.6 64.6 64.8 66.0 freq_dat=kingfisher_data table(x) 4 5 6 7 8 9 10 11 12 14 15 16 18 19 20 21 32 72 1 5 5 4 6 6 3 3 6 1 2 1 1 1 1 2 1 1 transform(table(x)) 1 4 1 2 5 5 3 6 5 4 7 4 5 8 6 6 9 6 7 10 3 8 11 3 9 12 6 10 14 1
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