one_sample: One-sample permutation test for the center of a distribution

Description Usage Arguments Value Examples

View source: R/means.R

Description

One-sample permutation test for the center of a distribution

Usage

1
one_sample(x, reps = 1000, center = 0)

Arguments

x

Vector of observations

reps

Number of replications to approximate distribution (default 1000)

center

Optional; specify null center of distribution (default 0)

Value

A vector of length 'reps' containing the permutation distribution

Examples

1
2
3
4
5
6
7
8
x <- -5:5 + rnorm(11)
distr <- one_sample(x)
pvalue <- t2p(mean(x), distr, alternative = 'two-sided')
pvalue

distr2 <- one_sample(x, center = 5)
pvalue2 <- t2p(mean(x), distr2, alternative = 'greater')
pvalue2

statlab/permuter documentation built on May 30, 2019, 9:45 a.m.