Formula method for twoway analysis using a dataset in long format
Source:R/twoway.formula.R
twoway.formula.Rd
The formula method reshapes the data set from long to wide format and calls the default method.
Usage
# S3 method for class 'formula'
twoway(formula, data, subset, na.action, ...)
References
the conversion of long to wide in a formula method was suggested on https://stackoverflow.com/questions/50469320/how-to-write-a-formula-method-that-converts-long-to-wide
Examples
longRT <- to_long(taskRT)
twoway(RT ~ Task + Topic, data=longRT)
#>
#> Mean decomposition (Dataset: "longRT"; Response: RT)
#> Residuals bordered by row effects, column effects, and overall
#>
#> Topic
#> Task topic1 topic2 topic3 topic4 roweff
#> + --------- --------- --------- --------- + ---------
#> Easy | -0.055833 0.090833 0.004167 -0.039167 : -0.864167
#> Medium | 0.119167 0.075833 -0.410833 0.215833 : -0.059167
#> Hard | -0.063333 -0.166667 0.406667 -0.176667 : 0.923333
#> + ......... ......... ......... ......... + .........
#> coleff | -0.831667 -0.288333 0.358333 0.761667 : 4.181667
#>