0
$\begingroup$

This is probably a really simple task and I'm just struggling with implementation in R.

I have a simple dataset which contains three columns: Species (factor), move_direction (factor), velocity (double). This dataset contains observations of one individual of a fish species, the direction they are moving and the water velocity they are experiencing. These individuals are either EXITing, ENTERing, or moving back and forth "Unresolved Transit" through a trough, against or with the flow. We would like to compare the frequency of transit at each flow against the frequency of the flow being experienced for each Species, and for each movement direction. This is quickly done using a density plot in ggplot for a graphical approach.

enter image description here

However, we'd prefer a more quantitative approach as well. And this is where I think I'm brain dead. How can I compare the grey distributions with the blue distribution? My initial thought was an ANOVA followed by a Dunnet's test was the best method (many to one comparison), but for the life of me I can't figure out how to prepare the data in a way that allows me to test each of these Species-Direction groups against the single group for velocity. what am I missing?

dput for the fish:

structure(list(Species = structure(c(3L, 3L, 3L, 3L, 3L, 3L, 
3L, 3L, 3L, 3L, 1L, 3L, 3L, 3L, 3L, 1L, 1L, 1L, 1L, 3L, 3L, 3L, 
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 2L, 
3L, 1L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 2L, 3L, 3L, 1L, 
1L, 1L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
3L, 3L, 3L, 3L, 3L, 3L,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L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
3L, 1L, 3L, 3L, 3L, 3L, 3L), .Label = c("ENTRY", "EXIT", "UNRESOLVED TRANSIT"
), class = "factor"), velocity = c(13.6453313801918, 13.6453313801918, 
18.9022227603311, 14.134929100137, 13.0383397974916, 15.0208239046809, 
17.2360296699777, 12.8739154011443, 11.5125020876863, 14.134929100137, 
15.2815398323826, 13.6453313801918, 16.7033560783892, 17.5866062609141, 
16.6019221463589, 12.295505247553, 12.8739154011443, 10.7577700825881, 
11.6322873050383, 13.6453313801918, 18.9022227603311, 14.5388549019469, 
14.9147421365201, 13.4174205324699, 12.8870879110287, 15.141187831977, 
13.5719681845517, 12.7628672311777, 12.3927802957971, 15.0078717699194, 
11.4298865328484, 16.7033560783892, 18.9022227603311, 13.6995072862424, 
15.6428694201856, 11.7542597299248, 11.4298865328484, 16.7033560783892, 
17.5866062609141, 16.6019221463589, 15.7571238864593, 15.0208239046809, 
15.5899080662029, 11.4298865328484, 12.1949045492911, 12.9470970255149, 
15.0239278562094, 17.5722634430017, 16.5780647604611, 18.8445930118168, 
15.6428694201856, 11.2151277680135, 14.0762737394092, 10.929051234388, 
14.0395903254171, 15.400992566745, 14.4423312382908, 12.295505247553, 
14.2494209409645, 11.7542597299248, 13.8827763536416, 13.6453313801918, 
14.0169848319234, 13.4536937222743, 15.8333521422363, 7.65441233943411, 
8.73477275353981, 12.8409512610131, 17.4266929223461, 14.5426869052299, 
17.4673105426096, 17.7686853162909, 17.2360296699777, 15.2815398323826, 
12.8739154011443, 10.7577700825881, 12.4058853827349, 13.1675343641356, 
16.5074215535614, 13.4819746323108, 13.0517190729502, 12.0418099817759, 
13.1719572677233, 11.3684623498046, 12.752747455909, 11.6322873050383, 
11.277903826005, 10.7513966699651, 11.5125020876863, 11.4735995953559, 
11.0541683371921, 13.4890776409407, 11.7034797956067, 12.8574449441477, 
12.2885055756605, 15.2719664199116, 13.1368422107047, 12.5766792459247, 
10.8288436796691, 11.8113710888387, 10.7316074121616, 11.4447553694954, 
13.0595134049142, 10.1103735935612, 10.7529675540141, 14.0515603574116, 
18.1713923647011, 15.9844065041227, 13.8656522935631, 14.1662103078043, 
13.4207300196531, 11.3786808663319, 14.324856027304, 11.7542597299248, 
11.7542597299248, 11.4298865328484, 15.5899080662029, 12.2885055756605, 
15.5899080662029, 7.65441233943411, 13.6453313801918, 13.081901066887, 
11.0113326232253, 15.2124375291078, 11.7542597299248, 11.4298865328484, 
7.65441233943411, 11.7542597299248, 13.6453313801918, 14.0169848319234, 
17.5722634430017, 12.295505247553, 15.5899080662029, 15.2815398323826, 
13.1675343641356, 13.4819746323108, 11.4298865328484, 11.7542597299248, 
11.6322873050383, 10.7316074121616, 13.8656522935631, 12.7628672311777, 
13.4174205324699, 11.4298865328484, 10.7316074121616, 16.7033560783892, 
17.5866062609141, 16.6019221463589, 15.7571238864593, 15.0208239046809, 
15.5899080662029, 11.4298865328484, 12.1949045492911, 12.9470970255149, 
15.0239278562094, 17.5722634430017, 16.5780647604611, 18.8445930118168, 
15.6428694201856, 11.2151277680135, 14.0762737394092, 10.929051234388, 
14.0395903254171, 15.400992566745, 14.4423312382908, 12.295505247553, 
14.2494209409645, 11.7542597299248, 13.8827763536416, 13.6453313801918, 
14.0169848319234, 13.4536937222743, 15.8333521422363, 7.65441233943411, 
8.73477275353981, 12.8409512610131, 17.4266929223461, 14.5426869052299, 
17.4673105426096, 17.7686853162909, 17.2360296699777, 15.2815398323826, 
12.8739154011443, 10.7577700825881, 12.4058853827349, 13.1675343641356, 
16.5074215535614, 13.4819746323108, 13.0517190729502, 12.0418099817759, 
13.1719572677233, 11.3684623498046, 12.752747455909, 11.6322873050383, 
11.277903826005, 10.7513966699651, 11.5125020876863, 11.4735995953559, 
11.0541683371921, 13.4890776409407, 11.7034797956067, 12.8574449441477, 
12.2885055756605, 15.2719664199116, 13.1368422107047, 12.5766792459247, 
10.8288436796691, 11.8113710888387, 10.7316074121616, 11.4447553694954, 
13.0595134049142, 10.1103735935612, 10.7529675540141, 14.0515603574116, 
18.1713923647011, 15.9844065041227, 13.6453313801918, 18.9022227603311, 
15.0239278562094, 17.5722634430017, 16.5780647604611, 18.8445930118168, 
15.6428694201856, 11.2151277680135, 14.0762737394092, 10.929051234388, 
14.0395903254171, 15.400992566745, 14.4423312382908, 12.295505247553, 
14.2494209409645, 11.7542597299248, 13.8827763536416, 13.6453313801918, 
14.0169848319234, 13.4536937222743, 15.8333521422363, 7.65441233943411, 
8.73477275353981, 12.8409512610131, 17.4266929223461, 14.5426869052299, 
17.4673105426096, 17.7686853162909, 17.2360296699777, 15.2815398323826, 
12.8739154011443, 10.7577700825881, 12.4058853827349, 13.1675343641356, 
16.5074215535614, 13.4819746323108, 13.0517190729502, 12.0418099817759, 
13.1719572677233, 11.3684623498046, 12.752747455909, 11.6322873050383, 
11.277903826005, 10.7513966699651, 11.5125020876863, 11.4735995953559, 
11.0541683371921, 13.4890776409407, 11.7034797956067, 12.8574449441477, 
12.2885055756605, 15.2719664199116, 13.1368422107047, 12.5766792459247, 
10.8288436796691, 11.8113710888387, 10.7316074121616, 11.4447553694954, 
13.0595134049142, 10.1103735935612, 10.7529675540141, 14.0515603574116, 
18.1713923647011, 15.9844065041227, 13.8656522935631, 14.1662103078043, 
13.4207300196531, 11.3786808663319, 14.324856027304, 19.5060989919003, 
18.9022227603311, 18.6939095482929, 18.2972157575218, 14.5388549019469, 
14.9147421365201, 13.4174205324699, 12.8870879110287, 15.141187831977, 
13.5719681845517, 12.7628672311777, 12.3927802957971, 15.0078717699194, 
12.9048920389216, 12.3121973805463, 13.0079690097902, 14.134929100137, 
13.0383397974916, 12.9429541309291, 13.6995072862424, 14.0559675562822, 
13.4325094700834, 12.1097419650113, 12.4051823701823, 12.4574630427022, 
12.246200214807, 11.7701764895082, 11.2604756551791, 17.3992123763047, 
13.081901066887, 11.0113326232253, 15.2124375291078, 12.5935430151807, 
13.1082055176341, 12.4714175383645, 13.9518142169385, 11.0400390468908, 
10.0789941515819, 10.4907855732375, 11.5869351778413, 13.0277653390356, 
10.3063350614386, 10.2663832537566, 10.9920198567042, 11.090231647795, 
10.4640360636538, 12.6582673194846, 12.3766606743865, 11.225811768827, 
10.5255344018194, 13.4871301076043, 11.3303154725577, 10.7577700825881, 
11.7542597299248, 8.73477275353981, 12.8409512610131, 12.4058853827349, 
15.141187831977, 13.5719681845517, 11.7542597299248, 13.8827763536416, 
15.5899080662029, 7.65441233943411, 17.2360296699777, 14.2494209409645, 
7.65441233943411, 11.7542597299248, 15.5899080662029, 12.0418099817759, 
15.6428694201856, 12.295505247553, 14.2494209409645, 13.8827763536416, 
13.6453313801918, 13.4536937222743, 7.65441233943411, 12.8409512610131, 
17.4266929223461, 14.5426869052299, 11.4298865328484, 13.8827763536416, 
13.6453313801918, 7.65441233943411, 17.4673105426096, 13.6453313801918, 
8.73477275353981, 12.8409512610131, 17.4673105426096, 17.7686853162909, 
17.2360296699777, 15.2815398323826, 11.3684623498046, 12.752747455909, 
11.6322873050383, 11.277903826005, 10.7513966699651, 11.5125020876863, 
11.4735995953559, 11.0541683371921, 13.4890776409407, 12.4574630427022, 
12.246200214807, 11.7701764895082, 11.2604756551791, 17.3992123763047, 
13.081901066887, 11.0113326232253, 15.2124375291078, 12.5935430151807, 
13.1082055176341, 12.4714175383645, 13.9518142169385, 11.0400390468908, 
10.0789941515819, 10.4907855732375, 11.7542597299248, 13.8827763536416, 
7.65441233943411, 8.73477275353981, 12.8409512610131, 14.0515603574116, 
10.7577700825881, 11.4298865328484, 18.9022227603311, 12.4058853827349, 
16.5074215535614, 13.4819746323108, 13.0517190729502, 12.0418099817759, 
13.1719572677233, 11.3684623498046, 12.752747455909, 11.6322873050383, 
11.277903826005, 10.7513966699651, 11.5125020876863, 11.4735995953559, 
11.0541683371921, 13.4890776409407, 11.7034797956067, 12.8574449441477, 
12.2885055756605, 15.2719664199116, 13.1368422107047, 12.5766792459247, 
10.8288436796691, 11.8113710888387, 10.7316074121616, 11.4447553694954, 
13.0595134049142, 10.1103735935612, 10.7529675540141, 14.0515603574116, 
18.1713923647011, 15.9844065041227, 13.8656522935631, 14.1662103078043, 
13.4207300196531, 11.3786808663319, 14.324856027304, 19.5060989919003, 
18.9022227603311, 18.6939095482929, 18.2972157575218, 14.5388549019469, 
14.9147421365201, 13.4174205324699, 12.8870879110287, 15.141187831977, 
13.5719681845517, 12.7628672311777, 12.3927802957971, 15.0078717699194, 
12.9048920389216, 12.3121973805463, 13.0079690097902, 14.134929100137, 
13.0383397974916, 12.9429541309291, 13.6995072862424, 14.0559675562822, 
13.4325094700834, 12.1097419650113, 12.4051823701823, 12.4574630427022, 
12.246200214807, 11.7701764895082, 11.2604756551791, 17.3992123763047, 
13.081901066887, 11.0113326232253, 15.2124375291078, 12.5935430151807, 
13.1082055176341, 12.4714175383645, 13.9518142169385, 11.0400390468908, 
10.0789941515819, 11.7542597299248, 12.295505247553, 12.4058853827349, 
12.4051823701823, 12.295505247553, 17.2360296699777, 18.9022227603311
)), class = c("tbl_df", "tbl", "data.frame"), row.names = c(NA, 
-490L))

and dput for the velocities

structure(list(velocity = structure(c(17.4553615381508, 16.3229905847167, 
15.015808397361, 15.0432443257299, 15.3057822938318, 12.0057746235586, 
10.9046516149553, 12.8478703153274, 13.4793302999138, 12.3982368397024, 
13.3020895070231, 15.7323827643822, 13.8489539931155, 11.8335598390518, 
9.60587794593338, 10.847978117369, 11.6545540290205, 12.5224416450031, 
14.4578818872669, 12.444766829317, 12.2499967349697, 13.4839338315792, 
12.2105594323062, 13.0079310915298, 13.9109148491728, 14.91427845109, 
14.2471448638515, 12.0097915288446, 9.88160631586071, 13.9443964208719, 
12.2941454195615, 12.8111133997799, 11.0662789135551, 12.831340157837, 
13.241061572146, 12.5619037964969, 11.4680021360569, 13.1535323663011, 
11.0844741478644, 12.523323392693, 12.9506056207337, 15.6933215496226, 
13.2048136961011, 13.1591619896602, 12.1863657141165, 13.1996286583567, 
11.6091957344035, 13.4172655795229, 11.8434305303626, 11.7425870734588, 
11.0044352542632, 11.7055088012953, 11.710290863445, 11.3038366782901, 
13.1785204758586, 11.8741679104261, 12.9763000659422, 12.3972178441398, 
14.5179291997568, 12.9635465425443, 12.6271119206624, 11.0576961102058, 
11.8787257967096, 10.8798094024843, 11.6198851587545, 12.8964252564405, 
10.3016006718409, 10.9750585512238, 13.7501321617446, 18.4245518412833, 
15.9850244158717, 13.4299922729295, 13.6624123215302, 13.1845540484949, 
11.5987660558212, 14.5328914490838, 14.3319406384312, 13.9022197903926, 
14.1139849830593, 14.5957927004093, 14.2872570905459, 14.2976819922471, 
13.2768755835056, 13.1292532123939, 14.6967588209775, 13.2432054948477, 
12.709037850695, 12.4386667030719, 14.3554150344177, 12.8314934164207, 
12.35448384819, 12.8023936145326, 13.6961722860673, 12.8772864489937, 
12.8808232983573, 13.3034683425749, 13.6111729839729, 13.1186522827803, 
12.2638958125303, 12.5134533241607, 12.5679326288745, 12.3622300709946, 
11.9117945152592, 11.5891753664002, 13.6833233964185, 11.7185359298403, 
11.3001850919248, 14.5050990355044, 12.6035003430238, 12.8837504369215, 
12.4495609662662, 13.5092504357519, 11.2498524025944, 10.2887450729298, 
10.9539210618412, 11.7915433529751, 13.0054874805967, 10.5095066508794, 
10.5494893656263, 11.2447777700341, 11.3415263031901, 10.6931595606007, 
13.0520389219728, 12.4833881263177, 11.4679504729046, 10.8336234528844, 
13.2632650892095, 11.5536567069647, 11.3818860422138, 11.9192923609714
), .Dim = 130L)), class = c("tbl_df", "tbl", "data.frame"), row.names = c(NA, 
-130L))
$\endgroup$
2
  • 1
    $\begingroup$ There are myriad ways to compare distributions (or datasets) to each other. Could you tell us specifically what properties of these distributions you wish to compare? $\endgroup$ – whuber Feb 7 '20 at 20:14
  • $\begingroup$ i would say that the means and variance are likely the two most important properties, as the distribution of velocities is fairly normally distributed. As an aside I realized I was thinking way to hard about this. $\endgroup$ – Taylor Spaulding Feb 7 '20 at 20:34
0
$\begingroup$

I was thinking much too hard about this. 1. Code each cross of Species and movement direction as a single group. 2. Add group = "Velocity" to each line of the velocity vector 3. Each dataset now has a column of group and velocity 4. Combine the two datasets using bind_rows() 5. Run a Dunnett's test setting group "Velocity" as the control.

script:

velocities <- gate_ops_sum %>%
  select(velocity) %>%
  mutate(group = "Velocity")
fish <- density_plot %>%
  mutate(group = paste(Species,move_direction,sep = "-")) %>%
  select(group, velocity)

test <- bind_rows(velocities,fish)
test$group <- factor(test$group)

DunnettTest(test$velocity,test$group, control = "Velocity", conf.level = 0.95)

# Dunnett's test for comparing several treatments with a control :  
#    95% family-wise confidence level
#
#$Velocity
#                                                    diff     lwr.ci    upr.ci   pval    
#Catfish-EXIT-Velocity                       -1.022849071 -4.4285795 2.3828814 0.9701    
#Catfish-UNRESOLVED TRANSIT-Velocity         -1.244340053 -3.2545028 0.7658227 0.4786    
#Largemouth Bass-EXIT-Velocity                0.486980215 -0.2513055 1.2252659 0.4020    
#Largemouth Bass-UNRESOLVED TRANSIT-Velocity  2.793599086 -0.6121313 6.1993295 0.1708    
#Striped Bass-ENTRY-Velocity                  0.758305972  0.1198655 1.3967465 0.0105 *  
#Striped Bass-EXIT-Velocity                   0.009744701 -0.9004750 0.9199644 1.0000    
#Striped Bass-UNRESOLVED TRANSIT-Velocity     0.783889114 -0.1263306 1.6941089 0.1321    
#
#---
#Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
$\endgroup$
1
  • $\begingroup$ Can anyone explain to me why Striped Bass-Entry-Velocity which has a mean difference of ~0.76 has a pval of 0.0105... it literally makes no sense. $\endgroup$ – Taylor Spaulding Feb 7 '20 at 21:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.