Learn R Programming

embryogrowth (version 5.1)

tsd: Estimate the parameters that best describe temperature-dependent sex determination

Description

Estimate the parameters that best describe temperature-dependent sex determination

Usage

tsd(df = NULL, males = NULL, females = NULL, N = NULL,
  temperatures = NULL, durations = NULL, l = 0.05,
  parameters.initial = c(P = NA, S = -0.5, K = 0, K1 = 1, K2 = 0),
  males.freq = TRUE, las.x = 1, las.y = 1,
  lab.PT = "Pivotal temperature",
  lab.TRT = paste0("Transitional range of temperatures l=", l * 100, "%"),
  col.TRT = "gray", col.TRT.CI = rgb(0.8, 0.8, 0.8, 0.5),
  col.PT.CI = rgb(0.8, 0.8, 0.8, 0.5), show.CI = TRUE,
  equation = "logistic", replicate = 1000, range.CI = 0.95,
  limit.low.TRT.minimum = 5, limit.high.TRT.maximum = 90, print = TRUE,
  show.plot = TRUE, ...)

Arguments

df
A dataframe with at least two columns named males, females or N and temperatures, Incubation.temperature or durations column
males
A vector with male numbers
females
A vector with female numbers
N
A vector with total numbers
temperatures
The constant incubation temperatures used to fit sex ratio
durations
The duration of incubation or TSP used to fit sex ratio
l
The limit to define TRT (see Girondot, 1999)
parameters.initial
Initial values for P, S or K search as a vector, ex. c(P=29, S=-0.3)
males.freq
Should the graph uses males frequency [TRUE] or females [FALSE]
las.x
las parameter for x axis
las.y
las parameter for y axis
lab.PT
Label to describe pivotal temperature
lab.TRT
Label to describe transitional range of temperature
col.TRT
The color of TRT
col.TRT.CI
The color of CI of TRT based on range.CI
col.PT.CI
The color of CI of PT based on range.CI
show.CI
Do the CI for the curve should be shown
equation
Could be "logistic", "Hill", "Richards", "Hulin", "Double-Richards" or "GSD"
replicate
Number of replicate to estimate SE of TRT
range.CI
The range of confidence interval for estimation, default=0.95
limit.low.TRT.minimum
Minimum lower limit for TRT
limit.high.TRT.maximum
Maximum higher limit for TRT
print
Do the results must be printed at screen? TRUE (default) or FALSE
show.plot
Do the plot must be shown? TRUE (default) or FALSE
...
Graphical parameters for plot(), exemple xlab="", ylab="", main=""

Value

  • A list the pivotal temperature, transitional range of temperatures and their SE

Details

tsd estimates the parameters that best describe temperature-dependent sex determination

References

Girondot, M. 1999. Statistical description of temperature-dependent sex determination using maximum likelihood. Evolutionary Ecology Research, 1, 479-486.

Godfrey, M.H., Delmas, V., Girondot, M., 2003. Assessment of patterns of temperature-dependent sex determination using maximum likelihood model selection. Ecoscience 10, 265-272.

Hulin, V., Delmas, V., Girondot, M., Godfrey, M.H., Guillon, J.-M., 2009. Temperature-dependent sex determination and global change: are some species at greater risk? Oecologia 160, 493-506.

Girondot M., Submited. On the concept of embryological thermosensitive period for sex determination in reptiles.

Examples

Run this code
CC_AtlanticSW <- subset(STSRE_TSD, RMU=="Atlantic, SW" &
                          Species=="Caretta caretta" & Sexed!=0)
par(mar=c(4,4,5,1)+0.1)
tsdL <- with (CC_AtlanticSW, tsd(males=Males, females=Females,
                                 temperatures=Incubation.temperature-Correction.factor,
                                 equation="logistic"))
tsdH <- with (CC_AtlanticSW, tsd(males=Males, females=Females,
                                 temperatures=Incubation.temperature-Correction.factor,
                                 equation="Hill"))
tsdR <- with (CC_AtlanticSW, tsd(males=Males, females=Females,
                                 temperatures=Incubation.temperature-Correction.factor,
                                 equation="Richards"))
gsd <- with (CC_AtlanticSW, tsd(males=Males, females=Females,
                                 temperatures=Incubation.temperature-Correction.factor,
                                 equation="GSD"))
compare_AIC(Logistic_Model=tsdL, Hill_model=tsdH, Richards_model=tsdR,
               GSD_model=gsd)
##############
eo <- subset(STSRE_TSD, Species=="Emys orbicularis", c("Males", "Females",
                                       "Incubation.temperature"))

eo_Hill <- with(eo, tsd(males=Males, females=Females,
                                       temperatures=Incubation.temperature,
                                       equation="Hill"))
eo_logistic <- tsd(eo)
eo_Richards <- with(eo, tsd(males=Males, females=Females,
                                 temperatures=Incubation.temperature,
                                 equation="Richards"))
### The Hulin model is a modification of Richards (See Hulin et al. 2009)
### limit.low.TRT and limit.high.TRT must be setup for Hulin equation
par <- eo_Richards$par
names(par)[which(names(par)=="K")] <- "K2"
par <- c(par, K1=0)
eo_Hulin <- with(eo, tsd(males=Males, females=Females,
                                 parameters.initial=par,
                                 temperatures=Incubation.temperature,
                                 equation="Hulin",
                                 limit.low.TRT.minimum=25,
                                 limit.high.TRT.maximum=35))
### The Double-Richards model is a Richards model with K1 and K2 using the two values
### below and above P
par <- eo_Richards$par
names(par)[which(names(par)=="K")] <- "K2"
par <- c(par, K1=as.numeric(par["K2"])-0.1)
par["K1"] <- par["K1"]-0.1
eo_Double_Richards <- with(eo, tsd(males=Males, females=Females,
                                 parameters.initial=par,
                                 temperatures=Incubation.temperature,
                                 equation="Double-Richards"))
### Example with only points and mean curve
eo_Double_Richards <- with(eo, tsd(males=Males, females=Females,
                                 parameters.initial=par,
                                 temperatures=Incubation.temperature,
                                 equation="Double-Richards",
                                 col.TRT="white", col.TRT.CI="white", col.PT.CI="white"))
compare_AIC(Logistic=eo_logistic, Hill=eo_Hill, Richards=eo_Richards,
             Hulin=eo_Hulin, Double_Richards=eo_Double_Richards)
### Note the asymmetry of the Double-Richards model
predict(eo_Double_Richards,
       temperatures=c(eo_Double_Richards$par["P"]-0.2, eo_Double_Richards$par["P"]+0.2))
predict(eo_Double_Richards)

Run the code above in your browser using DataLab