simple_effects: Simple Effects on GAMLj results

View source: R/rinterface.R

simple_effectsR Documentation

Simple Effects on GAMLj results

Description

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.

Usage

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(s)

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)

mcfanda/gamlj documentation built on April 15, 2024, 11:16 a.m.