Convenience function for calculating (traditional) PSD-X and (incremental) PSD X-Y values for all Gabelhouse lengths and increments thereof.
A formula of the form ~length
where “length” generically represents a variable in data
that contains the observed lengthsNote that this formula may only contain one variable and it must be numeric.
A data.frame that minimally contains the observed lengths given in the variable in formula
.
A string that contains the species name for which Gabelhouse lengths existSee psdVal
for details.
A string that indicates the type of units used for the lengthsChoices are mm
for millimeters (DEFAULT), cm
for centimeters, and in
for inches.
A character that identifies the confidence interval method to useSee details in psdCI
.
A number that indicates the level of confidence to use for constructing confidence intervals (default is 0.95
).
A numeric vector that contains minimum lengths for additional categoriesSee psdVal
for details.
A string vector that contains names for the additional lengths added with addLens
See psdVal
for details.
A logical that indicates whether just the values related to the length sin addLens
should be returned.
A string that indicates the type of PSD values that will be printedSee details.
A logical that indicates whether the PSD values that are zero should be dropped from the output.
A logical that indicates whether the number of fish in the category and the number of stock fish (i.e., “intermediate” values) should be included in the returned matrixDefault is to not include these values.
A numeric that indicates the number of decimals to round the result toDefault is zero digits following the recommendation of Neumann and Allen (2007).
A matrix with columns that contain the computed PSD-X or PSD X-Y values and associated confidence intervalsIf showIntermediate=TRUE
then the number of fish in the category and the number of stock fish will also be shown.
Computes the (traditional) PSD-X and (incremental) PSD X-Y values, with associated confidence intervals, for each Gabelhouse lengthAll PSD-X and PSD X-Y values are printed if what="all"
(DEFAULT), only PSD-X values are printed if what="traditional"
, only PSD X-Y values are printed if what="incremental"
, and nothing is printed (but the matrix is still returned) if what="none"
.
Confidence intervals can be computed with either the multinomial (Default) or binomial distribution as set in method
See details in psdCI
for more information.
Point estimate calculations match those constructed "by hand."
6-Size Structure.
Ogle, D.H. 2016. Introductory Fisheries Analyses with RChapman & Hall/CRC, Boca Raton, FL.
Guy, C.S., R.M. Neumann, and D.W. Willis2006New terminology for proportional stock density (PSD) and relative stock density (RSD): proportional size structure (PSS)Fisheries 31:86-87 [Was (is?) from http://pubstorage.sdstate.edu/wfs/415-F.pdf.]
Guy, C.S., R.M. Neumann, D.W. Willis, and R.O. Anderson2006Proportional size distribution (PSD): A further refinement of population size structure index terminologyFisheries 32:348[Was (is?) from http://pubstorage.sdstate.edu/wfs/450-F.pdf.]
Neumann, R. M. and Allen, M. S2007Size structure. In Guy, C. S. and Brown, M. L., editors, Analysis and Interpretation of Freshwater Fisheries Data, Chapter 9, pages 375-421. American Fisheries Society, Bethesda, MD.
Willis, D.W., B.R. Murphy, and C.S. Guy1993Stock density indices: development, use, and limitationsReviews in Fisheries Science 1:203-222[Was (is?) from http://web1.cnre.vt.edu/murphybr/web/Readings/Willis%20et%20al.pdf.]
## Random length data
# suppose this is yellow perch to the nearest mm
yepdf <- data.frame(yepmm=round(c(rnorm(100,mean=125,sd=15),
rnorm(50,mean=200,sd=25),
rnorm(20,mean=300,sd=40)),0),
species=rep("Yellow Perch",170))
psdCalc(~yepmm,data=yepdf,species="Yellow perch",digits=1)
#> Warning: Some category sample size <20, some CI coverage may be
#> lower than 95%.
#> Estimate 95% LCI 95% UCI
#> PSD-Q 37.1 22.6 51.7
#> PSD-P 19.0 7.2 30.9
#> PSD-M 7.6 0.0 15.6
#> PSD-T 1.0 0.0 3.9
#> PSD S-Q 62.9 48.3 77.4
#> PSD Q-P 18.1 6.5 29.7
#> PSD P-M 11.4 1.9 21.0
#> PSD M-T 6.7 0.0 14.2
psdCalc(~yepmm,data=yepdf,species="Yellow perch",digits=1,drop0Est=TRUE)
#> Warning: Some category sample size <20, some CI coverage may be
#> lower than 95%.
#> Estimate 95% LCI 95% UCI
#> PSD-Q 37.1 22.6 51.7
#> PSD-P 19.0 7.2 30.9
#> PSD-M 7.6 0.0 15.6
#> PSD-T 1.0 0.0 3.9
#> PSD S-Q 62.9 48.3 77.4
#> PSD Q-P 18.1 6.5 29.7
#> PSD P-M 11.4 1.9 21.0
#> PSD M-T 6.7 0.0 14.2
## add a length
psdCalc(~yepmm,data=yepdf,species="Yellow perch",addLens=150)
#> Warning: Some category sample size <20, some CI coverage may be
#> lower than 95%.
#> Estimate 95% LCI 95% UCI
#> PSD-150 70 56 85
#> PSD-Q 37 21 53
#> PSD-P 19 6 32
#> PSD-M 8 0 16
#> PSD-T 1 0 4
#> PSD S-150 30 15 44
#> PSD 150-Q 33 18 49
#> PSD Q-P 18 6 31
#> PSD P-M 11 1 22
#> PSD M-T 7 0 15
## add lengths with names
psdCalc(~yepmm,data=yepdf,species="Yellow perch",addLens=150,addNames="minLen")
#> Warning: Some category sample size <20, some CI coverage may be
#> lower than 95%.
#> Estimate 95% LCI 95% UCI
#> PSD-minLen 70 56 85
#> PSD-Q 37 21 53
#> PSD-P 19 6 32
#> PSD-M 8 0 16
#> PSD-T 1 0 4
#> PSD S-minLen 30 15 44
#> PSD minLen-Q 33 18 49
#> PSD Q-P 18 6 31
#> PSD P-M 11 1 22
#> PSD M-T 7 0 15
psdCalc(~yepmm,data=yepdf,species="Yellow perch",addLens=c("minLen"=150))
#> Warning: Some category sample size <20, some CI coverage may be
#> lower than 95%.
#> Estimate 95% LCI 95% UCI
#> PSD-minLen 70 56 85
#> PSD-Q 37 21 53
#> PSD-P 19 6 32
#> PSD-M 8 0 16
#> PSD-T 1 0 4
#> PSD S-minLen 30 15 44
#> PSD minLen-Q 33 18 49
#> PSD Q-P 18 6 31
#> PSD P-M 11 1 22
#> PSD M-T 7 0 15
psdCalc(~yepmm,data=yepdf,species="Yellow perch",addLens=c(150,275),addNames=c("minSlot","maxSlot"))
#> Warning: Some category sample size <20, some CI coverage may be
#> lower than 95%.
#> Estimate 95% LCI 95% UCI
#> PSD-minSlot 70 55 86
#> PSD-Q 37 20 54
#> PSD-P 19 5 33
#> PSD-maxSlot 15 3 28
#> PSD-M 8 0 17
#> PSD-T 1 0 4
#> PSD S-minSlot 30 14 45
#> PSD minSlot-Q 33 17 50
#> PSD Q-P 18 5 31
#> PSD P-maxSlot 4 0 10
#> PSD maxSlot-M 8 0 17
#> PSD M-T 7 0 15
psdCalc(~yepmm,data=yepdf,species="Yellow perch",addLens=c("minLen"=150,"maxslot"=275))
#> Warning: Some category sample size <20, some CI coverage may be
#> lower than 95%.
#> Estimate 95% LCI 95% UCI
#> PSD-minLen 70 55 86
#> PSD-Q 37 20 54
#> PSD-P 19 5 33
#> PSD-maxslot 15 3 28
#> PSD-M 8 0 17
#> PSD-T 1 0 4
#> PSD S-minLen 30 14 45
#> PSD minLen-Q 33 17 50
#> PSD Q-P 18 5 31
#> PSD P-maxslot 4 0 10
#> PSD maxslot-M 8 0 17
#> PSD M-T 7 0 15
## add lengths with names, return just those values that use those lengths
psdCalc(~yepmm,data=yepdf,species="Yellow perch",addLens=c("minLen"=150),justAdds=TRUE)
#> Warning: Some category sample size <20, some CI coverage may be
#> lower than 95%.
#> Estimate 95% LCI 95% UCI
#> PSD-minLen 70 56 85
#> PSD S-minLen 30 15 44
#> PSD minLen-Q 33 18 49
psdCalc(~yepmm,data=yepdf,species="Yellow perch",addLens=c("minLen"=150),justAdds=TRUE,
what="traditional")
#> Warning: Some category sample size <20, some CI coverage may be
#> lower than 95%.
#> Estimate 95% LCI 95% UCI
#> 70 56 85
psdCalc(~yepmm,data=yepdf,species="Yellow perch",addLens=c(150,275),
addNames=c("minSlot","maxSlot"),justAdds=TRUE)
#> Warning: Some category sample size <20, some CI coverage may be
#> lower than 95%.
#> Estimate 95% LCI 95% UCI
#> PSD-minSlot 70 55 86
#> PSD-maxSlot 15 3 28
#> PSD S-minSlot 30 14 45
#> PSD minSlot-Q 33 17 50
#> PSD P-maxSlot 4 0 10
#> PSD maxSlot-M 8 0 17
psdCalc(~yepmm,data=yepdf,species="Yellow perch",addLens=c(150,275),
addNames=c("minSlot","maxSlot"),justAdds=TRUE,what="traditional")
#> Warning: Some category sample size <20, some CI coverage may be
#> lower than 95%.
#> Estimate 95% LCI 95% UCI
#> PSD-minSlot 70 55 86
#> PSD-maxSlot 15 3 28
## different output types
psdCalc(~yepmm,data=yepdf,species="Yellow perch",addLens=150,what="traditional")
#> Warning: Some category sample size <20, some CI coverage may be
#> lower than 95%.
#> Estimate 95% LCI 95% UCI
#> PSD-150 70 56 85
#> PSD-Q 37 21 53
#> PSD-P 19 6 32
#> PSD-M 8 0 16
#> PSD-T 1 0 4
psdCalc(~yepmm,data=yepdf,species="Yellow perch",addLens=150,what="incremental")
#> Warning: Some category sample size <20, some CI coverage may be
#> lower than 95%.
#> Estimate 95% LCI 95% UCI
#> PSD S-150 30 15 44
#> PSD 150-Q 33 18 49
#> PSD Q-P 18 6 31
#> PSD P-M 11 1 22
#> PSD M-T 7 0 15
psdCalc(~yepmm,data=yepdf,species="Yellow perch",addLens=150,what="none")
#> Warning: Some category sample size <20, some CI coverage may be
#> lower than 95%.
## Show intermediate values
psdCalc(~yepmm,data=yepdf,species="Yellow perch",showInterm=TRUE)
#> Warning: Some category sample size <20, some CI coverage may be
#> lower than 95%.
#> num stock Estimate 95% LCI 95% UCI
#> PSD-Q 39 105 37 23 52
#> PSD-P 20 105 19 7 31
#> PSD-M 8 105 8 0 16
#> PSD-T 1 105 1 0 4
#> PSD S-Q 66 105 63 48 77
#> PSD Q-P 19 105 18 7 30
#> PSD P-M 12 105 11 2 21
#> PSD M-T 7 105 7 0 14
psdCalc(~yepmm,data=yepdf,species="Yellow perch",what="traditional",showInterm=TRUE)
#> Warning: Some category sample size <20, some CI coverage may be
#> lower than 95%.
#> num stock Estimate 95% LCI 95% UCI
#> PSD-Q 39 105 37 23 52
#> PSD-P 20 105 19 7 31
#> PSD-M 8 105 8 0 16
#> PSD-T 1 105 1 0 4
psdCalc(~yepmm,data=yepdf,species="Yellow perch",what="incremental",showInterm=TRUE)
#> Warning: Some category sample size <20, some CI coverage may be
#> lower than 95%.
#> num stock Estimate 95% LCI 95% UCI
#> PSD S-Q 66 105 63 48 77
#> PSD Q-P 19 105 18 7 30
#> PSD P-M 12 105 11 2 21
#> PSD M-T 7 105 7 0 14
## Control the digits
psdCalc(~yepmm,data=yepdf,species="Yellow perch",digits=1)
#> Warning: Some category sample size <20, some CI coverage may be
#> lower than 95%.
#> Estimate 95% LCI 95% UCI
#> PSD-Q 37.1 22.6 51.7
#> PSD-P 19.0 7.2 30.9
#> PSD-M 7.6 0.0 15.6
#> PSD-T 1.0 0.0 3.9
#> PSD S-Q 62.9 48.3 77.4
#> PSD Q-P 18.1 6.5 29.7
#> PSD P-M 11.4 1.9 21.0
#> PSD M-T 6.7 0.0 14.2