ttest_data: ttest_data

View source: R/ttest_data.R

ttest_dataR Documentation

ttest_data

Description

Creates data for a t test for one mean based on the properties for the test.

Usage

ttest_data(
  size = (3:20)^2,
  mean = -5:5,
  sd = seq(0.1, 1, by = 0.1),
  reject = NA,
  alternative = c("two.sided", "less", "greater"),
  alpha = c(0.01, 0.05, 0.1),
  z = seq(-4.49, 4.49, by = 0.01),
  use.sigma = TRUE
)

Arguments

size

numeric: vector of possible sample sizes (default (3:20)^2,)

mean

numeric: vector of possible means (default -5:5)

sd

numeric: vector of possible standard deviations (default sd=seq(0.1, 1, by=0.1)

reject

logical: should x generated lead to a rejection of the null hypothesis (default TRUE), if equals NA then this will be igenored

alternative

character: a character string specifying the alternative hypothesis, must be one of two.sided (default), greater or less

alpha

numeric: vector of significance levels (default c(0.01, 0.05, 0.1))

z

numeric: vector of possible z values (default seq(-4.49, 4.49, by=0.01))

use.sigma

logical: should the standard deviation of the population (default) or the sample used

Value

a list with the components:

  • mu0 hypothetical mean,

  • sigma standard deviation in the population,

  • sd vector of possible standard deviations in the sample,

  • xbar mean in the sample,

  • n sample size,

  • alpha significance level,

  • alternative specifying the alternative hypothesis (either two.sided, greater or less), and

  • altsd alternative values usable for sd (if use.sigma==TRUE) or sigma (if use.sigma==FALSE)

Examples

ttest_data()

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