BLOG

Statistics of Dispersion

26-01-2019  0 Comment(s)

Measures of dispersion—such as range, variance, standard deviation, and coefficient of variation—can be calculated with standard functions in the native stats package.  In addition, a function, here called summary.list, can be defined to output whichever statistics are of interest.

Input =("
Stream                     Fish
 Mill_Creek_1                76
 Mill_Creek_2               102
 North_Branch_Rock_Creek_1   12
 North_Branch_Rock_Creek_2   39
 Rock_Creek_1                55
 Rock_Creek_2                93
 Rock_Creek_3                98
 Rock_Creek_4                53
 Turkey_Branch              102
")

Data = read.table(textConnection(Input),header=TRUE)

 

 

 

range(Data$ Fish, na.rm=TRUE)       

 

[1]  12 102     # Min and max

 

 

max(Data$ Fish, na.rm=TRUE) - min(Data$ Fish, na.rm=TRUE)

 

[1] 90

 

Comment Here

Comments

No Comments to Show

WE ALWAYS WORK WITH :