SCOBI_deux_fast: Uses PBT assignments and other data to estimate group...

Description Usage Arguments Details Value

View source: R/SCOBI_deux_fast.R

Description

SCOBI_deux_fast Uses PBT assignments and tag rates to calculate composition estimates and adjust estimates based on the tag rates. Confidence intervals are generated by non-parametric bootstrapping.This version of the function is faster than SCOBI_deux when you have multiple Hierarch_variables, but can not handle high levels of missing data (it will throw an error if you try).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
SCOBI_deux_fast(
  adultData = NULL,
  windowData = NULL,
  Run = "output",
  RTYPE = "wild",
  Hierarch_variables = NULL,
  SizeCut = NULL,
  alph = 0.1,
  B = 5000,
  writeBoot = FALSE,
  pbtRates = NULL,
  adClipVariable = "AdClip",
  physTagsVariable = "PhysTag",
  pbtGroupVariable = "GenParentHatchery",
  lengthVariable = "LGDFLmm",
  dataGroupVariable = "WeekNumber",
  screenOutput = NULL,
  spibetr = TRUE
)

Arguments

adultData

This is the detailed dataset that is used to determine composition. In dam escapement, this is the "trap" data. It can either be a dataframe or the path to a csv file with a header.

windowData

This is the dataset that gives the census numbers for each strata (such as time period or location). In dam escapement, this is the "window count" dataset. It can either be a dataframe or the path to a csv file with a header. The first column has the groups as listed in the dataGroupVariable column of the adultData. The second column is the census count for that data group. The third column is the strata that data group belongs to. The purpose of this is to allow a user to easily reconfigure groups of observations into different strata.

Run

This is a prefix that will be appended to all output files.

RTYPE

This is the type of fish that you want to analyze for the Hierarch_variables. Options are: "clipped", "noclip_H", "wild", representing Ad-clipped hatchery, Ad-intact hatchery, and wild fish, respectively.

Hierarch_variables

These are the variables (column names in adultData) that you want to assess RTYPE for in the order you want them to be assessed.

SizeCut

Fish less than this value will be put into a "Small" category, and fish greater or equal to this value will be put into a "Large" category. This is intended for easy analysis of jacks or large and small steelhead.

alph

This is the alpha value to use for confidence intervals. So, an alph of .05 will give a 95% CI, with quantiles at .025 and .975.

B

This is the number of bootstrap iteratiosn to perform. To skip bootstraping and only produce point estiamtes, use a value of 0.

writeBoot

If TRUE, the values for each bootstrap iteration will be written.

pbtRates

This is either a dataframe or the path to a csv file with a header. The first column contains the names of all the pbtGroupVariable values, and the second column contains their respective tag rates.

adClipVariable

This is the name of the variable that has the ad-clip and ad-intact status of all samples. Values in this column shoudl either be "AD" or "AI" for ad-clipped and ad-intact, respectively. NA values are considered missing and are removed from the dataset prior to any analysis.

physTagsVariable

This is the name of the variable that has information on physical tags (such as CWTs). Fish with a physical tag that identifies them as hatchery origin should have the value "tag" and fish without such a physical tag should have the value "notag". Fish that were not assessed for the presence of a physical tag should have the value NA.

pbtGroupVariable

This is the name of the variable that has the pbt group that a fish assigned to. Fish that did not assign to any group should be given the value of "Unassigned". Fish that were not assessed with PBT, for example they failed to genotype or were not genotyped, should be given the value of NA.

lengthVariable

This is the name of the variable that has numberic lengths if the SizeCut option is being used.

dataGroupVariable

This is the name of the variable that has the grouping that each sample belongs to for pooling into strata, with the values matching the values given in the first column of windowData.

screenOutput

This is the name of the file to write all output the would otherwise be printed to the console. If not specified, output is printed to the console.

spibetr

If this is TRUE, then the composition estimates of the wild fish will be corrected to account for the expected number and composition of the unclipped, untagged hatchery fish present in the wild sample. It this is FALSE, the total number of wild fish will be reduced in accordance with the expected number of uncliipped, untagged hatchery fish, but the composition of the wild fish will not be corrected. When TRUE, the method is the "Ac" method described in the paper. When FALSE, the method is the "TotEx" method described in the paper.

Details

This function uses the "accounting-style" method (Ac) described by Delomas and Hess (in review) to estimate composition of various groups when using PBT with tag rates less than 100 provide estimates for three groups of fish, based on fishery managment of Salmonids: Ad-clipped, Ad-intact hatchery, and Ad-intact wild. The paper describes how the data for all Ad-intact fish sampled is used to estimate the composition of Ad-intact hatchery and wild fish. If both Ad-clipped and Ad-intace fish are present in the input dataset, the total number of Ad-clipped fish is estimated using the ratio of Ad-clipped fish to Ad-intact fish in the input data. If the pbtGroupVariable is included in the Hierarch_variables option, then the composition of the Ad-clipped fish is calculated analagously to the method described in the paper for the Ad-intact hatchery and wild fish, but the wild group is now the fish which are Unassigned by PBT. If the pbtGroupVariable is NOT included in the Hierarch_variables option, then the estimates are simply made by calculating the relative numbers of observed fich in each category of the Hierarch_variables option (ie, tag rates are NOT used). This is because it is assumed the sampled PBT Untagged fish that are Ad-clipped are still identified as being Ad-clipped, and so can be used to estimate composition. This function is written to have an a user interface similar to that of a function written for a similar purpose in a different package by different authors, SCOBI.

Value

A string is returned simply stating that the analysis is complete. All of the output of the function is written to the working directory. These files are: .... .... ....


delomast/fishCompTools documentation built on Jan. 11, 2021, 1:51 a.m.