SSD

Author

Anne

Some comments on the Nature Communications paper

I downloaded the data file and script from the net, and used the datafile corrected by Gilles.

Charging some library and importing the file

When you click the Render button a document will be generated that includes both content and the output of embedded code. You can embed code like this:

library(stringr)
library(dplyr)

Attachement du package : 'dplyr'
Les objets suivants sont masqués depuis 'package:stats':

    filter, lag
Les objets suivants sont masqués depuis 'package:base':

    intersect, setdiff, setequal, union
library(tidyr)
library(ggplot2)
library(plyr)
------------------------------------------------------------------------------
You have loaded plyr after dplyr - this is likely to cause problems.
If you need functions from both plyr and dplyr, please load plyr first, then dplyr:
library(plyr); library(dplyr)
------------------------------------------------------------------------------

Attachement du package : 'plyr'
Les objets suivants sont masqués depuis 'package:dplyr':

    arrange, count, desc, failwith, id, mutate, rename, summarise,
    summarize
library(visreg)
library('gridExtra')

Attachement du package : 'gridExtra'
L'objet suivant est masqué depuis 'package:dplyr':

    combine
library('dplyr')
library('tidyr')
library('viridis')
Le chargement a nécessité le package : viridisLite
library('KneeArrower')
library('see')
library(nlme)

Attachement du package : 'nlme'
L'objet suivant est masqué depuis 'package:dplyr':

    collapse
library(MASS)

Attachement du package : 'MASS'
L'objet suivant est masqué depuis 'package:dplyr':

    select
library(lme4)
Le chargement a nécessité le package : Matrix

Attachement du package : 'Matrix'
Les objets suivants sont masqués depuis 'package:tidyr':

    expand, pack, unpack

Attachement du package : 'lme4'
L'objet suivant est masqué depuis 'package:nlme':

    lmList
library(MuMIn)
library(corrplot)
corrplot 0.92 loaded
library(ade4)
library(see)

setwd("D:/Utilisateurs/alois/Documents/NatureCommunication") 
ssd<-read.csv('Tombak_etal_SSDinMammals_FullDataSet.csv')

Nigel’s work on the file

#----DATA PROCESSING & FILTERING-------------------------------------------------

#Read in data on sexual size dimorphism (SSD)
ssd<-read.csv('Tombak_etal_SSDinMammals_FullDataSet.csv')

ssd$Order<-as.factor(ssd$Order)


########### BY NIGEL ##########----DATA PROCESSING & FILTERING-----------------------------------

# cleaning some errors; various checks
ggplot(ssd, aes(log(massM), log(SDmassM))) + geom_point()

ggplot(ssd, aes(log(massF), log(SDmassF))) + geom_point()

ggplot(ssd, aes(log(massF),log(SDmassF/massF))) + geom_point()

ggplot(ssd, aes(log(massF),log(SDmassF/massF))) + geom_point() + facet_wrap(vars(Order))

# 2 outliers for Artiodactyla, too small body mass or two small CV
# outlier baird beaked whale
ssd[log(ssd$massF)>14,]
          Order    Family              Species   Scientific_Name    massM
59 Artiodactyla Ziphiidae Baird's beaked whale Berardius bairdii 11437600
    SDmassM    massF  SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F
59 362.4886 12703344 249.4056    1010        35    1045        31  66  22
   n_Mlength n_Flength
59        66        22
                                                                                                                                                                                                                                  Comments
59 Estimated weights from body lengths of individuals 15 yrs old or older, using a formula for estimating weight from body length reported in the same pub: W=(6.339 x 10^-6)L^3.081 (weight in kg and later converted to g, length in cm)
                                                                                                                                                                                                             Source
59 Kasuya, T. Giant beaked whales Berardius bairdii and B. arnuxii. in Encyclopedia of Marine Mammals (eds. Wursig, B., Perrin, W. F. & Thewissen, J. G. M. H.) 498\xd0500 (Elsevier Science and Technology, 2008).
ssd[ssd$Scientific_Name=="Berardius bairdii",]
          Order    Family              Species   Scientific_Name    massM
59 Artiodactyla Ziphiidae Baird's beaked whale Berardius bairdii 11437600
    SDmassM    massF  SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F
59 362.4886 12703344 249.4056    1010        35    1045        31  66  22
   n_Mlength n_Flength
59        66        22
                                                                                                                                                                                                                                  Comments
59 Estimated weights from body lengths of individuals 15 yrs old or older, using a formula for estimating weight from body length reported in the same pub: W=(6.339 x 10^-6)L^3.081 (weight in kg and later converted to g, length in cm)
                                                                                                                                                                                                             Source
59 Kasuya, T. Giant beaked whales Berardius bairdii and B. arnuxii. in Encyclopedia of Marine Mammals (eds. Wursig, B., Perrin, W. F. & Thewissen, J. G. M. H.) 498\xd0500 (Elsevier Science and Technology, 2008).
# no access to reference Elsevier, even if it is SE and not SD, too small SD
# 3 kg for average of 11 tons..., too small even if calculating SD
ssd[ssd$Scientific_Name=="Berardius bairdii","SDmassM"]*sqrt(ssd[ssd$Scientific_Name=="Berardius bairdii","n_M"]) # SD = SE*sqrt(n)
[1] 2944.872
# remove species
ssd <- subset(ssd, Scientific_Name!="Berardius bairdii")

# outlier/error for Artiodactyla, Spanish ibex, kg and not g
ssd[log(ssd$massM+ssd$massF)<8 &ssd$Order=="Artiodactyla",]
          Order  Family      Species Scientific_Name massM SDmassM massF
30 Artiodactyla Bovidae Spanish ibex Capra pyrenaica 50.39   11.94 31.27
   SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F n_Mlength n_Flength
30     5.2      NA        NA      NA        NA  73 123        NA        NA
   Comments
30         
                                                                                                                                                                                                      Source
30 Granados, J. E., Perez, J. M., Soriguer, R. C., Fandos, P. & Ruiz-Martinez, I. On the biometry of the Spanish ibex, Capra pyrenaica, from Sierra Nevada (southern Spain). Folia Zool. 46, 9\xd014 (1997).
ssd[ssd$Scientific_Name=="Capra pyrenaica",]
          Order  Family      Species Scientific_Name massM SDmassM massF
30 Artiodactyla Bovidae Spanish ibex Capra pyrenaica 50.39   11.94 31.27
   SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F n_Mlength n_Flength
30     5.2      NA        NA      NA        NA  73 123        NA        NA
   Comments
30         
                                                                                                                                                                                                      Source
30 Granados, J. E., Perez, J. M., Soriguer, R. C., Fandos, P. & Ruiz-Martinez, I. On the biometry of the Spanish ibex, Capra pyrenaica, from Sierra Nevada (southern Spain). Folia Zool. 46, 9\xd014 (1997).
# multiplying mean and SD by 1000 (kg -> g)
ssd[ssd$Scientific_Name=="Capra pyrenaica",c("massM","SDmassM","massF","SDmassF")] <- 1000*ssd[ssd$Scientific_Name=="Capra pyrenaica",c("massM","SDmassM","massF","SDmassF")]
ssd[ssd$Scientific_Name=="Capra pyrenaica",]
          Order  Family      Species Scientific_Name massM SDmassM massF
30 Artiodactyla Bovidae Spanish ibex Capra pyrenaica 50390   11940 31270
   SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F n_Mlength n_Flength
30    5200      NA        NA      NA        NA  73 123        NA        NA
   Comments
30         
                                                                                                                                                                                                      Source
30 Granados, J. E., Perez, J. M., Soriguer, R. C., Fandos, P. & Ruiz-Martinez, I. On the biometry of the Spanish ibex, Capra pyrenaica, from Sierra Nevada (southern Spain). Folia Zool. 46, 9\xd014 (1997).
ggplot(ssd, aes(log(massF),log(SDmassF/massF))) + geom_point() + facet_wrap(vars(Order))

# still two Artiodactyla with very small CVs
subset(ssd, Order=="Artiodactyla" & log(SDmassF/massF) < (-3.2))
          Order      Family         Species        Scientific_Name  massM
27 Artiodactyla     Bovidae       Springbok Antidorcas marsupialis  32460
49 Artiodactyla Delphinidae Risso's dolphin        Grampus griseus 470000
   SDmassM  massF SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F n_Mlength
27    1150  27850     400      NA        NA      NA        NA  13  24        NA
49   31225 290333    5508      NA        NA      NA        NA   3   3        NA
   n_Flength
27        NA
49        NA
                                                                                                                        Comments
27 Used the live weight of adult springbok harvested from Rustfontein Dam Nature Reserve, which yielded the highest sample sizes
49     Calculated from the raw data (had to exclude a lot of rows because immature individuals or lactating females were there).
                                                                                                                                                                                               Source
27                                                                           Kroucamp, M. Meat quality characteristics of the springbok (Antidorcas marsupialis). (University of Stellenbosch, 2004).
49 Bloch, D., Desportes, G., Harvey, P., Lockyer, C. & Mikkelsen, B. Life history of Risso\xd5s dolphin (Grampus griseus) (G. Cuvier, 1812) in the Faroe Islands. Aquat. Mamm. 38, 250\xd0266 (2012).
# for Antidorcas marsupialis Kroucamp does not mention if it is SE or SD, but given the values and figures most likely SE
# to confirm this the SD for the other study (van Zyl) are in the same magnitude if recalculating SD
ssd[ssd$Scientific_Name=="Antidorcas marsupialis" & ssd$SDmassF < 1000,"SDmassM"]<-
   ssd[ssd$Scientific_Name=="Antidorcas marsupialis" & ssd$SDmassF < 1000,"SDmassM"]*
  sqrt(ssd[ssd$Scientific_Name=="Antidorcas marsupialis" & ssd$SDmassF < 1000,"n_M"])
ssd[ssd$Scientific_Name=="Antidorcas marsupialis" & ssd$SDmassF < 1000,"SDmassF"]<-
   ssd[ssd$Scientific_Name=="Antidorcas marsupialis" & ssd$SDmassF < 1000,"SDmassF"]*
  sqrt(ssd[ssd$Scientific_Name=="Antidorcas marsupialis"& ssd$SDmassF < 1000,"n_F"])
ssd[ssd$Scientific_Name=="Antidorcas marsupialis",]
          Order  Family   Species        Scientific_Name massM   SDmassM massF
27 Artiodactyla Bovidae Springbok Antidorcas marsupialis 32460  4146.384 27850
28 Artiodactyla Bovidae Springbok Antidorcas marsupialis 33700 10285.913 27100
    SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F n_Mlength n_Flength
27 1959.592      NA        NA      NA        NA  13  24        NA        NA
28 4330.127      NA        NA      NA        NA   5   3        NA        NA
                                                                                                                        Comments
27 Used the live weight of adult springbok harvested from Rustfontein Dam Nature Reserve, which yielded the highest sample sizes
28                                                                                                                              
                                                                                                                                                                                                                           Source
27                                                                                                       Kroucamp, M. Meat quality characteristics of the springbok (Antidorcas marsupialis). (University of Stellenbosch, 2004).
28 Van Zyl, L. & Ferreira, A. V. Physical and chemical carcass composition of springbok (Antidorcas marsupialis), blesbok (Damaliscus dorcas phillipsi) and impala (Aepyceros melampus). Small Rumin. Res. 53, 103\xd0109 (2004).
ssd[ssd$Scientific_Name=="Grampus griseus",]
          Order      Family         Species Scientific_Name  massM SDmassM
49 Artiodactyla Delphinidae Risso's dolphin Grampus griseus 470000   31225
    massF SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F n_Mlength
49 290333    5508      NA        NA      NA        NA   3   3        NA
   n_Flength
49        NA
                                                                                                                    Comments
49 Calculated from the raw data (had to exclude a lot of rows because immature individuals or lactating females were there).
                                                                                                                                                                                               Source
49 Bloch, D., Desportes, G., Harvey, P., Lockyer, C. & Mikkelsen, B. Life history of Risso\xd5s dolphin (Grampus griseus) (G. Cuvier, 1812) in the Faroe Islands. Aquat. Mamm. 38, 250\xd0266 (2012).
# could not find in the reference Bloch et al the corresponding numbers, remove the species
ssd <- subset(ssd, Scientific_Name!="Grampus griseus")

subset(ssd, Order=="Perissodactyla" & log(SDmassF/massF) < (-3.2))
             Order    Family              Species    Scientific_Name  massM
377 Perissodactyla Tapiridae South American tapir Tapirus terrestris 220250
     SDmassM  massF  SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F
377 1707.825 219500 707.1068      NA        NA      NA        NA   4   2
    n_Mlength n_Flength Comments
377        NA        NA         
                                                                                                                                                            Source
377 Gon\x8dalves, F. et al. Atlantic Mammal Traits: a data set of morphological traits of mammals in the Atlantic Forest of South America. Ecology 99, 498 (2018).
# Values for American tapir in Gondalves are indeed for F 219 and 220kg, for males 218,220,221, and 222 kg, hard to believe
ssd <- subset(ssd, Scientific_Name!="Tapirus terrestris")

# 2 outliers for Chiroptera
subset(ssd, log(SDmassF/massF) < (-6))
         Order       Family                  Species            Scientific_Name
191 Chiroptera Pteropodidae Mindanao pygmy fruit bat  Alionycteris paucidentata
200 Chiroptera Pteropodidae          Harpy fruit bat Harpyionycteris whiteheadi
    massM SDmassM massF SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F
191    15     1.2    15       0     4.6      0.18     4.8      0.12  12   2
200   110     7.0   105       0     8.6      0.29     8.5      0.28   9   2
    n_Mlength n_Flength
191        16         8
200         6         6
                                                                                                                                             Comments
191                       Only 2 of the captured females were not pregnant so these were the only females included here, each of which weighed 15.0g.
200 Forearm length used for body length. Used mass data from only non-pregnant adult females, of which there were only 2, each of which weighed 105g.
                                                                                                                                                                                 Source
191                      Bergallo, H. de G. Ecology of a small mammal community in an Atlantic Forest Area in Southeastern Brazil. Stud. Neotrop. Fauna Environ. 29, 197\xd0217 (1994).
200 Heaney, L. R., Tabaranza, B. R., Rickart, E. A., Balete, D. S. & Ingle, N. R. The mammals of Mt. Kitanglad Nature Park, Mindanao, Philippines. Fieldiana Zool. 112, 1\xd063 (2006).
# wrong reference for Alionycteris paucidentata, not Bergallo but Heaney, same as Harpyionycteris whiteheadi
# SDmassF written as 0, 2 females captured with same weight... checked paper, correct, no change

ggplot(ssd, aes(log(SDmassF), log(SDlengthF))) + geom_point() + facet_wrap(vars(Order))
Warning: Removed 399 rows containing missing values or values outside the scale range
(`geom_point()`).

subset(ssd, Order!="Chiroptera" & log(ssd$SDlengthF) < (-2))
              Order      Family                  Species
299 Didelphimorphia Didelphidae        Monodelphis macae
344    Eulipotyphla   Soricidae             Common shrew
347    Eulipotyphla   Soricidae              Pygmy shrew
374 Peramelemorphia Peramelidae Eastern barred bandicoot
689      Scandentia   Tupaiidae      Northern tree shrew
               Scientific_Name   massM  SDmassM  massF SDmassF lengthM
299          Monodelphis macae   14.80 4.604346  11.50 2.12132   9.100
344              Sorex araneus    7.67 0.100000   7.45 0.10000   6.486
347              Sorex minutus    3.00 0.060000   3.01 0.10000   4.837
374           Perameles gunnii 1049.50 8.000000 954.70 9.20000   9.660
689 Tupaia belangeri chinensis  133.71 0.540000 124.39 0.50000  18.860
    SDlengthM lengthF SDlengthF n_M n_F n_Mlength n_Flength
299     0.962   9.050     0.071   5   2         5         2
344     0.034   6.531     0.037 147 113       147       113
347     0.045   4.953     0.051  62  39        62        39
374     0.030   9.700     0.030 396 403       396       403
689     0.090  18.340     0.070 454 538       454       538
                                                                                                                                                                          Comments
299                                                                                                                                                                               
344                                                                                                         SDmass converted from SE. The sample did not include pregnant females.
347                                                                                                         SDmass converted from SE. The sample did not include pregnant females.
374       Body length = head length (also report tarsus length, ear length, and pes length - this was noted to be significantly longer in males than females but not head length).
689 Half were bred in captivity and half were captured and kept in captivity for four months but there was no difference in body weight between these groups so data are combined.
                                                                                                                                                                                                           Source
299                                                Gon\x8dalves, F. et al. Atlantic Mammal Traits: a data set of morphological traits of mammals in the Atlantic Forest of South America. Ecology 99, 498 (2018).
344                                                                          Bal_iauskas, L. Sex- and age-related differences in tooth row length of small mammals: Shrews. Acta Zool. Litu. 14, 41\xd047 (2004).
347                                                                          Bal_iauskas, L. Sex- and age-related differences in tooth row length of small mammals: Shrews. Acta Zool. Litu. 14, 41\xd047 (2004).
374                   Mallick, S. A., Driessen, M. M. & Hocking, G. J. Demography and home range of the eastern barred bandicoot (Perameles gunnii) in south-eastern Tasmania. Wildl. Res. 27, 103\xd0115 (2000).
689 Wu, X. et al. Relationships between body weight, fasting blood glucose concentration, sex and age in tree shrews (Tupaia belangeri chinensis). J. Anim. Physiol. Anim. Nutr. (Berl). 97, 1179\xd01188 (2013).
# four species  Sorex araneus (1 study), Sorex minutus, Monodelphis macae, Perameles gunnii, Tupia belangeri chinensis
ssd[ssd$Scientific_Name=="Sorex araneus",]
           Order    Family      Species Scientific_Name massM  SDmassM massF
344 Eulipotyphla Soricidae Common shrew   Sorex araneus  7.67 0.100000  7.45
345 Eulipotyphla Soricidae Common shrew   Sorex araneus 11.70 1.053269 12.27
     SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F n_Mlength n_Flength
344 0.100000   6.486     0.034   6.531     0.037 147 113       147       113
345 1.743865      NA        NA      NA        NA  71  26        NA        NA
                                                                  Comments
344 SDmass converted from SE. The sample did not include pregnant females.
345                                                   Converted SEs to SDs
                                                                                                                                                                  Source
344                                 Bal_iauskas, L. Sex- and age-related differences in tooth row length of small mammals: Shrews. Acta Zool. Litu. 14, 41\xd047 (2004).
345 Pankakoski, E. & T\x8ahk\x8a, K. M. Relation of adrenal weight to sex, maturity and season in five species of small mammals. Ann. Zool. Fenn. 19, 225\xd0232 (1982).
ssd[ssd$Scientific_Name=="Sorex minutus",] # same problem
           Order    Family     Species Scientific_Name massM   SDmassM massF
347 Eulipotyphla Soricidae Pygmy shrew   Sorex minutus  3.00 0.0600000  3.01
348 Eulipotyphla Soricidae Pygmy shrew   Sorex minutus  4.39 0.2573869  4.92
      SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F n_Mlength n_Flength
347 0.1000000   4.837     0.045   4.953     0.051  62  39        62        39
348 0.9234961      NA        NA      NA        NA   8   5        NA        NA
                                                                  Comments
347 SDmass converted from SE. The sample did not include pregnant females.
348                                                   Converted SEs to SDs
                                                                                                                                                                  Source
347                                 Bal_iauskas, L. Sex- and age-related differences in tooth row length of small mammals: Shrews. Acta Zool. Litu. 14, 41\xd047 (2004).
348 Pankakoski, E. & T\x8ahk\x8a, K. M. Relation of adrenal weight to sex, maturity and season in five species of small mammals. Ann. Zool. Fenn. 19, 225\xd0232 (1982).
# for the study of BALÈIAUSKAS she used SE not SD... cf table 3 p 43, both Sorex araneus and minutus
# Sorex araneus
# Mass first
ssd[ssd$Scientific_Name=="Sorex araneus" & ssd$SDmassF < 0.2,"SDmassM"]<-
  ssd[ssd$Scientific_Name=="Sorex araneus" & ssd$SDmassF < 0.2,"SDmassM"]*
  sqrt(ssd[ssd$Scientific_Name=="Sorex araneus" & ssd$SDmassF < 0.2,"n_M"])
ssd[ssd$Scientific_Name=="Sorex araneus" & ssd$SDmassF < 0.2,"SDmassF"]<-
  ssd[ssd$Scientific_Name=="Sorex araneus" & ssd$SDmassF < 0.2,"SDmassF"]*
  sqrt(ssd[ssd$Scientific_Name=="Sorex araneus"& ssd$SDmassF < 0.2,"n_F"])
# then length
ssd[ssd$Scientific_Name=="Sorex araneus" & !is.na(ssd$SDlengthM),"SDlengthM"]<-
  ssd[ssd$Scientific_Name=="Sorex araneus" & !is.na(ssd$SDlengthM),"SDlengthM"]*
  sqrt(ssd[ssd$Scientific_Name=="Sorex araneus" & !is.na(ssd$SDlengthM),"n_Mlength"])
ssd[ssd$Scientific_Name=="Sorex araneus" & !is.na(ssd$SDlengthF),"SDlengthF"]<-
  ssd[ssd$Scientific_Name=="Sorex araneus" & !is.na(ssd$SDlengthF),"SDlengthF"]*
  sqrt(ssd[ssd$Scientific_Name=="Sorex araneus"& !is.na(ssd$SDlengthF),"n_Flength"])
ssd[ssd$Scientific_Name=="Sorex araneus",]
           Order    Family      Species Scientific_Name massM  SDmassM massF
344 Eulipotyphla Soricidae Common shrew   Sorex araneus  7.67 1.212436  7.45
345 Eulipotyphla Soricidae Common shrew   Sorex araneus 11.70 1.053269 12.27
     SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F n_Mlength n_Flength
344 1.063015   6.486 0.4122281   6.531 0.3933154 147 113       147       113
345 1.743865      NA        NA      NA        NA  71  26        NA        NA
                                                                  Comments
344 SDmass converted from SE. The sample did not include pregnant females.
345                                                   Converted SEs to SDs
                                                                                                                                                                  Source
344                                 Bal_iauskas, L. Sex- and age-related differences in tooth row length of small mammals: Shrews. Acta Zool. Litu. 14, 41\xd047 (2004).
345 Pankakoski, E. & T\x8ahk\x8a, K. M. Relation of adrenal weight to sex, maturity and season in five species of small mammals. Ann. Zool. Fenn. 19, 225\xd0232 (1982).
# Sorex minutus
ssd[ssd$Scientific_Name=="Sorex minutus" & ssd$SDmassF < 0.2,"SDmassM"]<-
  ssd[ssd$Scientific_Name=="Sorex minutus" & ssd$SDmassF < 0.2,"SDmassM"]*
  sqrt(ssd[ssd$Scientific_Name=="Sorex minutus" & ssd$SDmassF < 0.2,"n_M"])
ssd[ssd$Scientific_Name=="Sorex minutus" & ssd$SDmassF < 0.2,"SDmassF"]<-
  ssd[ssd$Scientific_Name=="Sorex minutus" & ssd$SDmassF < 0.2,"SDmassF"]*
  sqrt(ssd[ssd$Scientific_Name=="Sorex minutus"& ssd$SDmassF < 0.2,"n_F"])
# then length
ssd[ssd$Scientific_Name=="Sorex minutus" & !is.na(ssd$SDlengthM),"SDlengthM"]<-
  ssd[ssd$Scientific_Name=="Sorex minutus" & !is.na(ssd$SDlengthM),"SDlengthM"]*
  sqrt(ssd[ssd$Scientific_Name=="Sorex minutus" & !is.na(ssd$SDlengthM),"n_Mlength"])
ssd[ssd$Scientific_Name=="Sorex minutus" & !is.na(ssd$SDlengthF),"SDlengthF"]<-
  ssd[ssd$Scientific_Name=="Sorex minutus" & !is.na(ssd$SDlengthF),"SDlengthF"]*
  sqrt(ssd[ssd$Scientific_Name=="Sorex minutus"& !is.na(ssd$SDlengthF),"n_Flength"])
ssd[ssd$Scientific_Name=="Sorex minutus",]
           Order    Family     Species Scientific_Name massM   SDmassM massF
347 Eulipotyphla Soricidae Pygmy shrew   Sorex minutus  3.00 0.4724405  3.01
348 Eulipotyphla Soricidae Pygmy shrew   Sorex minutus  4.39 0.2573869  4.92
      SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F n_Mlength n_Flength
347 0.6244998   4.837 0.3543304   4.953 0.3184949  62  39        62        39
348 0.9234961      NA        NA      NA        NA   8   5        NA        NA
                                                                  Comments
347 SDmass converted from SE. The sample did not include pregnant females.
348                                                   Converted SEs to SDs
                                                                                                                                                                  Source
347                                 Bal_iauskas, L. Sex- and age-related differences in tooth row length of small mammals: Shrews. Acta Zool. Litu. 14, 41\xd047 (2004).
348 Pankakoski, E. & T\x8ahk\x8a, K. M. Relation of adrenal weight to sex, maturity and season in five species of small mammals. Ann. Zool. Fenn. 19, 225\xd0232 (1982).
# Perameles gunnii (note that mean values for length are strange 9.7, google search gives 32 cm...)
ssd[ssd$Scientific_Name=="Perameles gunnii",]  # Most likely same problem, SD of 8 and 9.2 for a mass of 1000g!!
              Order      Family                  Species  Scientific_Name
374 Peramelemorphia Peramelidae Eastern barred bandicoot Perameles gunnii
     massM SDmassM massF SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F
374 1049.5       8 954.7     9.2    9.66      0.03     9.7      0.03 396 403
    n_Mlength n_Flength
374       396       403
                                                                                                                                                                    Comments
374 Body length = head length (also report tarsus length, ear length, and pes length - this was noted to be significantly longer in males than females but not head length).
                                                                                                                                                                                         Source
374 Mallick, S. A., Driessen, M. M. & Hocking, G. J. Demography and home range of the eastern barred bandicoot (Perameles gunnii) in south-eastern Tasmania. Wildl. Res. 27, 103\xd0115 (2000).
ssd[ssd$Scientific_Name=="Perameles gunnii","SDmassM"]<-
  ssd[ssd$Scientific_Name=="Perameles gunnii" ,"SDmassM"]*
  sqrt(ssd[ssd$Scientific_Name=="Perameles gunnii" ,"n_M"])
ssd[ssd$Scientific_Name=="Perameles gunnii" ,"SDmassF"]<-
  ssd[ssd$Scientific_Name=="Perameles gunnii" ,"SDmassF"]*
  sqrt(ssd[ssd$Scientific_Name=="Perameles gunnii","n_F"])
# then length
ssd[ssd$Scientific_Name=="Perameles gunnii" ,"SDlengthM"]<-
  ssd[ssd$Scientific_Name=="Perameles gunnii","SDlengthM"]*
  sqrt(ssd[ssd$Scientific_Name=="Perameles gunnii" ,"n_Mlength"])
ssd[ssd$Scientific_Name=="Perameles gunnii" ,"SDlengthF"]<-
  ssd[ssd$Scientific_Name=="Perameles gunnii","SDlengthF"]*
  sqrt(ssd[ssd$Scientific_Name=="Perameles gunnii","n_Flength"])
ssd[ssd$Scientific_Name=="Perameles gunnii",]
              Order      Family                  Species  Scientific_Name
374 Peramelemorphia Peramelidae Eastern barred bandicoot Perameles gunnii
     massM SDmassM massF  SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F
374 1049.5 159.198 954.7 184.6887    9.66 0.5969925     9.7 0.6022458 396 403
    n_Mlength n_Flength
374       396       403
                                                                                                                                                                    Comments
374 Body length = head length (also report tarsus length, ear length, and pes length - this was noted to be significantly longer in males than females but not head length).
                                                                                                                                                                                         Source
374 Mallick, S. A., Driessen, M. M. & Hocking, G. J. Demography and home range of the eastern barred bandicoot (Perameles gunnii) in south-eastern Tasmania. Wildl. Res. 27, 103\xd0115 (2000).
# Monodelphis macae
ssd[ssd$Scientific_Name=="Monodelphis macae",] # low SDlengthF but two females only
              Order      Family           Species   Scientific_Name massM
299 Didelphimorphia Didelphidae Monodelphis macae Monodelphis macae  14.8
     SDmassM massF SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F
299 4.604346  11.5 2.12132     9.1     0.962    9.05     0.071   5   2
    n_Mlength n_Flength Comments
299         5         2         
                                                                                                                                                            Source
299 Gon\x8dalves, F. et al. Atlantic Mammal Traits: a data set of morphological traits of mammals in the Atlantic Forest of South America. Ecology 99, 498 (2018).
# Tupia belangeri chinensis
ssd[ssd$Scientific_Name=="Tupaia belangeri chinensis",] # Values are SEM, not converted to SD
         Order    Family             Species            Scientific_Name  massM
689 Scandentia Tupaiidae Northern tree shrew Tupaia belangeri chinensis 133.71
    SDmassM  massF SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F
689    0.54 124.39     0.5   18.86      0.09   18.34      0.07 454 538
    n_Mlength n_Flength
689       454       538
                                                                                                                                                                          Comments
689 Half were bred in captivity and half were captured and kept in captivity for four months but there was no difference in body weight between these groups so data are combined.
                                                                                                                                                                                                           Source
689 Wu, X. et al. Relationships between body weight, fasting blood glucose concentration, sex and age in tree shrews (Tupaia belangeri chinensis). J. Anim. Physiol. Anim. Nutr. (Berl). 97, 1179\xd01188 (2013).
ssd[ssd$Scientific_Name=="Tupaia belangeri chinensis","SDmassM"]<-
  ssd[ssd$Scientific_Name=="Tupaia belangeri chinensis" ,"SDmassM"]*
  sqrt(ssd[ssd$Scientific_Name=="Tupaia belangeri chinensis" ,"n_M"])
ssd[ssd$Scientific_Name=="Tupaia belangeri chinensis" ,"SDmassF"]<-
  ssd[ssd$Scientific_Name=="Tupaia belangeri chinensis" ,"SDmassF"]*
  sqrt(ssd[ssd$Scientific_Name=="Tupaia belangeri chinensis","n_F"])
# then length
ssd[ssd$Scientific_Name=="Tupaia belangeri chinensis" ,"SDlengthM"]<-
  ssd[ssd$Scientific_Name=="Tupaia belangeri chinensis","SDlengthM"]*
  sqrt(ssd[ssd$Scientific_Name=="Tupaia belangeri chinensis" ,"n_Mlength"])
ssd[ssd$Scientific_Name=="Tupaia belangeri chinensis" ,"SDlengthF"]<-
  ssd[ssd$Scientific_Name=="Tupaia belangeri chinensis","SDlengthF"]*
  sqrt(ssd[ssd$Scientific_Name=="Tupaia belangeri chinensis","n_Flength"])
ssd[ssd$Scientific_Name=="Tupaia belangeri chinensis",]
         Order    Family             Species            Scientific_Name  massM
689 Scandentia Tupaiidae Northern tree shrew Tupaia belangeri chinensis 133.71
     SDmassM  massF  SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F
689 11.50593 124.39 11.59741   18.86  1.917655   18.34  1.623638 454 538
    n_Mlength n_Flength
689       454       538
                                                                                                                                                                          Comments
689 Half were bred in captivity and half were captured and kept in captivity for four months but there was no difference in body weight between these groups so data are combined.
                                                                                                                                                                                                           Source
689 Wu, X. et al. Relationships between body weight, fasting blood glucose concentration, sex and age in tree shrews (Tupaia belangeri chinensis). J. Anim. Physiol. Anim. Nutr. (Berl). 97, 1179\xd01188 (2013).
# Pteropus poliocephalus
ssd[ssd$Scientific_Name=="Pteropus poliocephalus",]  # same problem she used SE not SD, cf Welbergen 2010
         Order       Family                Species        Scientific_Name massM
205 Chiroptera Pteropodidae Gray-headed flying fox Pteropus poliocephalus   842
    SDmassM massF SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F n_Mlength
205      11   675     9.7    16.5      0.04    16.2      0.05  87  73        87
    n_Flength
205        73
                                                                                                                                                                                                   Comments
205 Body masses MAY include breeding season (collected February through July)! However, body mass curves show that males are always larger than females, although sexual size dimorphism is lowest in June.
                                                                                                                                                          Source
205 Welbergen, J. A. Growth, bimaturation, and sexual size dimorphism in wild gray-headed flying foxes (Pteropus poliocephalus). J. Mammal. 91, 38\xd047 (2010).
ssd[ssd$Scientific_Name=="Pteropus poliocephalus","SDmassM"]<-
  ssd[ssd$Scientific_Name=="Pteropus poliocephalus","SDmassM"]*sqrt(ssd[ssd$Scientific_Name=="Pteropus poliocephalus","n_M"])
ssd[ssd$Scientific_Name=="Pteropus poliocephalus","SDmassF"]<-
  ssd[ssd$Scientific_Name=="Pteropus poliocephalus","SDmassF"]*sqrt(ssd[ssd$Scientific_Name=="Pteropus poliocephalus","n_F"])
ssd[ssd$Scientific_Name=="Pteropus poliocephalus","SDlengthM"]<-
  ssd[ssd$Scientific_Name=="Pteropus poliocephalus","SDlengthM"]*sqrt(ssd[ssd$Scientific_Name=="Pteropus poliocephalus","n_Mlength"])
ssd[ssd$Scientific_Name=="Pteropus poliocephalus","SDlengthF"]<-
  ssd[ssd$Scientific_Name=="Pteropus poliocephalus","SDlengthF"]*sqrt(ssd[ssd$Scientific_Name=="Pteropus poliocephalus","n_Flength"])
ssd[ssd$Scientific_Name=="Pteropus poliocephalus",]
         Order       Family                Species        Scientific_Name massM
205 Chiroptera Pteropodidae Gray-headed flying fox Pteropus poliocephalus   842
     SDmassM massF  SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F
205 102.6012   675 82.87684    16.5 0.3730952    16.2 0.4272002  87  73
    n_Mlength n_Flength
205        87        73
                                                                                                                                                                                                   Comments
205 Body masses MAY include breeding season (collected February through July)! However, body mass curves show that males are always larger than females, although sexual size dimorphism is lowest in June.
                                                                                                                                                          Source
205 Welbergen, J. A. Growth, bimaturation, and sexual size dimorphism in wild gray-headed flying foxes (Pteropus poliocephalus). J. Mammal. 91, 38\xd047 (2010).
ggplot(ssd, aes(log(massF), log(SDmassF))) + geom_point() + facet_wrap(vars(Order))

subset(ssd, Order=="Scandentia")
         Order    Family             Species            Scientific_Name  massM
689 Scandentia Tupaiidae Northern tree shrew Tupaia belangeri chinensis 133.71
690 Scandentia Tupaiidae    Common treeshrew                Tupaia glis 179.00
691 Scandentia Tupaiidae     Large treeshrew                Tupaia tana 213.00
     SDmassM  massF  SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F
689 11.50593 124.39 11.59741   18.86  1.917655   18.34  1.623638 454 538
690 13.53000 176.50 17.68000      NA        NA      NA        NA   3   2
691  4.90000 215.00  3.50000      NA        NA      NA        NA  12  10
    n_Mlength n_Flength
689       454       538
690        NA        NA
691        NA        NA
                                                                                                                                                                          Comments
689 Half were bred in captivity and half were captured and kept in captivity for four months but there was no difference in body weight between these groups so data are combined.
690                                                                                                                                                                               
691   Used values from the non-masting period 2002-2004 from the primary forest population, since females have been noted to increase in body condition during the masting period.
                                                                                                                                                                                                                                                              Source
689                                                    Wu, X. et al. Relationships between body weight, fasting blood glucose concentration, sex and age in tree shrews (Tupaia belangeri chinensis). J. Anim. Physiol. Anim. Nutr. (Berl). 97, 1179\xd01188 (2013).
690 Mariana, A., Shukor, M. N., Muhd, N. H., Intan, N. B. & Ho, T. M. Movements and home range of a common species of tree-shrew, Tupaia glis, surrounding houses of otoacariasis cases in Kuantan, Pahang, Malaysia. Asian Pac. J. Trop. Med. 3, 427\xd0434 (2010).
691                                                                                                                     Munshi-South, J. Asocial monogamy, extra-pair paternity, and dispersal in the large treeshrew (Tupaia tana). (University of Maryland, 2006).
# Tupaia tana; Used values from the non-masting period 2002-2004; SE not converted; thesis Maryland
ssd[ssd$Scientific_Name=="Tupaia tana","SDmassM"]<-
  ssd[ssd$Scientific_Name=="Tupaia tana","SDmassM"]*sqrt(ssd[ssd$Scientific_Name=="Tupaia tana","n_M"])
ssd[ssd$Scientific_Name=="Tupaia tana","SDmassF"]<-
  ssd[ssd$Scientific_Name=="Tupaia tana","SDmassF"]*sqrt(ssd[ssd$Scientific_Name=="Tupaia tana","n_F"])
subset(ssd, Order=="Scandentia") # fit with other species same order
         Order    Family             Species            Scientific_Name  massM
689 Scandentia Tupaiidae Northern tree shrew Tupaia belangeri chinensis 133.71
690 Scandentia Tupaiidae    Common treeshrew                Tupaia glis 179.00
691 Scandentia Tupaiidae     Large treeshrew                Tupaia tana 213.00
     SDmassM  massF  SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F
689 11.50593 124.39 11.59741   18.86  1.917655   18.34  1.623638 454 538
690 13.53000 176.50 17.68000      NA        NA      NA        NA   3   2
691 16.97410 215.00 11.06797      NA        NA      NA        NA  12  10
    n_Mlength n_Flength
689       454       538
690        NA        NA
691        NA        NA
                                                                                                                                                                          Comments
689 Half were bred in captivity and half were captured and kept in captivity for four months but there was no difference in body weight between these groups so data are combined.
690                                                                                                                                                                               
691   Used values from the non-masting period 2002-2004 from the primary forest population, since females have been noted to increase in body condition during the masting period.
                                                                                                                                                                                                                                                              Source
689                                                    Wu, X. et al. Relationships between body weight, fasting blood glucose concentration, sex and age in tree shrews (Tupaia belangeri chinensis). J. Anim. Physiol. Anim. Nutr. (Berl). 97, 1179\xd01188 (2013).
690 Mariana, A., Shukor, M. N., Muhd, N. H., Intan, N. B. & Ho, T. M. Movements and home range of a common species of tree-shrew, Tupaia glis, surrounding houses of otoacariasis cases in Kuantan, Pahang, Malaysia. Asian Pac. J. Trop. Med. 3, 427\xd0434 (2010).
691                                                                                                                     Munshi-South, J. Asocial monogamy, extra-pair paternity, and dispersal in the large treeshrew (Tupaia tana). (University of Maryland, 2006).
subset(ssd, Order=="Rodentia" & log(SDmassF)<0)
       Order     Family                     Species      Scientific_Name
499 Rodentia Cricetidae            Chilomys instans     Chilomys instans
602 Rodentia    Muridae         Arabian spiny mouse    Acomys dimidiatus
605 Rodentia    Muridae        Wilson's spiny mouse       Acomys wilsoni
632 Rodentia    Muridae Typical striped grass mouse Lemniscomys striatus
       massM  SDmassM    massF   SDmassF lengthM SDlengthM lengthF SDlengthF
499 18.57143 3.154739 15.66667 0.5773503      NA        NA      NA        NA
602 35.70000 1.000000 36.40000 0.7000000      NA        NA      NA        NA
605 29.30000 2.500000 31.70000 0.5000000      NA        NA      NA        NA
632  7.70000 0.700000  6.90000 0.6000000      NA        NA      NA        NA
    n_M n_F n_Mlength n_Flength
499   7   3        NA        NA
602  73  63        NA        NA
605   9   3        NA        NA
632  45  36        NA        NA
                                                                                                                                                                                                                                     Comments
499                                                                                                                                                                                                                                          
602 This study didn't find a significant difference in body weight between the sexes but males were significantly larger than females in winter (pregnancies observed from spring to autumn but only a total of 7 pregnant females captured).
605                                                                                                                                                                                                                                          
632                                         Used data from age class II (an age class within the range of sexual maturity and with the highest sample size). These are dry weights of carcasess after gut, liver and any embryos are removed.
                                                                                                                                                                                                                                                                  Source
499                                                                                                                                                       Ocampo, D. et al. Body mass data set for 1,317 bird and 270 mammal species from Colombia. Ecology 102, (2021).
602 Sarli, J., Luterman, H., Alagaili, A. N., Mohammed, O. B. & Bennett, N. C. Seasonal reproduction in the Arabian spiny mouse, Acomys dimidiatus (Rodentia: Muridae) from Saudi Arabia: The role of rainfall and temperature. J. Arid Environ. 124, 352\xd0359 (2016).
605                                                                                                                                             Canova, L. & Fasola, M. Small rodents along a ground-cover gradient in coastal Kenya. Trop. Zool. 13, 219\xd0226 (2000).
632                                                                                                                             Field, A. C. Seasonal changes in reproduction, diet and body composition of two equatorial rodents. Afr. J. Ecol. 13, 221\xd0235 (1975).
# Acomys dimidiatus; 35.70000 1.000000 36.40000 0.7000000; checked paper these are SE
ssd[ssd$Scientific_Name=="Acomys dimidiatus","SDmassM"]<-
  ssd[ssd$Scientific_Name=="Acomys dimidiatus","SDmassM"]*sqrt(ssd[ssd$Scientific_Name=="Acomys dimidiatus","n_M"])
ssd[ssd$Scientific_Name=="Acomys dimidiatus","SDmassF"]<-
  ssd[ssd$Scientific_Name=="Acomys dimidiatus","SDmassF"]*sqrt(ssd[ssd$Scientific_Name=="Acomys dimidiatus","n_F"])
ssd[ssd$Scientific_Name=="Acomys dimidiatus",]
       Order  Family             Species   Scientific_Name massM  SDmassM massF
602 Rodentia Muridae Arabian spiny mouse Acomys dimidiatus  35.7 8.544004  36.4
     SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F n_Mlength n_Flength
602 5.556078      NA        NA      NA        NA  73  63        NA        NA
                                                                                                                                                                                                                                     Comments
602 This study didn't find a significant difference in body weight between the sexes but males were significantly larger than females in winter (pregnancies observed from spring to autumn but only a total of 7 pregnant females captured).
                                                                                                                                                                                                                                                                  Source
602 Sarli, J., Luterman, H., Alagaili, A. N., Mohammed, O. B. & Bennett, N. C. Seasonal reproduction in the Arabian spiny mouse, Acomys dimidiatus (Rodentia: Muridae) from Saudi Arabia: The role of rainfall and temperature. J. Arid Environ. 124, 352\xd0359 (2016).
subset(ssd, Order=="Primates" & (SDmassF/massF) < 0.05)
       Order    Family           Species              Scientific_Name massM
435 Primates Galagidae Zanzibar bushbaby      Galagoides zanzibaricus   150
442 Primates Indriidae Verreaux's sifaka Propithecus verreauxi majori  3376
     SDmassM massF  SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F
435   6.4000   137  6.10000      NA        NA      NA        NA  35  38
442 401.6367  3389 74.95332      NA        NA      NA        NA   2   2
    n_Mlength n_Flength Comments
435        NA        NA         
442        NA        NA         
                                                                                                                           Source
435                      Smith, R. J. & Jungers, W. L. Body mass in comparative primatology. J. Hum. Evol. 32, 523\xd0559 (1997).
442 Kappeler, P. M. Patterns of sexual dimorphism in body weight among prosimian primates. Folia Primatol. 57, 132\xd0146 (1991).
# Galagoides zanzibaricus; values correct in Smith, checked original ref Harcourt 1986

g1 <- ggplot(ssd, aes(log(massM), log(SDmassM))) + geom_point()+geom_smooth(method="lm", se=F)
g2 <-ggplot(ssd, aes(log(massF), log(SDmassF))) + geom_point()+geom_smooth(method="lm", se=F)
grid.arrange(g1,g2,nrow=1)
`geom_smooth()` using formula = 'y ~ x'
Warning: Removed 3 rows containing non-finite outside the scale range
(`stat_smooth()`).
`geom_smooth()` using formula = 'y ~ x'
Warning: Removed 2 rows containing non-finite outside the scale range
(`stat_smooth()`).

subset(ssd, SDmassM==0)  # some species with SD=0
         Order         Family             Species      Scientific_Name massM
99  Chiroptera Emballonuridae Lesser dog-like bat  Peropteryx macrotis     6
103 Chiroptera   Furipteridae       Thumbless bat   Furipterus horrens     4
113 Chiroptera     Molossidae Dwarf dog-faced bat Molossops temminckii     6
    SDmassM    massF   SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F
99        0 5.560000 0.6066300   4.343    0.2110   4.606     0.092   4   5
103       0 4.000000 0.8164966   3.570    0.0580   3.708     0.079   3   4
113       0 6.333333 1.5275252   3.070    0.0141   3.077     0.164   2   3
    n_Mlength n_Flength Comments
99          4         5         
103         3         4         
113         2         3         
                                                                                                                                                            Source
99  Gon\x8dalves, F. et al. Atlantic Mammal Traits: a data set of morphological traits of mammals in the Atlantic Forest of South America. Ecology 99, 498 (2018).
103 Gon\x8dalves, F. et al. Atlantic Mammal Traits: a data set of morphological traits of mammals in the Atlantic Forest of South America. Ecology 99, 498 (2018).
113 Gon\x8dalves, F. et al. Atlantic Mammal Traits: a data set of morphological traits of mammals in the Atlantic Forest of South America. Ecology 99, 498 (2018).
# Using both regressions to identify outliers
ssd[abs(residuals(lm(log(massM)~log(SDmassM+0.01), data=ssd)))>2, ]  # adding 0.01 because some SD=0
           Order         Family              Species
32  Artiodactyla        Bovidae              Blesbok
99    Chiroptera Emballonuridae  Lesser dog-like bat
103   Chiroptera   Furipteridae        Thumbless bat
113   Chiroptera     Molossidae  Dwarf dog-faced bat
364   Lagomorpha    Ochotonidae         Plateau pika
685     Rodentia      Sciuridae Cape ground squirrel
                  Scientific_Name    massM SDmassM        massF      SDmassF
32  Damaliscus pygargus phillipsi 50400.00 1000.00 56200.000000 1.980000e+04
99            Peropteryx macrotis     6.00    0.00     5.560000 6.066300e-01
103            Furipterus horrens     4.00    0.00     4.000000 8.164966e-01
113          Molossops temminckii     6.00    0.00     6.333333 1.527525e+00
364            Ochotona curzoniae   152.49    1.59   149.170000 1.320000e+00
685                 Xerus inauris   601.50    6.10   550.000000 6.600000e+00
    lengthM SDlengthM lengthF SDlengthF n_M n_F n_Mlength n_Flength Comments
32       NA        NA      NA        NA   4   4        NA        NA         
99    4.343    0.2110   4.606     0.092   4   5         4         5         
103   3.570    0.0580   3.708     0.079   3   4         3         4         
113   3.070    0.0141   3.077     0.164   2   3         2         3         
364      NA        NA      NA        NA 147 140        NA        NA         
685      NA        NA      NA        NA  50  55        NA        NA         
                                                                                                                                                                                                                            Source
32  Van Zyl, L. & Ferreira, A. V. Physical and chemical carcass composition of springbok (Antidorcas marsupialis), blesbok (Damaliscus dorcas phillipsi) and impala (Aepyceros melampus). Small Rumin. Res. 53, 103\xd0109 (2004).
99                                                                  Gon\x8dalves, F. et al. Atlantic Mammal Traits: a data set of morphological traits of mammals in the Atlantic Forest of South America. Ecology 99, 498 (2018).
103                                                                 Gon\x8dalves, F. et al. Atlantic Mammal Traits: a data set of morphological traits of mammals in the Atlantic Forest of South America. Ecology 99, 498 (2018).
113                                                                 Gon\x8dalves, F. et al. Atlantic Mammal Traits: a data set of morphological traits of mammals in the Atlantic Forest of South America. Ecology 99, 498 (2018).
364                                                                   Nie, H., Liu, J. & Chen, B. Life-history traits and fitness of plateau pika (Ochotona curzoniae) in alpine meadow ecosystem. Ecol. Evol. 12, 1\xd017 (2022).
685                                                                                                         Waterman, J. M. Reproductive biology of a tropical, non-hibernating ground squirrel. J. Mammal. 77, 134\xd0146 (1996).
# Damaliscus pygargus phillipsi, Ochotona curzoniae, Xerus inauris  (# excluding the ones with SD=0)
ssd[abs(residuals(lm(log(SDmassM+0.01)~log(massM), data=ssd)))>2, ]  # adding 0.01 because some SD=0
            Order          Family                     Species
1    Afrosoricida Chrysochloridae       Hottentot golden mole
32   Artiodactyla         Bovidae                     Blesbok
81      Carnivora      Mustelidae                       Tayra
99     Chiroptera  Emballonuridae         Lesser dog-like bat
103    Chiroptera    Furipteridae               Thumbless bat
113    Chiroptera      Molossidae         Dwarf dog-faced bat
364    Lagomorpha     Ochotonidae                Plateau pika
368 Macroscelidea Macroscelididae Eastern rock elephant shrew
685      Rodentia       Sciuridae        Cape ground squirrel
                  Scientific_Name     massM    SDmassM        massF
1          Amblysomus hottentotus    80.600    1.24499    66.000000
32  Damaliscus pygargus phillipsi 50400.000 1000.00000 56200.000000
81                   Eira barbara  2775.625 3099.50902  4350.000000
99            Peropteryx macrotis     6.000    0.00000     5.560000
103            Furipterus horrens     4.000    0.00000     4.000000
113          Molossops temminckii     6.000    0.00000     6.333333
364            Ochotona curzoniae   152.490    1.59000   149.170000
368           Elephantulus myurus    51.740    0.88200    53.830000
685                 Xerus inauris   601.500    6.10000   550.000000
         SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F n_Mlength
1   8.637523e+00      NA        NA      NA        NA 155 148        NA
32  1.980000e+04      NA        NA      NA        NA   4   4        NA
81  2.121320e+02      NA        NA      NA        NA   6   2        NA
99  6.066300e-01   4.343    0.2110   4.606     0.092   4   5         4
103 8.164966e-01   3.570    0.0580   3.708     0.079   3   4         3
113 1.527525e+00   3.070    0.0141   3.077     0.164   2   3         2
364 1.320000e+00      NA        NA      NA        NA 147 140        NA
368 5.352831e+00      NA        NA      NA        NA  36  37        NA
685 6.600000e+00      NA        NA      NA        NA  50  55        NA
    n_Flength
1          NA
32         NA
81         NA
99          5
103         4
113         3
364        NA
368        NA
685        NA
                                                                                                                                                                                                                                                                                               Comments
1   SEs converted to SDs. Note that foetuses were detected in females throughout the year and only overall averages for the whole sampling period were reported, but males were so much larger than females that their relative sizes are unlikely to be much affected by foetuses so we kept the data.
32                                                                                                                                                                                                                                                                                                     
81                                                                                                                                                                                                                                                                                                     
99                                                                                                                                                                                                                                                                                                     
103                                                                                                                                                                                                                                                                                                    
113                                                                                                                                                                                                                                                                                                    
364                                                                                                                                                                                                                                                                                                    
368                                                                                                                              Combined age classes 5 and 6 (all above age class 3 are sexually mature). Used Baker and Nissin's (1963, Nature) equation to calculate new SEs for the combined means.
685                                                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                            Source
1               Schoeman, S., Bennett, N. C., van der Merwe, M. & Schoeman, A. S. Aseasonal reproduction in the Hottentot golden mole, Amblysomus hottentotus (Afrosoricida: Chrysochloridae) from KwaZulu-Natal, South Africa. African Zool. 39, 41\xd046 (2004).
32                                  Van Zyl, L. & Ferreira, A. V. Physical and chemical carcass composition of springbok (Antidorcas marsupialis), blesbok (Damaliscus dorcas phillipsi) and impala (Aepyceros melampus). Small Rumin. Res. 53, 103\xd0109 (2004).
81                                                                                                  Gon\x8dalves, F. et al. Atlantic Mammal Traits: a data set of morphological traits of mammals in the Atlantic Forest of South America. Ecology 99, 498 (2018).
99                                                                                                  Gon\x8dalves, F. et al. Atlantic Mammal Traits: a data set of morphological traits of mammals in the Atlantic Forest of South America. Ecology 99, 498 (2018).
103                                                                                                 Gon\x8dalves, F. et al. Atlantic Mammal Traits: a data set of morphological traits of mammals in the Atlantic Forest of South America. Ecology 99, 498 (2018).
113                                                                                                 Gon\x8dalves, F. et al. Atlantic Mammal Traits: a data set of morphological traits of mammals in the Atlantic Forest of South America. Ecology 99, 498 (2018).
364                                                                                                   Nie, H., Liu, J. & Chen, B. Life-history traits and fitness of plateau pika (Ochotona curzoniae) in alpine meadow ecosystem. Ecol. Evol. 12, 1\xd017 (2022).
368 Medger, K. The reproductive biology of two small southern African mammals, the spiny mouse, Acomys spinosissimus (Rodentia: Muridae) and the Eastern rock elephant-shrew, Elephantulus myurus (Macrosclidea: Macroscelididae). (University of Pretoria, 2011).
685                                                                                                                                         Waterman, J. M. Reproductive biology of a tropical, non-hibernating ground squirrel. J. Mammal. 77, 134\xd0146 (1996).
# Amblysomus hottentotus, Elephantulus myurus

# Amblysomus hottentotus 80.60 1.24499 66.000000 8.6375228 
# AfrJZOol Mean body mass of males (mean ± 1 S.E. 80.6g ±0.10,n= 155) was significantly higher than that of females (66.0 g ± 0.71,n= 148)
0.10*sqrt(155) # Ok
[1] 1.24499
0.71*sqrt(148) # Ok
[1] 8.637523
# Elephantulus myurus 51.74 0.88200 53.830000 5.3528310
# s 5 and 6 (all above age class 3 are sexually mature). Used Baker and Nissin's (1963, Nature) equation to calculate new SEs for the combined means
# from Medger
(22*49.8 + 14*54.8)/36  # Ok, same value for mean males
[1] 51.74444
(30*53.6 + 7*54.8)/37 # Ok same value for mean females
[1] 53.82703
# from Baker 1963, squared st error
(1/(36*35))*(22*21*(1.0^2)+14*13*(1.3^2)+(22*14/36)*(49.8-54.8)^2) # Males
[1] 0.7805309
sqrt((1/(36*35))*(22*21*(1.0^2)+14*13*(1.3^2)+(22*14/36)*(49.8-54.8)^2)) # Males SE used in paper
[1] 0.8834766
sqrt(36)*sqrt((1/(36*35))*(22*21*(1.0^2)+14*13*(1.3^2)+(22*14/36)*(49.8-54.8)^2)) # Males
[1] 5.300859
(1/(37*36))*(30*29*(0.9^2)+7*6*(2.8^2)+(30*7/37)*(53.6-54.8)^2) # Females
[1] 0.7823971
sqrt((1/(37*36))*(30*29*(0.9^2)+7*6*(2.8^2)+(30*7/37)*(53.6-54.8)^2)) # Females SE
[1] 0.8845322
sqrt(37)*sqrt((1/(37*36))*(30*29*(0.9^2)+7*6*(2.8^2)+(30*7/37)*(53.6-54.8)^2)) # Females SD used in paper
[1] 5.380399
ssd[ssd$Scientific_Name=="Elephantulus myurus","SDmassM"] <- sqrt(36)*sqrt((1/(36*35))*(22*21*(1.0^2)+14*13*(1.3^2)+(22*14/36)*(49.8-54.8)^2))
ssd[ssd$Scientific_Name=="Elephantulus myurus","SDmassF"] <- sqrt(37)*sqrt((1/(37*36))*(30*29*(0.9^2)+7*6*(2.8^2)+(30*7/37)*(53.6-54.8)^2)) # Females SD used in paper
ssd[ssd$Scientific_Name=="Elephantulus myurus",]
            Order          Family                     Species
368 Macroscelidea Macroscelididae Eastern rock elephant shrew
        Scientific_Name massM  SDmassM massF  SDmassF lengthM SDlengthM lengthF
368 Elephantulus myurus 51.74 5.300859 53.83 5.380399      NA        NA      NA
    SDlengthF n_M n_F n_Mlength n_Flength
368        NA  36  37        NA        NA
                                                                                                                                                                  Comments
368 Combined age classes 5 and 6 (all above age class 3 are sexually mature). Used Baker and Nissin's (1963, Nature) equation to calculate new SEs for the combined means.
                                                                                                                                                                                                                                                            Source
368 Medger, K. The reproductive biology of two small southern African mammals, the spiny mouse, Acomys spinosissimus (Rodentia: Muridae) and the Eastern rock elephant-shrew, Elephantulus myurus (Macrosclidea: Macroscelididae). (University of Pretoria, 2011).
# Damaliscus pygargus phillipsi values given in van Zyl for means and SE are : 50.4±5.0 56.2±9.9
ssd[ssd$Scientific_Name=="Damaliscus pygargus phillipsi",]
          Order  Family Species               Scientific_Name massM SDmassM
32 Artiodactyla Bovidae Blesbok Damaliscus pygargus phillipsi 50400    1000
33 Artiodactyla Bovidae Blesbok Damaliscus pygargus phillipsi 72615    7136
   massF SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F n_Mlength
32 56200   19800      NA        NA      NA        NA   4   4        NA
33 68545    4741      NA        NA      NA        NA  13  11        NA
   n_Flength
32        NA
33        NA
                                                                                              Comments
32                                                                                                    
33 Adult blesbok weights at capture in Groenkloof Nature Reserve, calculated from raw data in Table 1.
                                                                                                                                                                                                                           Source
32 Van Zyl, L. & Ferreira, A. V. Physical and chemical carcass composition of springbok (Antidorcas marsupialis), blesbok (Damaliscus dorcas phillipsi) and impala (Aepyceros melampus). Small Rumin. Res. 53, 103\xd0109 (2004).
33                                         Fitte, A. Determination of the pathophysiological consequences of capture and capture-induced hyperthermia in blesbok (Damaliscus pygargus phillipsi). (University of Pretoria, 2016).
ssd[ssd$Scientific_Name=="Damaliscus pygargus phillipsi" & ssd$n_M==4,"SDmassM"]<-
  5000*sqrt(ssd[ssd$Scientific_Name=="Damaliscus pygargus phillipsi" & ssd$n_M==4,"n_M"])
ssd[ssd$Scientific_Name=="Damaliscus pygargus phillipsi"& ssd$n_F==4,"SDmassF"]<-
  9900*sqrt(ssd[ssd$Scientific_Name=="Damaliscus pygargus phillipsi" & ssd$n_F==4,"n_F"])
ssd[ssd$Scientific_Name=="Damaliscus pygargus phillipsi",]
          Order  Family Species               Scientific_Name massM SDmassM
32 Artiodactyla Bovidae Blesbok Damaliscus pygargus phillipsi 50400   10000
33 Artiodactyla Bovidae Blesbok Damaliscus pygargus phillipsi 72615    7136
   massF SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F n_Mlength
32 56200   19800      NA        NA      NA        NA   4   4        NA
33 68545    4741      NA        NA      NA        NA  13  11        NA
   n_Flength
32        NA
33        NA
                                                                                              Comments
32                                                                                                    
33 Adult blesbok weights at capture in Groenkloof Nature Reserve, calculated from raw data in Table 1.
                                                                                                                                                                                                                           Source
32 Van Zyl, L. & Ferreira, A. V. Physical and chemical carcass composition of springbok (Antidorcas marsupialis), blesbok (Damaliscus dorcas phillipsi) and impala (Aepyceros melampus). Small Rumin. Res. 53, 103\xd0109 (2004).
33                                         Fitte, A. Determination of the pathophysiological consequences of capture and capture-induced hyperthermia in blesbok (Damaliscus pygargus phillipsi). (University of Pretoria, 2016).
# Ochotona curzoniae, SE not SD, for example considering range of variation
ssd[ssd$Scientific_Name=="Ochotona curzoniae","SDmassM"]<-
  ssd[ssd$Scientific_Name=="Ochotona curzoniae","SDmassM"]*sqrt(ssd[ssd$Scientific_Name=="Ochotona curzoniae","n_M"])
ssd[ssd$Scientific_Name=="Ochotona curzoniae","SDmassF"]<-
  ssd[ssd$Scientific_Name=="Ochotona curzoniae","SDmassF"]*sqrt(ssd[ssd$Scientific_Name=="Ochotona curzoniae","n_F"])
ssd[ssd$Scientific_Name=="Ochotona curzoniae",]
         Order      Family      Species    Scientific_Name  massM  SDmassM
364 Lagomorpha Ochotonidae Plateau pika Ochotona curzoniae 152.49 19.27773
     massF  SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F n_Mlength
364 149.17 15.61845      NA        NA      NA        NA 147 140        NA
    n_Flength Comments
364        NA         
                                                                                                                                                          Source
364 Nie, H., Liu, J. & Chen, B. Life-history traits and fitness of plateau pika (Ochotona curzoniae) in alpine meadow ecosystem. Ecol. Evol. 12, 1\xd017 (2022).
# Xerus inauris; 601.5     6.1   550     6.6 # Waterman reported SE
ssd[ssd$Scientific_Name=="Xerus inauris",]
       Order    Family              Species Scientific_Name massM SDmassM massF
685 Rodentia Sciuridae Cape ground squirrel   Xerus inauris 601.5     6.1   550
    SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F n_Mlength n_Flength
685     6.6      NA        NA      NA        NA  50  55        NA        NA
    Comments
685         
                                                                                                                    Source
685 Waterman, J. M. Reproductive biology of a tropical, non-hibernating ground squirrel. J. Mammal. 77, 134\xd0146 (1996).
ssd[ssd$Scientific_Name=="Xerus inauris","SDmassM"]<-
  ssd[ssd$Scientific_Name=="Xerus inauris","SDmassM"]*sqrt(ssd[ssd$Scientific_Name=="Xerus inauris","n_M"])
ssd[ssd$Scientific_Name=="Xerus inauris","SDmassF"]<-
  ssd[ssd$Scientific_Name=="Xerus inauris","SDmassF"]*sqrt(ssd[ssd$Scientific_Name=="Xerus inauris","n_F"])
ssd[ssd$Scientific_Name=="Xerus inauris",]
       Order    Family              Species Scientific_Name massM  SDmassM
685 Rodentia Sciuridae Cape ground squirrel   Xerus inauris 601.5 43.13351
    massF  SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F n_Mlength
685   550 48.94691      NA        NA      NA        NA  50  55        NA
    n_Flength Comments
685        NA         
                                                                                                                    Source
685 Waterman, J. M. Reproductive biology of a tropical, non-hibernating ground squirrel. J. Mammal. 77, 134\xd0146 (1996).
ssd[abs(residuals(lm(log(massF)~log(SDmassF+0.01), data=ssd)))>2, ]  # adding 0.01 because some SD=0
            Order       Family                  Species
191    Chiroptera Pteropodidae Mindanao pygmy fruit bat
200    Chiroptera Pteropodidae          Harpy fruit bat
307 Diprotodontia Macropodidae       Red-necked wallaby
                     Scientific_Name massM SDmassM massF SDmassF lengthM
191        Alionycteris paucidentata    15     1.2    15       0     4.6
200       Harpyionycteris whiteheadi   110     7.0   105       0     8.6
307 Macropus rufogriseus rufogriseus 24700  7600.0 10600     100      NA
    SDlengthM lengthF SDlengthF n_M n_F n_Mlength n_Flength
191      0.18     4.8      0.12  12   2        16         8
200      0.29     8.5      0.28   9   2         6         6
307        NA      NA        NA   4   2        NA        NA
                                                                                                                                             Comments
191                       Only 2 of the captured females were not pregnant so these were the only females included here, each of which weighed 15.0g.
200 Forearm length used for body length. Used mass data from only non-pregnant adult females, of which there were only 2, each of which weighed 105g.
307                                                                                                                                                  
                                                                                                                                                                                                                         Source
191                                                              Bergallo, H. de G. Ecology of a small mammal community in an Atlantic Forest Area in Southeastern Brazil. Stud. Neotrop. Fauna Environ. 29, 197\xd0217 (1994).
200                                         Heaney, L. R., Tabaranza, B. R., Rickart, E. A., Balete, D. S. & Ingle, N. R. The mammals of Mt. Kitanglad Nature Park, Mindanao, Philippines. Fieldiana Zool. 112, 1\xd063 (2006).
307 Le Mar, K., McArthur, C. & Statham, M. Home ranges of sympatric red-necked wallabies, redbellied pademelons and common brushtail possums in a temperate eucalypt forestry environment. Aust. Mammal. 25, 183\xd0191 (2003).
# only 2 females for Macropus rufogriseus, SD for F 100, other species with SD=0 (also with n_F=2)
ssd[abs(residuals(lm(log(massF)~log(SDmassF+0.01), data=ssd)))>1.7, ]  # adding 0.01 because some SD=0
            Order       Family                  Species
73      Carnivora      Felidae               Jaguarundi
191    Chiroptera Pteropodidae Mindanao pygmy fruit bat
200    Chiroptera Pteropodidae          Harpy fruit bat
307 Diprotodontia Macropodidae       Red-necked wallaby
308 Diprotodontia Macropodidae    Western brush wallaby
357    Lagomorpha    Leporidae            Snowshoe hare
442      Primates    Indriidae        Verreaux's sifaka
539      Rodentia   Cricetidae  Hairy-tailed bolo mouse
578      Rodentia   Dinomyidae        Dinomys branickii
605      Rodentia      Muridae     Wilson's spiny mouse
621      Rodentia      Muridae    Greater bandicoot rat
656      Rodentia      Muridae     Mount Data shrew-rat
668      Rodentia    Sciuridae       Brazilian squirrel
                     Scientific_Name       massM    SDmassM       massF
73                 Puma yagouaroundi  4058.57692 2449.77057  3398.18571
191        Alionycteris paucidentata    15.00000    1.20000    15.00000
200       Harpyionycteris whiteheadi   110.00000    7.00000   105.00000
307 Macropus rufogriseus rufogriseus 24700.00000 7600.00000 10600.00000
308                Notamocropus irma  8390.00000  720.00000  9080.00000
357                 Lepus americanus  1027.30000   22.50000  1167.30000
442     Propithecus verreauxi majori  3376.00000  401.63665  3389.00000
539                Necromys lasiurus    37.57576   10.55130    46.15217
578                Dinomys branickii  7000.00000 2828.42713  5300.00000
605                   Acomys wilsoni    29.30000    2.50000    31.70000
621                 Bandicota indica   557.00000   15.00000   503.00000
656            Rhynchomys soricoides   154.40000   13.30000   157.50000
668       Guerlinguetus brasiliensis   183.90000   38.26937   112.00000
       SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F n_Mlength n_Flength
73  4042.88497      NA        NA      NA        NA  13   7        NA        NA
191    0.00000   4.600     0.180   4.800     0.120  12   2        16         8
200    0.00000   8.600     0.290   8.500     0.280   9   2         6         6
307  100.00000      NA        NA      NA        NA   4   2        NA        NA
308  260.00000  12.200     0.540  12.200     0.600   7   6         7         6
357   24.80000      NA        NA      NA        NA  23  15        NA        NA
442   74.95332      NA        NA      NA        NA   2   2        NA        NA
539   45.46913  10.734     1.991  11.678     3.105  33  23        32        23
578 5798.27561      NA        NA      NA        NA   2   2        NA        NA
605    0.50000      NA        NA      NA        NA   9   3        NA        NA
621   10.00000      NA        NA      NA        NA  15  33        NA        NA
656    2.90000      NA        NA      NA        NA   9   4        NA        NA
668  103.23759  18.667     1.492  15.550     6.435  10   2         9         2
                                                                                                                                             Comments
73                                                                                                                                                   
191                       Only 2 of the captured females were not pregnant so these were the only females included here, each of which weighed 15.0g.
200 Forearm length used for body length. Used mass data from only non-pregnant adult females, of which there were only 2, each of which weighed 105g.
307                                                                                                                                                  
308                                                                                                                       Body length is head length.
357          Hares livetrapped in Tomahawk, Wisconsin - body masses from the beginning of the study (before an experiment with doubly labeled water).
442                                                                                                                                                  
539                                                                                                                                                  
578                                                                                                                                                  
605                                                                                                                                                  
621                                                   Used values from non-pregnant females and males in the Year 1 Wet Season (largest sample size).
656                                                                                                                                                  
668                                                                                                                                                  
                                                                                                                                                                                                                                  Source
73                                                                        Gon\x8dalves, F. et al. Atlantic Mammal Traits: a data set of morphological traits of mammals in the Atlantic Forest of South America. Ecology 99, 498 (2018).
191                                                                       Bergallo, H. de G. Ecology of a small mammal community in an Atlantic Forest Area in Southeastern Brazil. Stud. Neotrop. Fauna Environ. 29, 197\xd0217 (1994).
200                                                  Heaney, L. R., Tabaranza, B. R., Rickart, E. A., Balete, D. S. & Ingle, N. R. The mammals of Mt. Kitanglad Nature Park, Mindanao, Philippines. Fieldiana Zool. 112, 1\xd063 (2006).
307          Le Mar, K., McArthur, C. & Statham, M. Home ranges of sympatric red-necked wallabies, redbellied pademelons and common brushtail possums in a temperate eucalypt forestry environment. Aust. Mammal. 25, 183\xd0191 (2003).
308                                       Povh, L. F. et al. Shedding light on a cryptic macropodid: home ranges and habitat preferences of translocated western brush wallabies (Notamacropus irma). Aust. Mammal. 41, 82\xd091 (2018).
357                          Ellsworth, E., Boudreau, M. R., Nagy, K., Rachlow, J. L. & Murray, D. L. Differential sex-related winter energetics in free-ranging snowshoe hares (Lepus americanus). Can. J. Zool. 94, 115\xd0121 (2015).
442                                                                                                        Kappeler, P. M. Patterns of sexual dimorphism in body weight among prosimian primates. Folia Primatol. 57, 132\xd0146 (1991).
539                                                                       Gon\x8dalves, F. et al. Atlantic Mammal Traits: a data set of morphological traits of mammals in the Atlantic Forest of South America. Ecology 99, 498 (2018).
578                                                                                                                       Ocampo, D. et al. Body mass data set for 1,317 bird and 270 mammal species from Colombia. Ecology 102, (2021).
605                                                                                                             Canova, L. & Fasola, M. Small rodents along a ground-cover gradient in coastal Kenya. Trop. Zool. 13, 219\xd0226 (2000).
621                      Thitipramote, N., Swanjarat, J. & Breed, W. G. Reproductive biology of the greater bandicoot rat Bandicota indica (Rodentia: Muridae) in the rice fields of southern Thailand. Curr. Zool. 55, 48\xd055 (2009).
656 Balete, D. S., Rickart, E. A., Rosell-Ambal, R. G. B., Jansa, S. & Heaney, L. R. Descriptions of two new species of Rhynchomys Thomas (Rodentia: Muridae: Murinae) from Luzon Island, Philippines. J. Mammal. 88, 287\xd0301 (2007).
668                                                                       Gon\x8dalves, F. et al. Atlantic Mammal Traits: a data set of morphological traits of mammals in the Atlantic Forest of South America. Ecology 99, 498 (2018).
ssd[abs(residuals(lm(log(SDmassF+0.01)~log(massF), data=ssd)))>2, ]  # adding 0.01 because some SD=0
            Order       Family                  Species
73      Carnivora      Felidae               Jaguarundi
191    Chiroptera Pteropodidae Mindanao pygmy fruit bat
200    Chiroptera Pteropodidae          Harpy fruit bat
307 Diprotodontia Macropodidae       Red-necked wallaby
578      Rodentia   Dinomyidae        Dinomys branickii
605      Rodentia      Muridae     Wilson's spiny mouse
656      Rodentia      Muridae     Mount Data shrew-rat
                     Scientific_Name     massM  SDmassM     massF  SDmassF
73                 Puma yagouaroundi  4058.577 2449.771  3398.186 4042.885
191        Alionycteris paucidentata    15.000    1.200    15.000    0.000
200       Harpyionycteris whiteheadi   110.000    7.000   105.000    0.000
307 Macropus rufogriseus rufogriseus 24700.000 7600.000 10600.000  100.000
578                Dinomys branickii  7000.000 2828.427  5300.000 5798.276
605                   Acomys wilsoni    29.300    2.500    31.700    0.500
656            Rhynchomys soricoides   154.400   13.300   157.500    2.900
    lengthM SDlengthM lengthF SDlengthF n_M n_F n_Mlength n_Flength
73       NA        NA      NA        NA  13   7        NA        NA
191     4.6      0.18     4.8      0.12  12   2        16         8
200     8.6      0.29     8.5      0.28   9   2         6         6
307      NA        NA      NA        NA   4   2        NA        NA
578      NA        NA      NA        NA   2   2        NA        NA
605      NA        NA      NA        NA   9   3        NA        NA
656      NA        NA      NA        NA   9   4        NA        NA
                                                                                                                                             Comments
73                                                                                                                                                   
191                       Only 2 of the captured females were not pregnant so these were the only females included here, each of which weighed 15.0g.
200 Forearm length used for body length. Used mass data from only non-pregnant adult females, of which there were only 2, each of which weighed 105g.
307                                                                                                                                                  
578                                                                                                                                                  
605                                                                                                                                                  
656                                                                                                                                                  
                                                                                                                                                                                                                                  Source
73                                                                        Gon\x8dalves, F. et al. Atlantic Mammal Traits: a data set of morphological traits of mammals in the Atlantic Forest of South America. Ecology 99, 498 (2018).
191                                                                       Bergallo, H. de G. Ecology of a small mammal community in an Atlantic Forest Area in Southeastern Brazil. Stud. Neotrop. Fauna Environ. 29, 197\xd0217 (1994).
200                                                  Heaney, L. R., Tabaranza, B. R., Rickart, E. A., Balete, D. S. & Ingle, N. R. The mammals of Mt. Kitanglad Nature Park, Mindanao, Philippines. Fieldiana Zool. 112, 1\xd063 (2006).
307          Le Mar, K., McArthur, C. & Statham, M. Home ranges of sympatric red-necked wallabies, redbellied pademelons and common brushtail possums in a temperate eucalypt forestry environment. Aust. Mammal. 25, 183\xd0191 (2003).
578                                                                                                                       Ocampo, D. et al. Body mass data set for 1,317 bird and 270 mammal species from Colombia. Ecology 102, (2021).
605                                                                                                             Canova, L. & Fasola, M. Small rodents along a ground-cover gradient in coastal Kenya. Trop. Zool. 13, 219\xd0226 (2000).
656 Balete, D. S., Rickart, E. A., Rosell-Ambal, R. G. B., Jansa, S. & Heaney, L. R. Descriptions of two new species of Rhynchomys Thomas (Rodentia: Muridae: Murinae) from Luzon Island, Philippines. J. Mammal. 88, 287\xd0301 (2007).
# Lepus americanus 1027.30000   22.50000  1167.30000   24.80000 # IN Ellsworth stated as SE
ssd[ssd$Scientific_Name=="Lepus americanus","SDmassM"]<-
  ssd[ssd$Scientific_Name=="Lepus americanus","SDmassM"]*sqrt(ssd[ssd$Scientific_Name=="Lepus americanus","n_M"])
ssd[ssd$Scientific_Name=="Lepus americanus","SDmassF"]<-
  ssd[ssd$Scientific_Name=="Lepus americanus","SDmassF"]*sqrt(ssd[ssd$Scientific_Name=="Lepus americanus","n_F"])
ssd[ssd$Scientific_Name=="Lepus americanus",]
         Order    Family       Species  Scientific_Name  massM  SDmassM  massF
357 Lagomorpha Leporidae Snowshoe hare Lepus americanus 1027.3 107.9062 1167.3
     SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F n_Mlength n_Flength
357 96.04999      NA        NA      NA        NA  23  15        NA        NA
                                                                                                                                    Comments
357 Hares livetrapped in Tomahawk, Wisconsin - body masses from the beginning of the study (before an experiment with doubly labeled water).
                                                                                                                                                                                                         Source
357 Ellsworth, E., Boudreau, M. R., Nagy, K., Rachlow, J. L. & Murray, D. L. Differential sex-related winter energetics in free-ranging snowshoe hares (Lepus americanus). Can. J. Zool. 94, 115\xd0121 (2015).
#  Dinomys branickii, too high SD?
ssd[ssd$Scientific_Name=="Dinomys branickii",]  # hard to check in Ocampo, did not find original ref
       Order     Family           Species   Scientific_Name massM  SDmassM
578 Rodentia Dinomyidae Dinomys branickii Dinomys branickii  7000 2828.427
    massF  SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F n_Mlength
578  5300 5798.276      NA        NA      NA        NA   2   2        NA
    n_Flength Comments
578        NA         
                                                                                                            Source
578 Ocampo, D. et al. Body mass data set for 1,317 bird and 270 mammal species from Colombia. Ecology 102, (2021).
# Bandicota indica 557      15   503      10
ssd[ssd$Scientific_Name=="Bandicota indica",] # used SE and not SD
       Order  Family               Species  Scientific_Name massM SDmassM massF
621 Rodentia Muridae Greater bandicoot rat Bandicota indica   557      15   503
    SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F n_Mlength n_Flength
621      10      NA        NA      NA        NA  15  33        NA        NA
                                                                                           Comments
621 Used values from non-pregnant females and males in the Year 1 Wet Season (largest sample size).
                                                                                                                                                                                                             Source
621 Thitipramote, N., Swanjarat, J. & Breed, W. G. Reproductive biology of the greater bandicoot rat Bandicota indica (Rodentia: Muridae) in the rice fields of southern Thailand. Curr. Zool. 55, 48\xd055 (2009).
ssd[ssd$Scientific_Name=="Bandicota indica","SDmassM"]<-
  ssd[ssd$Scientific_Name=="Bandicota indica","SDmassM"]*sqrt(ssd[ssd$Scientific_Name=="Bandicota indica","n_M"])
ssd[ssd$Scientific_Name=="Bandicota indica","SDmassF"]<-
  ssd[ssd$Scientific_Name=="Bandicota indica","SDmassF"]*sqrt(ssd[ssd$Scientific_Name=="Bandicota indica","n_F"])
ssd[ssd$Scientific_Name=="Bandicota indica",]
       Order  Family               Species  Scientific_Name massM  SDmassM
621 Rodentia Muridae Greater bandicoot rat Bandicota indica   557 58.09475
    massF  SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F n_Mlength
621   503 57.44563      NA        NA      NA        NA  15  33        NA
    n_Flength
621        NA
                                                                                           Comments
621 Used values from non-pregnant females and males in the Year 1 Wet Season (largest sample size).
                                                                                                                                                                                                             Source
621 Thitipramote, N., Swanjarat, J. & Breed, W. G. Reproductive biology of the greater bandicoot rat Bandicota indica (Rodentia: Muridae) in the rice fields of southern Thailand. Curr. Zool. 55, 48\xd055 (2009).
subset(ssd, log(SDmassF) < (-1))
         Order           Family                     Species
100 Chiroptera   Emballonuridae      Greater sac-winged bat
108 Chiroptera    Miniopteridae     Least long-fingered bat
120 Chiroptera       Molossidae             Broad-eared bat
191 Chiroptera     Pteropodidae    Mindanao pygmy fruit bat
200 Chiroptera     Pteropodidae             Harpy fruit bat
215 Chiroptera Vespertilionidae         Western barbastelle
230 Chiroptera Vespertilionidae        Fea's tube-nosed bat
247 Chiroptera Vespertilionidae Eastern small-footed myotis
265 Chiroptera Vespertilionidae          Kuhl's pipistrelle
               Scientific_Name  massM   SDmassM  massF   SDmassF lengthM
100      Saccopteryx bilineata   7.70 0.2000000   8.00 0.2000000      NA
108          Miniopterus minor   6.30 0.3000000   6.20 0.2000000   3.980
120   Nyctinomops laticaudatus  10.50 0.8660254   9.75 0.3535534   4.397
191  Alionycteris paucidentata  15.00 1.2000000  15.00 0.0000000   4.600
200 Harpyionycteris whiteheadi 110.00 7.0000000 105.00 0.0000000   8.600
215   Barbastella barbastellus   8.16 0.4000000   8.70 0.2100000   3.904
230                Murina feae   4.70 0.3000000   5.20 0.3000000      NA
247              Myotis leibii   4.11 0.4100000   3.90 0.3300000   3.019
265        Pipistrellus kuhlii   5.37 0.8300000   6.53 0.2800000   3.299
    SDlengthM lengthF SDlengthF n_M n_F n_Mlength n_Flength
100        NA      NA        NA  17   6        NA        NA
108    0.0800   3.990    0.0900  26  29        20        20
120    0.0896   4.525    0.0636   3   2         3         2
191    0.1800   4.800    0.1200  12   2        16         8
200    0.2900   8.500    0.2800   9   2         6         6
215    0.0380   3.937    0.1290  21   6        NA        NA
230        NA      NA        NA   3   2        NA        NA
247    0.0780   2.948    0.0400   4  15         4        15
265    0.1700   3.373    0.1890   5   3        NA        NA
                                                                                                                                             Comments
100                                                                                                                                                  
108                                                                                                                                                  
120                                                                                                                                                  
191                       Only 2 of the captured females were not pregnant so these were the only females included here, each of which weighed 15.0g.
200 Forearm length used for body length. Used mass data from only non-pregnant adult females, of which there were only 2, each of which weighed 105g.
215                                                                                                           Forearm length in used for body length.
230                                                                                                                                                  
247                                                                                   Body length is forearm length. Measurements wild-caught adults.
265                                                                                                              Forearm length used for body length.
                                                                                                                                                                                                        Source
100 Voigt, C. C., Von Helversen, O., Michener, R. & Kunz, T. H. The economics of harem maintenance in the sac-winged bat, Saccopteryx bilineata (Emballonuridae). Behav. Ecol. Sociobiol. 50, 31\xd036 (2001).
108                                                   McWilliam, A. N. Mating system of the bat Miniopterus minor (Chiroptera: Vespertilionidae) in Kenya, East Africa: A lek? Ethology 85, 302\xd0312 (1990).
120                                             Gon\x8dalves, F. et al. Atlantic Mammal Traits: a data set of morphological traits of mammals in the Atlantic Forest of South America. Ecology 99, 498 (2018).
191                                             Bergallo, H. de G. Ecology of a small mammal community in an Atlantic Forest Area in Southeastern Brazil. Stud. Neotrop. Fauna Environ. 29, 197\xd0217 (1994).
200                        Heaney, L. R., Tabaranza, B. R., Rickart, E. A., Balete, D. S. & Ingle, N. R. The mammals of Mt. Kitanglad Nature Park, Mindanao, Philippines. Fieldiana Zool. 112, 1\xd063 (2006).
215                        Toffoli, R., Culasso, P., Locatelli, A. G. & Giraudo, L. Bats of Alpi Marittime Nature Park (north west Italy) and site of community importance. Nat. Hist. Sci. 3, 3\xd013 (2016).
230                    Soisook, P. Systematics, biogeography and echolocation of tube-nosed bats genus Murina (Chiroptera: Vespertilionidae) in Mainland Southeast Asia. (Prince of Songkla University, 2013).
247                                     Lacki, M. J. et al. Temporal changes in body mass and body condition of cave-hibernating bats during staging and swarming. J. Fish Wildl. Manag. 6, 360\xd0370 (2015).
265                        Toffoli, R., Culasso, P., Locatelli, A. G. & Giraudo, L. Bats of Alpi Marittime Nature Park (north west Italy) and site of community importance. Nat. Hist. Sci. 3, 3\xd013 (2016).
# Saccopteryx bilineata, Miniopterus minor 
# Saccopteryx bilineata 7.70 0.2000000   8.00 0.2000000
# in Voigt Body mass for adult males averaged 7.7 g (±0.3 g SD, n=17) and 8.0 g (±0.2 g SD, n=6) for adult females
ssd[ssd$Scientific_Name=="Saccopteryx bilineata","SDmassM"] <- 0.3

ssd[ssd$Scientific_Name=="Miniopterus minor",]
         Order        Family                 Species   Scientific_Name massM
108 Chiroptera Miniopteridae Least long-fingered bat Miniopterus minor   6.3
    SDmassM massF SDmassF lengthM SDlengthM lengthF SDlengthF n_M n_F n_Mlength
108     0.3   6.2     0.2    3.98      0.08    3.99      0.09  26  29        20
    n_Flength Comments
108        20         
                                                                                                                                                      Source
108 McWilliam, A. N. Mating system of the bat Miniopterus minor (Chiroptera: Vespertilionidae) in Kenya, East Africa: A lek? Ethology 85, 302\xd0312 (1990).
# in McWilliam Weight (g): males = 6.3 f 0.3 (26), females = 6.2 k 0.2 (29)
# Forearm length (mm): males = 39.8 k 0.8 (2O), females = 39.9 k 0.9 (20)

subset(ssd, Order=="Dasyuromorphia") # species with relatively large SD
             Order     Family               Species      Scientific_Name
275 Dasyuromorphia Dasyuridae      Brown antechinus  Antechinus stuartii
276 Dasyuromorphia Dasyuridae        Northern quoll  Dasyurus hallucatus
277 Dasyuromorphia Dasyuridae           Tiger quoll   Dasyurus maculatus
278 Dasyuromorphia Dasyuridae Red-tailed phascogale    Phascogale calura
279 Dasyuromorphia Dasyuridae       Tasmanian devil Sarcophilus harrisii
      massM     SDmassM  massF    SDmassF lengthM SDlengthM lengthF SDlengthF
275   39.16    6.528113   22.0   2.972098      NA        NA      NA        NA
276  588.00   34.000000  428.0  28.000000      NA        NA      NA        NA
277 2800.00  700.000000 1700.0 300.000000    10.7         1     9.3       0.8
278   47.20    2.700000   32.6   0.900000      NA        NA      NA        NA
279 8400.00 1300.000000 6400.0 890.000000      NA        NA      NA        NA
    n_M n_F n_Mlength n_Flength
275  17  10        NA        NA
276  20  16        NA        NA
277  41  20        41        20
278  15  56        NA        NA
279 353 513        NA        NA
                                                                                                                                                                                                                                                                                                                                                                                                                       Comments
275                                                                                                                                                                                           Combined July and August weights, using Baker and Nissim's 1963 equation to calculate the new SE and then converting to SD, because these were the months that the trapped individuals were sexually mature but not yet breeding.
276                                                                                                                                                                                                                                                                                                                                                             Used their April weights (recruitment season, before breeding).
277                                                                                                                                                                                                                                                                                                    Head length used for body length. Also report tail length and short-pes length (so hindfoot length, excluding the toes) 
278 Sample size not explicitly stated but estimated based on number of males and females trapped on June 12 and June 18 (mid-June trapping dates). Used body weights when they peaked in mid-June of first-year males and females as they approached (but before) the breeding season (the males all disappear from the population after the breeding season while second-year females are heavier than all first-year adults).
279                                                                                                                                                                                                                                                                                                                                                                                                                            
                                                                                                                                                                                                                          Source
275 McAllan, B. M., Roberts, J. R. & O\xd5Shea, T. Seasonal changes in glomerular filtration rate in Antechinus stuartii (Marsupialia: Dasyuridae). J. Comp. Physiol. - B Biochem. Syst. Environ. Physiol. 168, 41\xd049 (1998).
276                         Hernandez-Santin, L., Dunlop, J. A., Goldizen, A. W. & Fisher, D. O. Demography of the northern quoll (Dasyurus hallucatus) in the most arid part of its range. J. Mammal. 100, 1191\xd01198 (2019).
277                                                                   Glen, A. S. Population attributes of the spotted-tailed quoll (Dasyurus maculatus) in north-eastern New South Wales. Aust. J. Zool. 56, 137\xd0142 (2008).
278                          Bradley, A. J. Reproduction and life history in the red-tailed phascogale, Phascogale calura (Marsupialia: Dasyuridae): The adaptive-stress senescence hypothesis. J. Zool. 241, 739\xd0755 (1997).
279                  Belkhir, S., Hamede, R., Thomas, F., Ujvari, B. & Dujon, A. M. Season, weight, and age, but not transmissible cancer, affect tick loads in the endangered Tasmanian devil. Infect. Genet. Evol. 98, (2022).
# Dasyurus maculatus 2800.00  700.000000 1700.0 300.000000
# from Glen aust j zool Body mass (kg) 2.8 ± 0.7 (1.4–4.2) 1.7 ± 0.3 (1.2–2.4)

# end checks NIGEL
####################

Using some of the original script to ad their classification of dimorphism

#Calculate 95% CI's for a difference in mean mass
#CI= (x1-x2) +/-t * sqrt((sp2/n1) + sp2/n2))

#where x1 and x2 are the sample 1 mean and sample 2 mean, respectively
#t = the t-critical value based on the confidence level and (n1+n2-2) degrees of freedom
#sp2 = pooled variance, calculated as ((n1-1)s12 + (n2-1)s22)/(n1+n2-2)
#and n1, n2 are the sample sizes for sample 1 and sample 2, respectively
##See this link for further explanation: https://www.r-bloggers.com/2021/11/calculate-confidence-intervals-in-r/


#Calculate pooled variance for each difference (male-female) in means
ssd<-mutate(ssd, PooledMassVar=((n_M-1)*SDmassM^2 + (n_F-1)*SDmassF^2)/(n_M + n_F - 2))

#Calculate margin of error for each difference (male-female) in means
ssd<-mutate(ssd, massdiffErrorMargin=qt(0.975, df=n_M+n_F-1)*sqrt(PooledMassVar/n_M + PooledMassVar/n_F))

#Now calculate the lower and upper bounds of the 95% CI of the mass differences
ssd<-mutate(ssd, massdiffLower95CI=(massM - massF) - massdiffErrorMargin)
ssd<-mutate(ssd, massdiffUpper95CI=(massM - massF) + massdiffErrorMargin)

#Create a categorical column for mono- or dimorphic based on 95%CI
ssd<-mutate(ssd, massDimorphicYN=ifelse((massdiffLower95CI<0 & massdiffUpper95CI>0) | (massdiffLower95CI>0 & massdiffUpper95CI<0), 'Monomorphic', 'Dimorphic'))
ssd$massDimorphicYN<-factor(ssd$massDimorphicYN, levels=c('Monomorphic', 'Dimorphic'))

#Create a column assigning each row as male-biased dimorphic, female-biased
##dimorphic, or monomorphic
ssd$massDimorphism<-ifelse(ssd$massM>ssd$massF & ssd$massDimorphicYN=='Dimorphic', 'Male-Biased Dimorphic', 'Monomorphic')
ssd$massDimorphism<-ifelse(ssd$massM<ssd$massF & ssd$massDimorphicYN=='Dimorphic', 'Female-Biased Dimorphic', ssd$massDimorphism)

Creating some subfiles with some criteria on the number of species per family and on the number of individuals weighed.

d<-ssd
head(d)
         Order          Family                  Species
1 Afrosoricida Chrysochloridae    Hottentot golden mole
2 Afrosoricida Chrysochloridae Namib desert golden mole
3 Afrosoricida      Tenrecidae   Lesser hedgehog tenrec
4 Afrosoricida      Tenrecidae       Large-eared tenrec
5 Afrosoricida      Tenrecidae Highland streaked tenrec
6 Afrosoricida      Tenrecidae  Lowland streaked tenrec
               Scientific_Name massM  SDmassM massF   SDmassF lengthM SDlengthM
1       Amblysomus hottentotus  80.6  1.24499  66.0  8.637523      NA        NA
2 Eremitalpa granti namibensis  28.0  6.70000  23.1  3.600000      NA        NA
3            Echinops telfairi 102.4 19.29000  99.9 17.820000      NA        NA
4               Geogale aurita   7.3  1.02000   7.0  1.340000      NA        NA
5       Hemicentetes nigriceps 111.0 15.59000  98.0  6.560000      NA        NA
6    Hemicentetes semispinosus 109.5 16.72000 107.6 16.010000      NA        NA
  lengthF SDlengthF n_M n_F n_Mlength n_Flength
1      NA        NA 155 148        NA        NA
2      NA        NA   4   8        NA        NA
3      NA        NA  24  15        NA        NA
4      NA        NA  17  15        NA        NA
5      NA        NA   3   3        NA        NA
6      NA        NA  24   5        NA        NA
                                                                                                                                                                                                                                                                                             Comments
1 SEs converted to SDs. Note that foetuses were detected in females throughout the year and only overall averages for the whole sampling period were reported, but males were so much larger than females that their relative sizes are unlikely to be much affected by foetuses so we kept the data.
2                                                                                                                                                                                                                                                                                                    
3                                                                                                                                                                                                                                                                                                    
4                                                                                                                                                                                                                                                                                                    
5                                                                                                                                                                                                                                                                                                    
6                                                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                              Source
1 Schoeman, S., Bennett, N. C., van der Merwe, M. & Schoeman, A. S. Aseasonal reproduction in the Hottentot golden mole, Amblysomus hottentotus (Afrosoricida: Chrysochloridae) from KwaZulu-Natal, South Africa. African Zool. 39, 41\xd046 (2004).
2                                                                                   Fielden, L. J. Selected aspects of the adaptive biology and ecology of the Namib desert golden mole (Eremitalpa granti namibensis). (University of Natal, 1989).
3                            Kappeler, P. M., Nunn, C. L., Vining, A. Q. & Goodman, S. M. Evolutionary dynamics of sexual size dimorphism in non-volant mammals following their independent colonization of Madagascar. Sci. Rep. 9, 1\xd014 (2019).
4                            Kappeler, P. M., Nunn, C. L., Vining, A. Q. & Goodman, S. M. Evolutionary dynamics of sexual size dimorphism in non-volant mammals following their independent colonization of Madagascar. Sci. Rep. 9, 1\xd014 (2019).
5                            Kappeler, P. M., Nunn, C. L., Vining, A. Q. & Goodman, S. M. Evolutionary dynamics of sexual size dimorphism in non-volant mammals following their independent colonization of Madagascar. Sci. Rep. 9, 1\xd014 (2019).
6                            Kappeler, P. M., Nunn, C. L., Vining, A. Q. & Goodman, S. M. Evolutionary dynamics of sexual size dimorphism in non-volant mammals following their independent colonization of Madagascar. Sci. Rep. 9, 1\xd014 (2019).
  PooledMassVar massdiffErrorMargin massdiffLower95CI massdiffUpper95CI
1     37.228902           1.3799291        13.2200709         15.979929
2     22.539000           6.3988226        -1.4988226         11.298823
3    351.462916          12.4915371        -9.9915371         14.991537
4      1.392827           0.8526681        -0.5526681          1.152668
5    143.040850          25.1024347       -12.1024347         38.102435
6    276.115689          16.7328608       -14.8328608         18.632861
  massDimorphicYN        massDimorphism
1       Dimorphic Male-Biased Dimorphic
2     Monomorphic           Monomorphic
3     Monomorphic           Monomorphic
4     Monomorphic           Monomorphic
5     Monomorphic           Monomorphic
6     Monomorphic           Monomorphic
names(d)
 [1] "Order"               "Family"              "Species"            
 [4] "Scientific_Name"     "massM"               "SDmassM"            
 [7] "massF"               "SDmassF"             "lengthM"            
[10] "SDlengthM"           "lengthF"             "SDlengthF"          
[13] "n_M"                 "n_F"                 "n_Mlength"          
[16] "n_Flength"           "Comments"            "Source"             
[19] "PooledMassVar"       "massdiffErrorMargin" "massdiffLower95CI"  
[22] "massdiffUpper95CI"   "massDimorphicYN"     "massDimorphism"     
d<-d[,-c(17,18)]
d$genus<-word(d$Scientific_Name,1,sep=" ")
d$dimo<-log(d$massM/d$massF) # dimorphism accounting for allometry
d$dimo.pM<-(d$massM-d$massF)/d$massM ### dimorphism as in the paper, with Males as a ref
d$dimo.pF<-(d$massM-d$massF)/d$massF ### dimorphism as in the paper, with females as a ref
d$massF.kg<-d$massF/1000  ## mass in kg
d$logmassF<-log(d$massF)  ## 
d$massDimorphism<-as.factor(d$massDimorphism)


##
dN<-droplevels(d[d$n_F>9&d$n_M>9,]) # D with species where 10 or more females and 10 or more males were weighed

## Datafile with ORDER having 5 species or more
  d2<-droplevels(d[d$Order%in%names(table(d$Order)[table(d$Order)>4]),])
  d2N<-droplevels(dN[dN$Order%in%names(table(dN$Order)[table(dN$Order)>4]),]) # D2 with species where 10 or more females and 10 or more males were weighed
  length(unique(d2$Species)); length(unique(d2N$Species))
[1] 619
[1] 391
##  Datafile with FAMILY having 5 species or more
  d3<-droplevels(d[d$Family%in%names(table(d$Family)[table(d$Family)>4]),])
  d3N<-droplevels(dN[dN$Family%in%names(table(dN$Family)[table(dN$Family)>4]),]) #  with species where 10 or more females and 10 or more males were weighed
  length(unique(d3$Species)); length(unique(d3N$Species))
[1] 517
[1] 291
  #aggregate(d$Family,list(d$Family),length)
## datafile for the Order with most species

  ## with all species
d.rod<-droplevels(d[d$Order=="Rodentia",],)
d.pri<-droplevels(d[d$Order=="Primates",],)
d.chi<-droplevels(d[d$Order=="Chiroptera",],)
d.art<-droplevels(d[d$Order=="Artiodactyla",],)
d.car<-droplevels(d[d$Order=="Carnivora",],)

## with only families that had 5 species or more
d3.rod<-droplevels(d3[d3$Order=="Rodentia",],)
d3.pri<-droplevels(d3[d3$Order=="Primates",],)
d3.chi<-droplevels(d3[d3$Order=="Chiroptera",],)
d3.art<-droplevels(d3[d3$Order=="Artiodactyla",],)
d3.car<-droplevels(d3[d3$Order=="Carnivora",],)

## among d3, with species with 10 individuals or more measured in each sex
d3N.rod<-droplevels(d3N[d3N$Order=="Rodentia",],)
d3N.pri<-droplevels(d3N[d3N$Order=="Primates",],)
d3N.chi<-droplevels(d3N[d3N$Order=="Chiroptera",],)
d3N.art<-droplevels(d3N[d3N$Order=="Artiodactyla",],)
d3N.car<-droplevels(d3N[d3N$Order=="Carnivora",],)

Some figures to look at the grade effect per family, within Order

#Les figures avec log(massM)~log(massF) 

#with the whole dataset
ggplot(d, aes(fill=Family, y=log(massM), x=log(massF),colour=Family), show.legend = FALSE) +
  facet_grid(~Order,scales="free")+ facet_wrap(~Order,nrow=3,scales="free")+
  geom_abline(intercept = 0, slope = 1,  color="darkgrey", show.legend = FALSE)+
  geom_point( show.legend = FALSE)+
  geom_smooth(aes(group=Family),method="lm", show.legend = FALSE)
`geom_smooth()` using formula = 'y ~ x'
Warning in qt((1 - level)/2, df): Production de NaN

Warning in qt((1 - level)/2, df): Production de NaN

Warning in qt((1 - level)/2, df): Production de NaN

Warning in qt((1 - level)/2, df): Production de NaN

Warning in qt((1 - level)/2, df): Production de NaN

Warning in qt((1 - level)/2, df): Production de NaN

Warning in qt((1 - level)/2, df): Production de NaN

Warning in qt((1 - level)/2, df): Production de NaN

Warning in qt((1 - level)/2, df): Production de NaN

Warning in qt((1 - level)/2, df): Production de NaN

Warning in qt((1 - level)/2, df): Production de NaN

Warning in qt((1 - level)/2, df): Production de NaN

Warning in qt((1 - level)/2, df): Production de NaN

Warning in qt((1 - level)/2, df): Production de NaN

Warning in qt((1 - level)/2, df): Production de NaN
Warning in max(ids, na.rm = TRUE): aucun argument pour max ; -Inf est renvoyé

Warning in max(ids, na.rm = TRUE): aucun argument pour max ; -Inf est renvoyé

Warning in max(ids, na.rm = TRUE): aucun argument pour max ; -Inf est renvoyé

Warning in max(ids, na.rm = TRUE): aucun argument pour max ; -Inf est renvoyé

Warning in max(ids, na.rm = TRUE): aucun argument pour max ; -Inf est renvoyé

Warning in max(ids, na.rm = TRUE): aucun argument pour max ; -Inf est renvoyé

Warning in max(ids, na.rm = TRUE): aucun argument pour max ; -Inf est renvoyé

Warning in max(ids, na.rm = TRUE): aucun argument pour max ; -Inf est renvoyé

Warning in max(ids, na.rm = TRUE): aucun argument pour max ; -Inf est renvoyé

Warning in max(ids, na.rm = TRUE): aucun argument pour max ; -Inf est renvoyé

Warning in max(ids, na.rm = TRUE): aucun argument pour max ; -Inf est renvoyé

Warning in max(ids, na.rm = TRUE): aucun argument pour max ; -Inf est renvoyé

Warning in max(ids, na.rm = TRUE): aucun argument pour max ; -Inf est renvoyé

Warning in max(ids, na.rm = TRUE): aucun argument pour max ; -Inf est renvoyé

Warning in max(ids, na.rm = TRUE): aucun argument pour max ; -Inf est renvoyé

# with the  dataset with 5 species or more per Order
ggplot(d3, aes(fill=Family, y=log(massM), x=log(massF),colour=Family), show.legend = FALSE) +
  facet_grid(~Order,scales="free")+ facet_wrap(~Order,nrow=3,scales="free")+
  geom_abline(intercept = 0, slope = 1,  color="darkgrey",size=1.2, show.legend = FALSE)+
  geom_point( show.legend = FALSE)+
  geom_smooth(aes(group=Family),method="lm", show.legend = FALSE)
Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
ℹ Please use `linewidth` instead.
`geom_smooth()` using formula = 'y ~ x'

## with the most restricted data set (5 species or more, 10 individuals or more)
ggplot(d3N, aes(fill=Family, y=log(massM), x=log(massF),colour=Family), show.legend = FALSE) +
  facet_grid(~Order,scales="free")+ facet_wrap(~Order,nrow=3,scales="free")+
  geom_abline(intercept = 0, slope = 1,  color="darkgrey",size=1.2, show.legend = FALSE)+
  geom_point( show.legend = FALSE)+
  geom_smooth(aes(group=Family),method="lm", show.legend = FALSE)
`geom_smooth()` using formula = 'y ~ x'

Measures of dimorphism matter when allometry is accounted for

Comparing 3 measures of dimorphism and how they change with female body mass

  1. dimo.pM: as measured in the paper, i.e. (massM-massF)/massM (taking male body mass as a reference)

    =0 for monomorphic species, <0 if female larger than male, >0 if male larger than female,

    =0.5 is male mass is twice as heavy that of female, =-1 if male is half the mass of female)

  2. dimo.pF: (massM-massF)/massF (taking female body mass a a reference)

    =0 for monomorphic species, <0 if female larger than male, >0 if male larger than female

    = 1 if male is twice as heavy as female, = -0.5 if male is half the mass of female

  3. dimo: log(massM/massF)

    =0 for monomorphic species

    <0 if massM<massF, >0 if massF<massM

  4. Ratio: massM/massF

    =1 for monomorphic species

oddSSD<-seq(0.6,2,0.2) ## ratio MassM/massF

FBM<-seq(0,100,10)[-1] ## le vecteur de body mass female 
D<-expand.grid(FBM=FBM,oddSSD=oddSSD)  ## la base de données fictives
D$MBM<-D$FBM*D$oddSSD  ## le vecteur de body mass male pour differents ratio et differetes masses femelles
D$dimo.pM<-(D$MBM*-D$FBM)/D$MBM  ## la mesure de dimo comme dans le papier avec la masse male comme ref
D$dimo.pF<-(D$MBM*-D$FBM)/D$FBM ## la mesure de dimo  comme dans le papier mais avec la masse femelle comme ref
D$dimo<-log(D$MBM/D$FBM) ## la mesure de dimorphisme "correcte" 


ggplot(D, aes( y=dimo.pM, x=dimo,fill=FBM,color=FBM ))+
  facet_grid(~oddSSD)+ facet_wrap(~oddSSD,nrow=4)+
  geom_vline(xintercept = 0, color="red",size=1.2, show.legend = FALSE)+
  geom_point(show.legend = FALSE)+
  geom_smooth(aes(group=oddSSD,colour=oddSSD,fill=oddSSD),method="lm", show.legend = FALSE)
`geom_smooth()` using formula = 'y ~ x'

ggplot(D, aes( y=dimo.pM, x=dimo.pF,fill=FBM,color=FBM ))+
  facet_grid(~oddSSD)+ facet_wrap(~oddSSD,nrow=4)+
  geom_abline(intercept = 0, slope=1,color="red",size=1.2, show.legend = FALSE)+
  geom_point(show.legend = FALSE)+
  geom_smooth(aes(group=oddSSD,colour=oddSSD,fill=oddSSD),method="lm", show.legend = FALSE)
`geom_smooth()` using formula = 'y ~ x'

ggplot(D, aes( y=dimo.pF, x=dimo,fill=FBM,color=FBM ))+
  facet_grid(~oddSSD)+ facet_wrap(~oddSSD,nrow=4)+
  geom_vline(xintercept = 0, color="red",size=1.2)+
  geom_point(show.legend = FALSE)+
  geom_smooth(aes(group=oddSSD,colour=oddSSD,fill=oddSSD),method="lm")
`geom_smooth()` using formula = 'y ~ x'

ggplot(D, aes( y=dimo.pF, x=oddSSD,fill=as.factor(FBM ),color=as.factor(FBM )))+
 # facet_grid(~oddSSD)+ facet_wrap(~oddSSD,nrow=4)+
  geom_vline(xintercept = 1, color="red",size=1.2)+
  geom_point()

 geom_smooth(formula=y~a*x+b, method="lm", show.legend = FALSE)
geom_smooth: na.rm = FALSE, orientation = NA, se = TRUE
stat_smooth: na.rm = FALSE, orientation = NA, se = TRUE, method = lm, formula = y ~ a * x + b
position_identity