Docsity

Descriptive Statistics - Lecture Slides | BINF 702, Study notes of Bioinformatics

Partial preview of the text

Download Descriptive Statistics - Lecture Slides | BINF 702 and more Study notes Bioinformatics in PDF only on Docsity!

^ ^  ^   ^ ^ ^     

!"#$^ "!%&!"  '!&!'!(!")**+),&%, ^ ^ ^     

^ /##$^ !)".!

!--!,^0 %,

")"^ !"&)!")!

-!*^2 %"

-,!**%^4

hist^ "

op <- par(mfrow=c(2, 2))hist(islands)utils::str(hist(islands,col="gray", labels =TRUE))hist(sqrt(islands), br= 12, col="lightblue",border="pink")##-- For non-equidistantbreaks, counts shouldNOT be graphed unscaled:r <-hist(sqrt(islands), br =c(40:5, 103:5, 70,100, 140), col='blue1')text(r$mids, r$density,r$counts, adj=c(.5, -.5), col='blue3')sapply(r[2:3], sum)sum(r$density diff(r$breaks)) # == 1lines(r, lty = 3, border= "purple") # ->lines.histogram()

!"#$^ "!%&!"  /##^6 %*--!'"& ^ ^ ^     

)!^5 !+-!-)

%!"!)!^5 (&+-!*!

+!^5 """!")"+-

!-+-!-)!^5 )

!"&*#"$7^ 

)!^5 %%"%%-

)!^5 +-!%%"!+!^5 "

)!^5 ,"!")"# &!

".%"^0 -&-!

+!^5 "."!")"!'

)!^5 "%!'"!")!^5 

8 +-"!)!^5 ".+)

%"-+!^5 *9!

&!"!":-^1 & ^ ^ ^     

^ "^ ^  "%;&^2 !"!&

:^6 <  :-"%/!!"8 ==>? >9  "'"% ;& 2 !"8 >? @^9 ^ "%^ ^ ^  ^ ^ (,3) #"% ^ !)!(("^ ^  ^    

^  (,!)#!((" ^ %+%#&'^ ^  ^ !"    #

$ ^  (,%+%#&'

!"#^6 &)"! ^ ^ ^     

^ !"%)*!'%

/^0 /^0 A0/%+"'!)!&$"^

*!"^ ^ +-"'"!

!"&!"(!&^ ^ "(.

"%'!)-)*^4

^ !"##$^ -)

^ &))!"!!" ^ '##$^ --))

n^ y^ y^ y^ y^ =^ +^ +^ +^ ^1 2^ i^ n ^1 i = n^ n^ cx^ c^ x^ =^  i^ i^1 1 i i =^ = "%'"%^ x n^1 x x =^ ^ i^ n^^1^ i =

!"#-^ -)6 ^ ^ ^     

^ -)"" ^ )"8/0A9 > x = matrix(rnorm(100), nrow=50, ncol=2)> x[50,1] = 60> x[50,2] = 880> plot(x[,1],x[,2])> apply(x,2,mean)[1] 1.259362 1.648327> apply(x,2,mean,trim=0.1)[1] 0.1475340 0.

-'!"!'!(!" !()!%'!)- "%!'-%#

!"#^ -6%"  '##^ -)*)%"^  ."(,^1 (1) The^ th largest observation if^ is odd^2 (2) The average of the^ th and^ 1 th largest observation if ^ ^ ^     

is even. n^ n n^ n^^2

n +    ^ ^ ^ ^ +^ ^ ^ ^ ^ ^ 

!"#^ !)!"!'- -)6""%-6%" 8,))(&!"9 > symmdata =^ rnorm(100)> hist(symmdata,nclass=10)> points(mean(symmdata),0, pch = 'o')> points(median(symmdata),0, pch = '*') ^ ^ ^     

!"#^ !)!"!'- -)6""%-6%" 8,))(&!".- ^ ^ ^     

*%^9

expdata = rexp(100)> hist(expdata, nclass =15)> points(mean(expdata),^ 0,pch = 'o')> points(median(expdata),0, pch = '*')

!"#^ !)!"!'- -)6""%-6%"8* ^ ^ ^     

* -(&!"

9

!"#^6 &!' ! ^ ^ ^     

!"8- 6 !%^9 ^ '##>^ -)!%-

)!'^1 &",!&".

^ "-()!-"!")!

%^4 ^ !--!()!%

4 ^ !)!%-!(%

&^4 ^ 3-%!,!&-"5&")!%

%(&!"^4 ^ !+(!&)&)!%%

(&!" ^ 3".'&"!"'!-)!

#>^ !)!!'-  ^ ^ ^     

  • ) 6 "8''!'

"*!" Eq. 2.1 - If^

,^ 1,^ , y^ x^ i^ i then c i^ n = + =^  y x c = +

x = rnorm(1000)> mean(x)[1] 0.02741812> mean(x+5)[1] 5.

#>^ !)!!'-  ^ ^ ^     

  • ) 6 "8''!' 

*".^9 Eq. 2.2 - If^

,^ 1,^ , i^ then. y^ cx^ i^ n^ =^ =^  i y cx =

x = rnorm(1000)> mean(x)[1] 0.02741812> mean(2*x)[1] 0.