# This file is automatically generated, you probably don't want to edit this
anovaOptions <- if (requireNamespace('jmvcore')) R6::R6Class(
"anovaOptions",
inherit = jmvcore::Options,
public = list(
initialize = function(
dep = NULL,
ind = NULL,
modelTerms = NULL, ...) {
super$initialize(
package='jmvbaseR',
name='anova',
requiresData=TRUE,
...)
private$..dep <- jmvcore::OptionVariable$new(
"dep",
dep,
default=NULL)
private$..ind <- jmvcore::OptionVariables$new(
"ind",
ind,
default=NULL)
private$..modelTerms <- jmvcore::OptionTerms$new(
"modelTerms",
modelTerms,
default=NULL)
self$.addOption(private$..dep)
self$.addOption(private$..ind)
self$.addOption(private$..modelTerms)
}),
active = list(
dep = function() private$..dep$value,
ind = function() private$..ind$value,
modelTerms = function() private$..modelTerms$value),
private = list(
..dep = NA,
..ind = NA,
..modelTerms = NA)
)
anovaResults <- if (requireNamespace('jmvcore')) R6::R6Class(
inherit = jmvcore::Group,
active = list(),
private = list(),
public=list(
initialize=function(options) {
super$initialize(
options=options,
name="",
title="ANOVA")}))
anovaBase <- if (requireNamespace('jmvcore')) R6::R6Class(
"anovaBase",
inherit = jmvcore::Analysis,
public = list(
initialize = function(options, data=NULL, datasetId="", analysisId="", revision=0) {
super$initialize(
package = 'jmvbaseR',
name = 'anova',
version = c(1,0,0),
options = options,
results = anovaResults$new(options=options),
data = data,
datasetId = datasetId,
analysisId = analysisId,
revision = revision,
pause = NULL,
completeWhenFilled = FALSE)
}))
#' ANOVA
#'
#'
#' @param data the data set as a data frame
#' @param dep a string specifying the dependent variable in \code{data}
#' @param ind a vector of strings specifying the independent variables in
#' \code{data}
#' @param modelTerms a list of string vectors specifying the model terms
#' @return A results object containing:
#' \tabular{llllll}{
#' }
#'
#' @export
anova <- function(
data,
dep = NULL,
ind = NULL,
modelTerms = NULL) {
if ( ! requireNamespace('jmvcore'))
stop('anova requires jmvcore to be installed (restart may be required)')
options <- anovaOptions$new(
dep = dep,
ind = ind,
modelTerms = modelTerms)
results <- anovaResults$new(
options = options)
analysis <- anovaClass$new(
options = options,
data = data)
analysis$run()
analysis$results
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.