Learn R Programming

A3 (version 0.9.2)

a3.base: Base A3 Results Calculation

Description

This function calculates the A3 results. Generally this function is not called directly. It is simpler to use a3 (for arbitrary models) or a3.lm (specifically for linear regressions).

Usage

a3.base(formula, data, model.fn, simulate.fn,
    n.folds = 10,
    data.generating.fn = replicate(ncol(x), a3.gen.default),
    p.acc = 0.01, features = TRUE)

Arguments

formula
the regression formula.
data
a data frame containing the data to be used in the model fit.
model.fn
function used to generate a model.
simulate.fn
function used to create the model and generate predictions.
n.folds
the number of folds used for cross-validation. Set to 0 to use Leave One Out Cross Validation.
data.generating.fn
the function used to generate stochastic noise for calculation of exact p values.
p.acc
the desired accuracy for the calculation of exact p values. The entire calculation process will be repeated $1/p.acc$ times so this can have a dramatic affect on time required. Set to NULL to disable the calculation of p values.
features
whether to calculate the average slopes, added $R^2$ and p values for each of the features in addition to the overall model.

Value

  • S3 A3 object containing:
  • model.R2The cross validated $R^2$ for the entire model.
  • feature.R2The cross validated $R^2$'s for the features (if calculated).
  • model.pThe p value for the entire model (if calculated).
  • feature.pThe p value for the features (if calculated).
  • all.R2The $R^2$'s for the model features, and any stochastic simulations for calculating exact p values.
  • observedThe observed response for each observation.
  • predictedThe predicted response for each observation.
  • slopesAverage slopes for each of the features (if calculated).
  • all.slopesSlopes for each of the observations for each of the features (if calculated).
  • tableThe A3 results table.