F.assign.1dim: F.assign.1dim

F.assign.1dimR Documentation

F.assign.1dim

Description

Assign the missing counts of either variable FinalRun or lifeStage, based on the frequency distribution of the other.

Usage

F.assign.1dim(catch, present.var, absent.var)

Arguments

catch

A data frame containing records of fish itemized by combinations of variables trapVisitID, FinalRun, lifeStage, and forkLength. Variable Unmarked contains the number of fish represented in each record.

present.var

The variable in data frame catch for which data are recorded. This should be one of FinalRun or lifeStage.

absent.var

The variable in the data frame catch for which data are not recorded. This should be the other of FinalRun or lifeStage not utilized in present.var.

Details

Function F.assign.1dim should only be utilized when the value of only one of FinalRun or lifeStage is missing, i.e., one of these variables contains values of "Unassigned". If both are "Unassigned", utilize function F.assign.2dim.

Except in rare cases, only fish for which variable RandomSelection="Yes" contribute to sampling proportions. Thus, fish for which either or both of FinalRun and lifeStage are recorded, but for which variable RandomSelection equals "No", are excluded.

Function F.assign.1dim loops individually over each unique level found in the present.var variable. Within each level, trap occasions, as determined by variable trapVisitID, are examined one-by-one in order to estimate relative frequencies of levels in the absent.var variable, following the exclusion of those recorded as "Unassigned". In this way, an estimate of the relative frequencies of the absent.var, given the level of the present.var and the provided trapVisitID, is obtained.

Estimation of the underlying frequency distribution in a trapVisitID may take place by up to six sequential strategies. The application of a higher strategy only takes place on failure of the one immediately preceding it. The six strategies follow. In most cases, the first applies, and so the others are not considered. In each, the overall relative frequency of the absent.var is obtained via examination of...

  1. ...the levels of absent.var with the same trapVisitID and level of present.var, where RandomSelection="Yes".

  2. ...the levels of absent.var with the same trapVisitID and level of present.var.

  3. ...the levels of absent.var with the same SampleDate and level of present.var, where RandomSelection="Yes".

  4. ...the levels of absent.var with the same SampleDate and level of present.var.

  5. ...the levels of absent.var with the same SampleDate, plus or minus one day, and level of present.var, where RandomSelection="Yes".

  6. ...the levels of absent.var with the same SampleDate, plus or minus one day, and level of present.var.

Relaxation of the randomly selected condition via the lack of consideration of variable RandomSelection in strategies 2, 4, and 6 takes place only within a trapVisitID for which the preceding strategy contained no RandomSelection="Yes" records. The relaxation allows for the possibility that with a small number of caught fish, all are measured. In this case, the entire catch forms the sample and sometimes, variable RandomSelection is set to "No".

When one of strategies 3, 4, 5, 6 is used, the resulting relative frequency of counts found in other trapVisitIDs or neighboring days may not evenly divide the "Unassigned" count of fish recorded in the absent.var variable. In this case, the plus counts are obtained by multiplying the number of "Unassigned" fish by the proportion of fish in each level returned by application of the suitable strategy. When this occurs, round-off error may occur and accumulate over the various levels for which plus-counts are obtained. The difference between the original "Unassigned" count of fish and the sum of the rounded plus counts thus may not equal zero, thus leading to "magic fish." Any non-zero magic fish are randomly allocated to the levels for which rounding occurred via the multinom function. In this way, the data dictate to which levels any magic fish are allocated. Magic fish may be positive or negative quantities, with each being allocated in the appropriate way to ensure that the sum of the final plus-count levels equals the original "Unassigned" count of fish.

Value

A data frame catch with any "Unassigned" counts of fish present in the absent.var variable proportionally allocated to the levels present in the present.var variable. See Details.

Author(s)

WEST Inc.

See Also

F.expand.plus.counts, F.assign2.dim

Examples

## Not run: 
#   ---- Per trapping instance, expand plus counts for fish marked as "Unassigned" 
#   ---- in variable lifeStage, taking into consideration the frequency
#   ---- distribution of variable FinalRun.  
catch2 <- F.assign.1dim(catch, FinalRun, lifeStage)

## End(Not run)


tmcd82070/CAMP_RST documentation built on April 6, 2022, 12:07 a.m.