View source: R/getEmpDistribution.R
getEmpDistribution | R Documentation |
Function to generate the empirical distribution of the runs test statistic, given some data and a model.
getEmpDistribution(
n.sim,
simData,
model,
data,
plot = FALSE,
returnDist = TRUE,
dots = TRUE
)
n.sim |
The number of simulated sets of data. |
simData |
A matrix, where each column is a set of data simulated under independence, with rows the same length as the data used for the model. |
model |
a glm or gamMRSea model object |
data |
data set used to fit the model. |
plot |
logical flag. If TRUE, a plot is made showing the 5% critical values for the empirical distribution vs the N(0,1) distribution. Default is |
returnDist |
logical flag. Do you want the distribution of test statistics returned ( |
dots |
(Default: |
LAS Scott-Hayward, University of St Andrews
data(ns.data.re)
model<-gamMRSea(birds ~ observationhour + as.factor(floodebb) + as.factor(impact),
family='poisson', data=ns.data.re)
simData<-generateNoise(n=500, response=fitted(model), family='poisson')
empdist<-getEmpDistribution(500, simData, model, data=ns.data.re, plot=FALSE,
returnDist=TRUE,dots=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.