ggstatsplot (version 0.0.9)

subtitle_onesample_proptest: Making text subtitle for Proportion Test (N Outcomes)

Description

This is going to be a chi-squared Goodness of fit test.

Usage

subtitle_onesample_proptest(data, main, counts = NULL, ratio = NULL,
  legend.title = NULL, k = 2, ...)

Arguments

data

A dataframe (or a tibble) from which variables specified are to be taken. A matrix or tables will not be accepted.

main

The variable to use as the rows in the contingency table.

counts

A string naming a variable in data containing counts, or NULL if each row represents a single observation (Default).

ratio

A vector of numbers: the expected proportions for the proportion test. Default is NULL, which means if there are two levels ratio = c(1,1), etc.

legend.title

Title text for the legend.

k

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

...

Additional arguments.

Examples

Run this code
# NOT RUN {
# with counts
library(jmv)

subtitle_onesample_proptest(
  data = as.data.frame(HairEyeColor),
  main = Eye,
  counts = Freq
)

# in case no variation, only sample size will be shown
subtitle_onesample_proptest(
  data = cbind.data.frame(x = rep("a", 10)),
  main = x
)
# }

Run the code above in your browser using DataCamp Workspace