Description Usage Arguments Details Value References See Also Examples
This function allows investigating the effect of sample size on estimates and precision of stable isotope mixing solutions. User can modify the sample size for one chosen source, for all sources or for the consumer. See details section for further information.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
package |
a character of length 1. The package name to be used to
estimate mixing proportions. Must be one of |
mix |
a named list. The output returned by the
|
source |
a named list. The output returned by the
|
discr |
a named list. The output returned by the
|
type |
a character of length 1 indicating the type of analysis to run.
Must be one of |
nsamples |
a numeric vector with the sample sizes to simulate. |
modify |
a character of length 1. The source name to modify
(case sensitive). This argument has to be specified when
|
nrep |
an integer of length 1 specifying the number of replicates for
each sample sizes. Default is |
interval |
an integer of length 1 indicating the width of credible
interval to use for precision estimation. Default is |
name |
a character of length 1 giving the name of the simulation.
If |
resid_err |
a logical value indicating if residual error is included in
the model. See |
process_err |
a logical value indicating if process error is included
in the model. See |
run |
a character string or a list specifying MCMC parameters. See
|
alpha.prior |
a numeric of length 1 specifying the Dirichlet prior on
p.global. See |
path |
a character string of length 1. The directory to save results. This directory must exist and can be an absolute or a relative path. Default is the current working directory. |
This function assesses the sensitivity of isotopes mixing models to
variation in numbers of samples from source tissues. This tool can be used
prior to full-blown studies in a similar manner than power analyses. It used
the function siar::siarmcmcdirichletv4()
. Alternatively, it can be used
with the function MixSIAR::run_model()
. User can choose to sample one
particular source (argument type
sets to 'one source'
) or all the
sources in the same type (argument type
sets to 'all sources'
). User can
also choose to modify consumer data (argument type
sets to 'consumer'
).
Sample sizes are modified assuming a normal distribution with a user defined
mean and standard deviation. Samples of different sizes are created from
this distribution, and mixing proportions are estimated for several
replicates of each sample size with the function
siar::siarmcmcdirichletv4()
or MixSIAR::run_model()
.
This function does not return any object in the R console. Results
are stored in a directory (argument name
) and contain four R objects:
intervals
: a four dimensions array with the upper and lower bounds of
the credible interval for each sample size, replicate and source. First
dimension represents lower and upper bounds; second dimension corresponds to
the number of sources; third dimension is the number of replicates; and
fourth dimension is the number of sample size.
widths
: a three dimensions array with the width (precision) of credible
intervals for each source, each replicate and each sample size. First
dimension corresponds to the number of replicates; second dimension is the
number of sources; and third dimension represents the number of sample size.
medians
: a three dimensions array with the median (estimate) of credible
intervals for each source, each replicate and each sample size. Dimensions
are the same as for widths object.
datasets
: a four dimensions array with all re-sampled datasets.
A log file is also written and contains all parameters of the simulation.
Lecomte N., Ehrich D., Casajus N., Berteaux D., Cameron C., and Yoccoz N.G. How many is enough? An R package for evaluating the effect of sample size on estimates and precision of stable isotope mixing solutions. Submitted to Methods in Ecology and Evolution.
get_output()
, plot_samplesim()
, plot_isospace()
1 2 3 4 5 | ## Not run:
## Please visit the vignette available at:
## https://ahasverus.github.io/samplesim/articles/samplesim.html
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.