This is a convenience function to extract the ANOVA table (omnibus tests) from a GAMLj model. If no option is passed, extracts the ANOVA tests table already in the model results (if any). If two GAMLj models are provided, a model comparison is produces. Any option accepted by gamlj model can be passed. are returned.

# S3 method for gamlj
anova(object, object2, ...)

Arguments

object

a gamlj results object of the class `gamlj`

object2

a gamlj results object of the class `gamlj` representing the nested model. Overiddes nested_terms. It can be passed also as a a right-hand side formula specifying terms of the nested model.

...

all options accepted by a gamlj model function.

Value

a list of tables of class `ResultsElement`

Author

Marcello Gallucci

Examples

data(fivegroups)
fivegroups$Group<-factor(fivegroups$Group)
gmod<-GAMLj3::gamlj_lm(
  formula = Score ~Group,
  data = fivegroups)
#> 
#> Attaching package: ‘jmvcore’
#> The following objects are masked from ‘package:base’:
#> 
#>     endsWith, format, startsWith

anova(gmod)
#> [[1]]
#> 
#>  Model Fit                                                             
#>  ───────────────────────────────────────────────────────────────────── 
#>    R²           Adj. R²      df    df (res)    F           p           
#>  ───────────────────────────────────────────────────────────────────── 
#>    0.1472811    0.1318705     3         166    9.557137    0.0000074   
#>  ───────────────────────────────────────────────────────────────────── 
#> 
#> 
#> [[2]]
#> 
#>  ANOVA Omnibus tests                                                       
#>  ───────────────────────────────────────────────────────────────────────── 
#>                 SS            df     F            p            η²p         
#>  ───────────────────────────────────────────────────────────────────────── 
#>    Model         7.4831734      3    9.5571370    0.0000074    0.1472811   
#>    Group         7.4831734      3    9.5571370    0.0000074    0.1472811   
#>    Residuals    43.3256242    166                                          
#>    Total        50.8087976    169                                          
#>  ───────────────────────────────────────────────────────────────────────── 
#> 
#>