Skip to contents

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.

Value

An R6 class generator.

Public fields

formula

model formula

model_name

name of model

anova_df

ANOVA extractor, see AnovaExtractor

control

convergence controls passed to the fitting backend (empty for non-iterative fits)

Methods


StrategyBase$new()

Create a new strategy

Usage

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

Arguments

modelstr

model formula string

model_name

name of model

control

named list of convergence controls merged over the strategy's defaults; names the backend does not accept raise a classed error


StrategyBase$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


StrategyBase$isSingular()

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

Usage

StrategyBase$isSingular(model)

Arguments

model

fitted model


StrategyBase$contrast_fun()

Compute contrasts from fitted model

Usage

StrategyBase$contrast_fun(...)

Arguments

...

m (fitted model), linfct (contrast weights on its coefficients) and confint, the confidence level (default 0.95)


StrategyBase$df_residual()

Get residual degrees of freedom

Usage

StrategyBase$df_residual(model)

Arguments

model

fitted model


StrategyBase$sigma()

Get residual standard error

Usage

StrategyBase$sigma(model)

Arguments

model

fitted model


StrategyBase$zero_residual_variance()

Flag residual scales indistinguishable from zero (constant or noiseless response); their tests are set to NA

Usage

StrategyBase$zero_residual_variance(sigma, scale)

Arguments

sigma

residual scales, one per contrast row

scale

response level of the same rows (average abundance)


StrategyBase$clone()

The objects of this class are cloneable with this method.

Usage

StrategyBase$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.