# Computing SE for PSD indices

**fishR Blog**, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)

Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

A user of my Introductory Fisheries Analyses with R book recently asked me how to compute standard errors (SE) for the various PSD indices by using the usual equation for the SE of a proportion (square root of p times (1-p) divided by n). Below is my response using the Inch Lake data from the book.

- Load required packages.

- Load (and prepare) the Inch Lake data used in the Size Structure chapter of the book (this and next step is from this script).

- Compute the PSD-X values.

- Compute the row sums for the
`freq`

table to get the total number of fish (that are stock size or greater). These will be n in the SE calculations.

- Compute the SE for PSD-Q.

- Repeat for other size indices. For example, for PSD-P.

Note that the SE formula is usually used for proportions (and then multiplied by 100 to get a SE for percentages). However, it can also be shown algebraically to be useful for percentages.

I would caution against using these standard errors to produce confidence intervals for the PSD-X values. If confidence intervals are the end-product for this analysis, then I suggest using the methods described in my book.

**leave a comment**for the author, please follow the link and comment on their blog:

**fishR Blog**.

R-bloggers.com offers

**daily e-mail updates**about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.

Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.