psdCI {FSA}R Documentation

Compute confidence intervals for PSD-X and PSD X-Y values.


Compute confidence intervals for (traditional) PSD-X and (incremental) PSD X-Y values as requested by the user.


psdCI(indvec, ptbl, n, method = c("binomial", "multinomial"),
  bin.type = c("wilson", "exact", "asymptotic"), conf.level = 0.95,
  label = NULL, digits = 1)



A numeric vector of 0s and 1s that identify the linear combination of proportions from ptbl that the user is interested in. See details.


A numeric vector or array that contains the proportion or percentage of all individuals in each length category. See details.


A single numeric of the number of fish used to construct ptbl.


A string that identifies the confidence interval method to use. See details.


A string that identifies the type of method to use for calculation of the confidence intervals when Rmethod="binomial". See details of binCI.


A number that indicates the level of confidence to use for constructing confidence intervals (default is 0.95).


A single string that can be used to label the row of the output matrix.


A numeric that indicates the number of decimals to round the result to.


Computes confidence intervals for (traditional) PSD-X and (incremental) PSD X-Y values. Two methods can be used as chosen with method=. If method="binomial" then the binomial distribution (via binCI()) is used. If method="multinomial" then the multinomial method described by Brenden et al. (2008) is used. This function is defined to compute one confidence interval so method="binomial" is the default. See examples and psdCalc for computing several simultaneous confidence intervals.

A table of proportions within each length category is given in ptbl. If ptbl has any values greater than 1 then it is assumed that a table of percentages was supplied and the entire table will be divided by 100 to continue. The proportions must sum to 1 (with some allowance for rounding).

A vector of length equal to the length of ptbl is given in indvec which contains zeros and ones to identify the linear combination of values in ptbl to use to construct the confidence intervals. For example, if ptbl has four proportions then indvec=c(1,0,0,0) would be used to construct a confidence interval for the population proportion in the first category. Alternatively, indvec=c(0,0,1,1) would be used to construct a confidence interval for the population proportion in the last two categories. This vector must not contain all zeros or all ones.


A matrix with columns that contain the computed PSD-X or PSD X-Y value and the associated confidence interval. The confidence interval values were set to zero or 100 if the computed value was negative or greater than 100, respectively.


The multinomial results match the results given in Brendent et al. (2008).

IFAR Chapter

6-Size Structure.


Derek H. Ogle,


Ogle, D.H. 2016. Introductory Fisheries Analyses with R. Chapman & Hall/CRC, Boca Raton, FL.

Brenden, T.O., T. Wagner, and B.R. Murphy. 2008. Novel tools for analyzing proportional size distribution index data. North American Journal of Fisheries Management 28:1233-1242. [Was (is?) from]

See Also

See psdVal, psdPlot, psdAdd, PSDlit, tictactoe, lencat, and rcumsum for related functionality.


## similar to Brenden et al. (2008)
n <- 997
ipsd <- c(130,491,253,123)/n

## single binomial
psdCI(c(1,0,0,0),ipsd,n=n,label="PSD S-Q")

## single multinomial
psdCI(c(1,0,0,0),ipsd,n=n,method="multinomial",label="PSD S-Q")

## multiple multinomials (but see psdCalc())
lbls <- c("PSD S-Q","PSD Q-P","PSD P-M","PSD M-T","PSD","PSD-P")
imat <- matrix(c(1,0,0,0,
rownames(imat) <- lbls

mcis <- t(apply(imat,MARGIN=1,FUN=psdCI,ptbl=ipsd,n=n,method="multinomial"))
colnames(mcis) <- c("Estimate","95% LCI","95% UCI")

## Multiple "Bonferroni-corrected" (for six comparisons) binomial method
bcis <- t(apply(imat,MARGIN=1,FUN=psdCI,ptbl=ipsd,n=n,conf.level=1-0.05/6))
colnames(bcis) <- c("Estimate","95% LCI","95% UCI")

[Package FSA version Index]