Learn R Programming

datana (version 1.0.6)

pvalt: Obtain the P-value for a Standard t-distributed random variable

Description

Function to compute the P-value for a Standard t-distributed random variable.

Usage

pvalt(t.value, df, decnum = 5)

Value

The function returns the P-value or probability of getting a value as large as t.value.

Arguments

t.value

A numeric random variable following a t-student pdf distribution.

df

degrees of freedom of the random variable following a t-student pdf distribution.

decnum

the number of decimals to be used in the output. The default is set to 5.

Author

Christian Salas-Eljatib

Details

It is suited to compute the P-value for any random variable following a Standard t probability density function. For instance, to obtain the p-value in a t-test.

Examples

Run this code
## Load dataset
df <- datana::araucaria
#
## Computes the t-test statistics (from the 'stats' package)
t.value <- stats::t.test(df$hdom)
t.v <- as.numeric(t.value$statistic)
deg.f <- as.numeric(t.value$parameter)

## Obtaining the p value
pvalt(t.v,deg.f)

Run the code above in your browser using DataLab