mocis | R Documentation |
The main analysis function
mocis(file, vars = NULL, n0 = 4, outdir = NULL, add.vars = NULL,
sheet = 1, nyears = 5, alpha = 0.05, crit = "gcv",
fat_adj = fat_adjust(), generate_tables = TRUE, verbose = FALSE,
agesel = age_select(), GRU = 1, roblm = FALSE, robsm = FALSE,
lims = limits(), ord = statorder(), stationnames = stations(),
specs = species(), yearvar = "YWD", subset_years = 10,
b.pow = 0.1, power = 0.8, n.pow = 10)
file |
The Excel file which holds the data |
vars |
Variables that should be analyzed |
n0 |
For use in |
outdir |
Output directory. Defaults to the current working directory in left empty. |
add.vars |
Additional variables. The function tries to guess some sensible variables if left empty. |
sheet |
The sheet containing the data in the Excel file. Deafults to 1. |
nyears |
The minimum number of years that should be available for analysis. Defaults to 5. |
alpha |
The p-value threshold. Defaults to 0.05 |
crit |
Criterion for automatic bandwidth selection. A character, "gcv" or "aic". Degaults to "gcv". |
fat_adj |
A list with rules for fat adjustment. Defaults to |
generate_tables |
Logical. Should tables be generated? Deafaults to TRUE. |
verbose |
Logical. If TRUE, prints the progress. |
agesel |
A list with rules for the age selection. Defaults to |
GRU |
For birds. Selection based on the GRU variable. Defaults to 1. |
roblm |
Logical. If TRUE, performs a robust linear model. Experimental. |
robsm |
Logical. If TRUE, performs a robust smooth. Experimental. |
lims |
Limits for the contaminants. Defaults to |
ord |
A list of |
stationnames |
A list with station names. Defaults to
|
yearvar |
The variable containing the years. Defaults to "YWD". |
subset_years |
Select a subset of years to run the analyses on. Defaults to 10. |
b.pow |
The slope, as a fraction e.g. 10 power calculations. Deafults to 0.1. |
power |
The desired power. Befaults to 0.8. |
n.pow |
The number of years for the power calculations. Defaults to 10. |
Main function to perform the analyses, i.e. linear model fit, smooth fit, outlier detection and creation of tables
A list with elements:
data
A data.frame
containing the raw data.
aggdata
A data.frame
containing the aggregated data
(yearly geometric mean values, yearly geometric standard deviations,
number of measurements per year, if all values were below the LOD).
m
Overall geometric mean value with 95
limit
A list with elements tv
the target value and
fat
the average fat percentage in the series.
linmod
Output from do_reg
.
linmod10
Output from do_reg
applied to the last 10
years in the series if applicable.
smooth
Output from do_smooth
.
changepoint
Output from do_changep
.
fatadjust
Either 1 or 0 dependeing on whether fat adjustment
was done or not.
stattype
A character vector of length 2 denoting which type
of file was analyzed.
Erik Lampa
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.