ggstatsplot (version 0.0.6)

bartlett_message: Display homogeneity of variance test as a message

Description

A note to the user about the validity of assumptions for the default linear model.

Usage

bartlett_message(data, x, y, lab = NULL, k = 3, output = "message")

Arguments

data

Dataframe from which variables specified are preferentially to be taken.

x

The grouping variable.

y

The response - a vector of length the number of rows of x.

lab

A character describing label for the variable. If NULL, variable name will be used.

k

Number of digits after decimal point (should be an integer) (Default: k = 3).

output

What output is desired: "message" (default) or "stats" objects.

Value

A list of class "htest" containing the following components:

statistic

Bartlett's K-squared test statistic.

parameter

the degrees of freedom of the approximate chi-squared distribution of the test statistic.

p.value

the p-value of the test.

method

the character string "Bartlett test of homogeneity of variances".

data.name

a character string giving the names of the data.

See Also

ggbetweenstats

Other helper_messages: normality_message

Examples

Run this code
# NOT RUN {
# getting message
bartlett_message(
  data = iris,
  x = Species,
  y = Sepal.Length,
  lab = "Iris Species"
)

# getting results from the test
bartlett_message(
  data = mtcars,
  x = am,
  y = wt,
  output = "stats"
)
# }

Run the code above in your browser using DataCamp Workspace