simAgeBias {FSATeach} R Documentation

## Simulate an age bias and simulate the ages of fish using the age bias.

### Description

Constructs an age-bias table interactively. This age-bias table can then be used to convert the true ages of a sample of fish to ‘biased’ ages.

### Usage

```  simAgeBias(max.age = 10, show.props = TRUE, scale = TRUE)

simApplyAgeBias(ages, bias.table = NULL,
agree.table = NULL)
```

### Arguments

 `max.age` A numeric indicating the maximum age to be modelled in the age bias table. `show.props` A logical indicating whether proportions of fish at x-axis age or numbers of fish should be shown on the interactive plot (`=TRUE`; default) or not. `scale` A logical indicating whether the plotted value of the proportions or numbers should be scaled in relation to their numeric value (`=TRUE`; default) or not. `ages` A vector containg the ‘true’ ages of individual fish. `bias.table` A table that contains, as columns, the proportion of fish of a certain ‘true’ age in various ‘biased’ ages – i.e., a column-proportions table constructed from an age agreement table where the ‘true’ ages correspond to columns. `agree.table` A table that contains the age-agreement table where the ‘true’ ages correspond to columns.

### Details

NEED DETAIL HERE.

### Value

If `simApplyAgeBias` is used then a vector of ‘biased’ ages is returned. If `simAgeBias` is used then a list with the following two items is returned:

• agree a table containing the age agreement table resulting from the interactive process.

• bias a table containing the bias table resulting from the interactive process.

`simAges`, `ageComp` in FSA

### Examples

```## set seed for repeatability
set.seed(5234734)

## Simulated individual ages (random)
#    see simAges functions
bg.ages <- simAges(N0=500,A=0.35)
summary(bg.ages)

## Simulated ages given the above 'true' ages and age biases from interactive choices
#  NOT RUN because of interactive choices
## Not run:
bg.ab <- simAgeBias(max.age=max(bg.ages))
bg.ages2 <- simApplyAgeBias(bg.ages,bg.ab\$bias)
summary(bg.ages2)

## End(Not run)
```

[Package FSATeach version 0.0.1 Index]