lfstrclus(group = NULL, strata = NULL, weights = NULL,
haul = NULL, len = NULL, number = NULL, binsize = NULL,
resamples = 100)
Ds
is calculated as
$$p_j=\frac{\sum{A_k\bar{X}}_{jk}}{\sum{A_k\bar{X}}_k}$$
where $A_k$ is the weight of stratum k, $\bar{X}_{jk}$ is the mean number per haul of length class j
in stratum k
, and
$\bar{X}_k$ is the mean number per haul in stratum k
. The numerator and denominator are summed over all k
. Before calculation of
cumulative proportions, the length class distributions for each group are corrected for missing lengths and are
constructed so that the range and intervals of each distribution match.
It is assumed all fish caught are measured. If subsampling occurs, the numbers at length (measured) must be expanded to the total caught.
To generate the empirical probability density function (pdf), length data of hauls from all strata are pooled and then hauls are randomly assigned without replacement
to each stratum with haul sizes equal to the original number of stratum hauls. Cumulative proportions are
then calculated as described above. The K-S statistic is calculated from the cumulative length frequency distributions of the two groups
of randomized data. The randomization procedure is repeated resamples
times to
obtain the pdf of D. To estimate the significance of Ds, the proportion of all randomized D values
that were greater than or equal to Ds, including the occurrence of Ds in the numerator and denominator, is calculated
(Manly, 1997).
Data vectors described in arguments
should be aggregated so that each record contains the number of fish in each length class by group, strata, weights, and haul identifier. For example,
group
stratum
weights
tow
length
number
North 10 88 1 10 2
North 10 88 1 12 5
North 10 88 2 11 3
North 11 103 1 10 17
North 11 103 2 14 21
. . . . . .
. . . . . .
South 31 43 1 12 34
South 31 43 1 14 3
}
To correctly calculate the stratified mean number per haul, zero tows must be included in the dataset.
To designate records for zero tows, fill the length class and number at length with zeros. The first line in
the following table shows the appropriate coding for zero tows:
group
stratum
weights
tow
length
number
North 10 88 1 0 0
North 10 88 2 11 3
North 11 103 1 10 17
North 11 103 2 14 21
. . . . . .
. . . . . .
South 31 43 1 12 34
South 31 43 1 14 3
}lfclus
data(codstrcluslen)
lfstrclus(
group=codstrcluslen$region,strata=codstrcluslen$stratum,
weights=codstrcluslen$weights,haul=codstrcluslen$tow,
len=codstrcluslen$length,number=codstrcluslen$number,
binsize=5,resamples=100)
Run the code above in your browser using DataLab