mfit: Model fitter

Description Usage Arguments Details Value

View source: R/02_model_creation.R

Description

Step Two: Fits all possible model combinations with a certain method given the data.

Usage

1
mfit(data, method, npar = 1, ...)

Arguments

data

A list with two elements:

  1. dep: A vector with the dependent variable.

  2. indep: A list with either one vector per variable (ungrouped) as elements, or one data.frame with all variables belonging to one group as elements.

. Best created by indep_tf.

method

The method with which the models shall be computed. Can be one of "lm" (linear models) and "gamlss".

npar

Number of distributional parameters for which models should be computed. Can be one if only the expected value of the dependent variable should be modeled, or 2 if models for modeling the variance of the dependent variable should also be computed. npar = 2 is only possible in combination with method = "gamlss".

...

Additional arguments, passed on to link[gamlss]{gamlss}.

Details

This function is used for computing all possible models to later extract the wanted goodness of fit. This function relies on acc to get modelnames which are also attached in the exported list.

Value

A list with five components:

  1. models: A list with one or two elements. Each element has all possible model fits in it. Each element represents one distributional parameter.

  2. modelids: A character vector with model id's corresponding to the models. in the models element

  3. expl_names: names of explanatory variables (ungrouped case) or group names (grouped case).

  4. npar: Number of parameters which are modeled.

  5. method: One of "lm", "gamlss".


Stan125/ghp documentation built on Feb. 1, 2020, 1:21 p.m.