Learn R Programming

datana (version 1.0.9)

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 = 14)

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 (pdf). For instance, to obtain the p-value in a t-test.

Examples

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

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

Run the code above in your browser using DataLab