Learn R Programming

reproducer (version 0.5.3)

PHat.test: PHat.test

Description

This function provides single-sided and two-sided tests of the probability of superiority (phat).

Usage

PHat.test(x, y, alpha = 0.05, alternative = "two.sided", sigfig = -1)

Value

The values of phat and its standard error,the t-value, its pvalue and the upper and lower confidence interval.

Arguments

x

The data from one group

y

The data from the alternative group

alpha

The significance level of tests which also controls the values of the confidence interval (default 0.05)

alternative

This defines whether a one-sided test or a two-sided (default) test is required. For a one-sided test use parameter values greater' or 'less' to define whether the d-value should be greater or less than zero.

sigfig

is the number of significant digits in the data.

Author

Barbara Kitchenham and Lech Madeyski

Examples

Run this code
set.seed(456)
x <- rnorm(10, 0, 1)
y <- rnorm(10, 0.8, 1)
PHat.test(x, y, alpha = .05, alternative = "greater", sigfig = -1)
# A tibble: 1 x 8
#    phat sqse.phat phat.df phat.tvalue phat.pvalue phat.ci.lower phat.ci.upper phat.sig
#                                            
# 1  0.79    0.0118    13.6        2.67     0.00924         0.599             1 TRUE
PHat.test(x, y, alpha = .05, alternative = "two.sided", sigfig = -1)
# A tibble: 1 x 8
# phat sqse.phat phat.df phat.tvalue phat.pvalue phat.ci.lower phat.ci.upper phat.sig
#                                           
# 1  0.79    0.0118    13.6        2.67      0.0185         0.557             1 TRUE

Run the code above in your browser using DataLab