This is a convenience function to re-estimates a GAMLj model adding simple effect analysis. If no option is passed, extracts the simple effects tables already in the model results (if any). If new tests are defined, the simple effects tests tables are returned.

simple_effects(object, ...)

# S3 method for class 'gamlj'
simple_effects(object, formula = NULL, ...)

Arguments

object

a gamlj results object of the class `gamlj`

...

all options accepted by a gamlj model function. Relevant for new tests are `simple_x` (the simple effect variable), `simple_mods`, the moderator(s). Both are overriden by the formula option.

formula

a right hand side formula specifying the variables to test, of the form `~x:z`, `~x:z:w` or `~x*z`. The formula is not expanded, so the first variable is the simple effect variable, the second is the moderator, the third an optional additional moderator, an so on. It has prevalence on other options defining a simple effects test via character options.

Value

a list of tables of class `ResultsElement`

Author

Marcello Gallucci

Examples

data(wicksell)
wicksell$time<-factor(wicksell$time)
wicksell$group<-factor(wicksell$group) 
wicksell$subj<-factor(wicksell$subj) 
gmod<-GAMLj3::gamlj_mixed(
   formula = dv ~ 1 +group+ time:group+ time+( 1 | subj ),
   data = wicksell)

simple_effects(gmod,formula =~time:group)
#> 
#>  SIMPLE EFFECTS
#> 
#>  ANOVA for Simple Effects  of time                           
#>  ─────────────────────────────────────────────────────────── 
#>    group    F           Num df      Den df      p            
#>  ─────────────────────────────────────────────────────────── 
#>    1        18.86500    3.000000    66.00000    < .0000001   
#>    2        35.28400    3.000000    66.00000    < .0000001   
#>  ─────────────────────────────────────────────────────────── 
#> 
#> 
#>  Parameter Estimates for simple effects of time                                                                    
#>  ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── 
#>    group    Effect    Estimate      SE          Lower         Upper          df          t            p            
#>  ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── 
#>    1        1 - 0      -47.66667    21.45003     -90.49303      -4.840307    66.00000    -2.222219     0.0297010   
#>             3 - 0      -88.58333    21.45003    -131.40969     -45.756973    66.00000    -4.129754     0.0001043   
#>             6 - 0     -155.50000    21.45003    -198.32636    -112.673640    66.00000    -7.249408    < .0000001   
#>    2        1 - 0     -185.91667    21.45003    -228.74303    -143.090307    66.00000    -8.667433    < .0000001   
#>             3 - 0     -180.08333    21.45003    -222.90969    -137.256973    66.00000    -8.395483    < .0000001   
#>             6 - 0     -173.75000    21.45003    -216.57636    -130.923640    66.00000    -8.100223    < .0000001   
#>  ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── 
#>