Learn R Programming

rAverage (version 0.4-10)

rav.indices: Fit indices for averaging models

Description

Group of functions to extract fit indices, parameters, fitted values and residuals. The function fit.indices returns the fit indices for the averaging model given the parameters s0, w0, s(k,j), and w(k,j). The functions rav.AIC and rav.BIC extract the Akaike Information Criterion and the Bayesian Information Criterion from a fitted model. The functions rav.param, rav.fitted and rav.resid, extract respectively the parameters, fitted values and residuals from an estimated averaging model. The function rav.resid extracts, besides the matrix of residuals, the sum of squared residuals for both columns and rows of the data matrix.

Usage

rav.indices(param, lev, data, t.par = FALSE, subset = NULL,
    n.pars = NULL, names = NULL, title = NULL)
rav.AIC(object, whichModel = NULL)
rav.BIC(object, whichModel = NULL)
rav.fitted(object, whichModel = NULL)
rav.param(object, whichModel = NULL)
rav.resid(object, whichModel = NULL, standard = FALSE)

Arguments

param
Numerical vector containing the parameters for the function, with the order s0, w0, s(k,j), and w(k,j).
lev
Vector containing the number of levels of each factor. For instance, two factors with respectively 3 and 4 levels require lev = c(3,4).
data
A matrix or a data.frame object containing the experimental data. Each column corresponds to an experimental design (in order: one-way design, two-way design, ..., full factorial design; see the example for furthe
t.par
Specifies whether the weight parameters should be the in 't' form or in the 'w' form.
subset
Character, numeric or factor attribute that selects a subset of experimental data for the analysis (see the examples).
n.pars
Number of parameters of the model. If NULL, n.pars will be calculated from the function.
names
Vector of character strings containing the names of the factors.
title
Character specifying a title for the output.
object
An object of class rav containing an estimated averaging model.
whichModel
Specifies from which model extract the values (parameters, fitted values or fit indices). Options are:
  1. "null": null model
  2. "ESM": equal scale values model
  3. "SAM": simple averagin
standard
It specifies if to standardize residuals.

Value

  • An object of class "indices".

Details

Returns the main fit indices (AIC, BIC, R-squared, Adjusted R-squared), the estimated parameters, the fitted values, the residuals and the squared residuals.

See Also

rav, outlier.replace, rAverage-package

Examples

Run this code
data(fmdata1)
s <- c(12.9, 1.5, 18.3, 5.2, 5.0, 2.3)
w <- c(1.4, 0.3, 0.5, 1.6, 1.7, 1.7)
param <- c(NA,NA, s, w)
# Estimated model by rav:
fit1 <- rav(fmdata1, lev=c(3,3)) ; fit1
# Fitted model by original parameters:
fit2 <- rav.indices(param=param, lev=c(3,3), data=fmdata1) ; fit2

Run the code above in your browser using DataLab