fitTable: Fit multiple models to multiple datasets.

Description Usage Arguments Details Value See Also Examples

Description

Apply multiFit to all rows or all columns of a table.

Usage

1
fitTable(models, data, margin, conv = vec2df.id, ...)

Arguments

models

[list] A list of models to fit data to. Each element must be a list with at least two named fields: formula which contains the formula, and start which is a list of lists of starting estimates. Regarding the formula, the converter functions (fun, below) use "X" and "Y" for column names.

data

[matrix/table] The data to fit models to.

margin

[integer] As in apply: the subscripts which the fitting function (cf. multiFit) will be applied over. Accepted values are: 1 for rows, and 2 for columns.

conv

[function] Function that converts vectors into data frames to which models will be fitted. Available functions are: vec2df.id, vec2df.hist, and vec2df.rank. Defaults to vec2df.id.

...

Additional arguments passed to multiFit).

Details

Finding the right model and the right starting estimates for a model is often a time consuming process, very inconvenient to do manually. This function automates it as much as possible. It takes a list of models and starting estimates, as well as a list of datasets, and fits all the models to all the datasets. If any of the fits results in an error or a warning, the message is saved and can be inspected in the output, but it does not halt the process. fitTable is an extension of multiFit which fits multiple models to a single dataset.

Value

[list.multiFit] A list of results returned by the fitting function (cf. multiFit).

See Also

multiFit

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
dataset <- loadSampleDataset ("data-abc")
models <- list (
"model A" = list (
	formula = "Y ~ a/X",
	start = list (list(a=1))),
"model B" = list (
	formula = "Y ~ a/(1+exp(1)^X)",
	start = list (list(a=1)))
)
fitTable (models, summary(dataset), 1, vec2df.rank)

soundcorrs documentation built on Nov. 16, 2020, 5:09 p.m.