Learn R Programming

sitar (version 1.1.0)

dfpower: Tabulate BIC of SITAR models by degrees of freedom and xy power transformations

Description

dfpower fits a series of SITAR models tabulated by specified degrees of freedom and power transformations of x and y, returning a table of function values (e.g. BIC) applied to each model.

Usage

dfpower(model, df, xpowers, ypowers, FUN = BICadj,
  maxIter = nlmeControl()$maxIter, verbose = FALSE)

Arguments

model

fitted sitar model to be updated.

df

vector of degrees of freedom to be fitted (defaults to df in model).

xpowers

vector of powers to apply to x (defaults to x power in model).

ypowers

vector of powers to apply to y (defaults to y power in model).

FUN

function to be tabulated (default BICadj, or e.g. AICadj or varexp).

maxIter

maximum number of iterations per fit.

verbose

logical controlling monitoring.

Value

Table or vector of returned values.

Details

The function provides a convenient way to optimise the model's degrees of freedom and explore transformations of x and y, based by default on adjusted BIC. The function value is returned with changed sign if there is a warning, or as NA if there is an error. The run-time can be shortened by reducing maxIter, as the models that converge do so in relatively few iterations, and much of the run-time is spent on models that fail to converge.

FUN can be any function returning a single numerical value.

The returned table can be rearranged using aperm.

Examples

Run this code
# NOT RUN {
data(heights)
m1 <- sitar(log(age), height, id, heights, 4)
dfpower(m1, df=4:5, xpowers=0:1, maxIter=4)
# }

Run the code above in your browser using DataLab