Skip to contents

Function to run a power analysis for a model of type 'gamMRSea'

Usage

powerSimPll(
  newdat,
  model,
  empdistribution,
  nsim,
  powercoefid,
  predictionGrid = NULL,
  g2k = NULL,
  splineParams = NULL,
  n.boot = 500,
  nCores = 1
)

Arguments

newdat

matrix of values whose rows are observations and columns are simulated sets of response data

model

model object of class gamMRSea. This is the model used to generate the data, updated for the inclusion of an event term.

empdistribution

Empirical distribution for the runs test

nsim

number of simulations to compute

powercoefid

the ID of the coefficient in model that represents the event term

predictionGrid

dataframe containing a coordinate grid with covariates. This grid is used in the assessment of before and after change differences.

g2k

object required for MRSea model with spline terms

splineParams

object required for MRSea model with spline terms

n.boot

Number of bootstraps to use to get percentile based confidence intervals for predictions.

nCores

How many cores to use for parallel processing. If one, then parallel computing is not used and a progress bar is printed. If parallel, estimated time till finish along with a progress bar is provided.

Value

An object of class gamMRSea.power.

rawrob

Vector of zeros and ones indicating whether raw or robust s.e. have been used.

imppvals

p-values for the event change term for each simulated run

betacis

Confidence intervals for the event term coefficient (only if site-wide change)

powsimfits

Fitted values each model

bootdifferences

data frame of bootstrapped differences (before and after event). Number of rows is the number of rows in the prediction grid divided by 2

bootpreds

data frame of bootstrapped predictions.

Abundance

Table of sitewide abundance (with upper and lower 95\% CI)

link

List of the link function (link) and inverse link function (linkinv)

Author

LAS Scott-Hayward, University of St Andrews

Examples

# See the vignette for an example of how to run this code.