Skip to contents

IC_plot

Description

Cumulative percentage of mature females against length. Fitting model for the estimation of the L50 values and its confidence interval.

It returs a graphic representation of the cumulative percentage of mature females as a function of length (points). The fitted model (black line) and its
95% confidence interval (gray shaded area) are included; the horizontal dashed line represents the cumulative ratio of 0.5; the vertical dashed line indicates the L50 value and the outer lines the 95% confidence interval.

The function requires defining:

  • x: A vector containing the values of the independent variable..
  • y: A vector containing the values of the dependent variable..
  • df: A data frame.
  • MClw: Lower value to be defined for the x-axis.
  • MCup: Upper value to be defined for the x-axis
  • CIl: A table with the lower value of nonparametric confidence interval.
  • CIh: A table with the upper value of nonparametric confidence interval.
  • xl: A label for the X-axis.
  • yl: A label for the y-axis.

See also: smooth.spline() from stats R package and rgb() function from the grDevices package

IC_plot

The function is included in the Repbio package Reproductive biology analysis.

#library(Repbio)

The function is detailed below.

IC_plot <- function(x,y,yc,MClw,MCup,CIl,CIh,xl,yl){
  # Prediction lines and confidence intervals are smoothed
  smooth_yc <-  smooth.spline(x, yc, spar=0.4)
  CIls <- smooth.spline(x, CIl, spar=0.4)
  CIhs <- smooth.spline(x, CIh, spar=0.4)
  CIl <- as.vector(CIls$yin)
  CIh <- as.vector(CIhs$yin)

     plot(x,y,
       xlab= xl,
       ylab= yl,
       xlim= c(MClw,MCup),
       ylim= c(0,1),
       xaxt= "n",
       yaxt= "n",
       pch= 16, cex=0.8)
  lines(smooth_yc,col = "black", type = "l", lty = 1)

  polygon(c(x,rev(x)), c(CIl,rev(CIh)),
          col=rgb(0.5, 0.5, 0.5,0.2), border=NA)

 } # End function

Examples

Falta detallar el ejemplo.

 #   IC_plot(x,y,yc,MClw,MCup,CIl,CIh,xl,yl)

References

Salas‐Singh, C., Morales‐Bojórquez, E., & Aguirre‐Villaseñor, H. (2022). Reproductive biology of the bullseye puffer Sphoeroides annulatus: Gonadosomatic index and its suitability for estimating length at maturity. Journal of Fish Biology, 101(5), 1119-1133.https://doi.org/10.1111/jfb.15174