hypothesis_latex: hypothesis_latex

View source: R/hypothesis_latex.R

hypothesis_latexR Documentation

hypothesis_latex

Description

Creates a data frame for test hypothesis with various columns:

  • h0.left left value in the null hypothesis, usually ⁠\mu⁠ or ⁠\pi⁠

  • h0.operator operator in null hypothesis, one of eq, ne, lt, le, gt, or ge

  • h0.right right value in the null hypothesis, usually ⁠\mu_0⁠, ⁠\pi_0⁠, or a hypothetical value

  • h1.left left value in the alternative hypothesis, usually ⁠\mu⁠ or ⁠\pi⁠

  • h1.operator operator in alternative hypothesis, one of eq, ne, lt, le, gt, or ge

  • h1.right right value in the alternative hypothesis, usually ⁠\mu_0⁠, ⁠\pi_0⁠, or a hypothetical value

  • H0 latex representation of the null hypothesis

  • H1 latex representation of the alternative hypothesis

  • match.left do the left value in the null and alternative hypothesis match?

  • match.right do the right value in the null and alternative hypothesis match?

  • match.operator do the operators in the null and alternative hypothesis match cover all real numbers?

  • match.right do the right value in the null and alternative hypothesis match?

  • match.type either wrong, left.sided, right.sided, two.sided, greater, or less If null is not given then it determined from alternative. Otherwise hypotheses pairs are generated by all combinations from alternative and null. Valid values for alternativeand null are two.sided, greater, less, eq, ne, lt, le, gt, or ge.

Usage

hypothesis_latex(
  left,
  alternative = NULL,
  null = NULL,
  right = paste0(left, "_0")
)

Arguments

left

character: symbol, for example "\mu" or "\pi"

alternative

character: alternative hypotheses

null

character: null hypothese (default: NULL)

right

character: symbol (default: paste0(left, "_0"))

Value

data frame with hypothesis pairs

Examples

# create one hypotheses pair
hypothesis_latex("\\mu")
hypothesis_latex("\\pi")
hypothesis_latex("\\mu", alternative="two.sided")
hypothesis_latex("\\mu", alternative="two.sided", null="lt")
hypothesis_latex("\\mu", alternative="ne", null="eq")
hypothesis_latex("\\mu", right=c(0,1))
hypothesis_latex("\\mu", alternative=c("eq", "ne", "lt", "le", "gt", "ge"))
hypothesis_latex("\\mu", alternative=c("eq", "ne", "lt", "le", "gt", "ge"), 
                         null=c("eq", "ne", "lt", "le", "gt", "ge"))

sigbertklinke/exams2moodle documentation built on July 6, 2023, 3:26 p.m.