Skip to contents

Base class for per-subject model strategies

Base class for per-subject model strategies

Value

An R6 class generator.

Details

Holds the fields, constructor and default methods shared by StrategyLM, StrategyRLM, StrategyLmer, StrategyRfit, StrategyLogistf and StrategyBinomial. A subclass implements the private fit(x) method and overrides only the methods that differ.

Public fields

formula

model formula

model_name

name of model

anova_df

ANOVA extractor, see AnovaExtractor

Methods


Method new()

Create a new strategy

Usage

StrategyBase$new(modelstr, model_name = "Model")

Arguments

modelstr

model formula string

model_name

name of model


Method model_fun()

Fit the model to one subject's data. A failed fit returns the error message.

Usage

StrategyBase$model_fun(x, pb)

Arguments

x

data.frame for one subject

pb

optional progress bar


Method isSingular()

Check if model is singular (NA coefficients or df < 2)

Usage

StrategyBase$isSingular(model)

Arguments

model

fitted model


Method contrast_fun()

Compute contrasts from fitted model

Usage

StrategyBase$contrast_fun(...)

Arguments

...

passed to compute_contrast


Method df_residual()

Get residual degrees of freedom

Usage

StrategyBase$df_residual(model)

Arguments

model

fitted model


Method sigma()

Get residual standard error

Usage

StrategyBase$sigma(model)

Arguments

model

fitted model


Method clone()

The objects of this class are cloneable with this method.

Usage

StrategyBase$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.