Description Usage Arguments Details Value Note Author(s)

Function for performing a Numeric Predictive Check (NPC).

1 2 3 |

`exp_data` |
data frame containing experimental data. |

`sim_data` |
data frame containing all simulated data. Should have the same data points as exp_data, simply multiple simulations of them. |

`pct` |
vector of the sizes (in %) of the prediction intervals to be tested. |

`nreps` |
numeric. The number of simulations performed. |

`dv_col` |
name of column containing DV, for both exp_data and sim_data. |

`full` |
TRUE (default) or FALSE. If TRUE, then the function returns maximum output and plots (see Details). |

`save_path` |
path for folder to save plots. |

`ind_var_col` |
name of column for independent variable for normalised NPC plots (normally TIME or TAD), for both exp_data and sim_data. |

`bins` |
numeric vector defining bins for the normalised NPC plots. If set to FALSE then normalised NPC plots not generated. |

`name_stub` |
string to be added to the file names of the 3 plots that are saved by the function. |

If full==FALSE:

This function will return a named numeric vector, the same length as pct indicating what % of the experimental
data lies within each prediction interval tested.

If full==TRUE:

This function will return a list with 8 elements:

$exp_count

$df_NPC

$pct_within_interval

$pct_above_interval

$pct_below_interval

$n_within_interval

$n_above_interval

$n_below_interval

$exp_count is simply the number of experimental data points.

$df_NPC is a copy of exp_data with some columns added: 5th, 50th, 95th percentiles of simulated data; normalised_NPC, defined as

*normalised_NPC = (DV - median of simulations) / abs(5th OR 95th percentile of simulations - median of simulations),*

where 95th percentile is used if *DV > median* and 5th percentile is used if *DV < median*.

If *normalised_NPC = 0*, then observation = median of simulations.

If *normalised_NPC = +1*, then observation = 95th percentile of simulations.

If *normalised_NPC = -1*, then observation = 5th percentile of simulations.

Note that

*$pct_within_interval + $pct_above_interval + $pct_below_interval = 100.*

A series of NPC plots, as well as a list or vector of information (see Details).

Deciding if a number is within the prediction interval is inclusive at both ends. i.e. if the number is equal to either of the quantile limits, it will be considered to be in the interval.

Rupert Austin, Aaron Hayman

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.