Learn R Programming

riskRegression (version 1.4.3)

findP1: Compute the p.value from the distribution under H1

Description

Compute the p.value from the distribution under H1

Usage

findP1(x, alternative = "two.sided")

Arguments

x

the sample

alternative

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

Examples

Run this code
# NOT RUN {
set.seed(10)

# no effect
x <- rnorm(1e3) 
riskRegression:::findP1(x, alternative = "two.sided")
riskRegression:::findP1(x, alternative = "greater")
riskRegression:::findP1(x, alternative = "less")

# effect
x <- rnorm(1e3, mean = 1) 
riskRegression:::findP1(x, alternative = "two.sided")
riskRegression:::findP1(x, alternative = "greater") # pnorm(q = 0, mean = 1)
riskRegression:::findP1(x, alternative = "less")

x <- rnorm(1e3, mean = -1) 
riskRegression:::findP1(x, alternative = "two.sided") 
riskRegression:::findP1(x, alternative = "greater")
riskRegression:::findP1(x, alternative = "less") # pnorm(q = 0, mean = -1)

# }

Run the code above in your browser using DataLab