lundi 24 août 2020

Calculate p value of a t - statistic using the student_t_distribution

I wanted to calculate p-values of a t-statistic for a two tailed test with 5% level of significance. And I wanted to do this with the standard library. I was wondering if this was possible using the student_t_distribution from the < random > module. My code currently is as following

#include <iostream>

int main(){
    double t_stat = 0.0267; // t-statistic
    double alpha_los = 0.05; // level of significance
    double dof = 30; // degrees of freedom
    // calculate P > |t| and compare with alpha_los
    return 0;
}

Thank you

Aucun commentaire:

Enregistrer un commentaire