Calculate the denominator for the level-1 expansion, where the denominator is the weight of all fish in the sample. EF1_Denominator is not run by the user, it is a sub-function of getExpansion_1.

EF1_Denominator(
  Pdata,
  fa = 2e-06,
  fb = 3.5,
  ma = 2e-06,
  mb = 3.5,
  ua = 2e-06,
  ub = 3.5,
  verbose = TRUE,
  plot = FALSE,
  col.weight = "weightkg"
)

Arguments

Pdata

A data frame of biological samples originating from the Pacific Fishieries Information Network (PacFIN) data warehouse, which originated in 2014. Data are pulled using sql calls, see PullBDS.PacFIN().

fa

Female specific weight length coefficient.

fb

Female specific weight length exponent.

ma

Male specific weight length coefficient.

mb

Male specific weight length exponent.

ua

Unsexed weight length coefficient.

ub

Unsexed weight length exponent.

verbose

A logical specifying if output should be written to the screen or not. Good for testing and exploring your data but can be turned off when output indicates information that you already know. The printing of output to the screen does not affect any of the returned objects. The default is to always print to the screen, i.e., verbose = TRUE.

plot

A logical that specifies if plots should be created or not. The default is FALSE.

col.weight

The name of column that contains the weight of the fish in kilograms. Units are important here because kilograms will be converted to pounds to match other weight calculations. The default is weightkg, which is created using cleanPacFIN.

Value

Additional columns are added to Pdata:

  • Wt_Sampled_1: the sum of sex-specific weights within the sample.

  • Wt_Sampled_2: the species-specific sample weight only provided by California in cluster weight.

  • LW_Calc_Wt: individual weights predicted from the specified length-weight relationships.

  • Wt_Sampled_3: The sum of empirical weights, for those fish within a sample where this information is available, and weights calculated from the length-weight relationship. This uses the empirical data if available and fills in with the expected weight or mean-sample weight.

Details

The denominator of the level-1 expansion factor is the weight of the sampled fish in the sample unit, where for fisheries data, this unit is most often the trip level because information on individual hauls is not available. For a survey, tow- or haul-level data are typically available. The sum of the weight in the sample is calculated different for each state based on the data that are available.

Oregon provides information on the weight of females and males in the sample via the WEIGHT_OF_FEMALES and WEIGHT_OF_MALES columns. These are often model-based weights, which would be the only way they can get weights when the fish were not weighed themselves. The weight of unsexed fish is calculated internally by the code and added to the female and male weight. todo: Let Oregon know that this calculation is being done and they may want to provide UNK_WGT.

California sample weights were previously based on the column labeled SPECIES_WEIGHT. Now, California data is parsed by PacFIN to furnish species-specific cluster weights. Prior, cluster weights included the weight of all species in the sample. Now, CLUSTER_WEIGHT is the weight in that cluster for the species of interest. This was verified for dover sole by Kelli F. Johnson in February of 2021. Thus, the code uses CLUSTER_WEIGHT rather than SPECIES_WEIGHT now. todo: determine if this should be the only cluster-specific value going forward?

Washington does not pretend to provide any information regarding total weight of fish in the sample. Therefore, this value is calculated by summing the empirical weight of fish. For fish that were not weighed, a weight is calculated given the input parameters. It is up to the user to calculate these if they want them based on more data than what is included in Pdata. Finally, for fish that have no length and therefore no predicted weight, the mean of fish weight in the sample is used to assign all fish a weight.

Another thing to note in the calculation of the denominator is that sample weights are length- and age-specific values. You would not want to weight an age sample based on how many lengths were measured. So, the weights of fish that are not lengthed are backed out of the sample weight and the weight of fish that are not aged are backed out of the sample weight to create length- and age-specific sample weights. Only these specific sample weights should be used going forward.

Author

Andi Stephens