pvalues

pvalues —

Synopsis




double      binomial_cdf                    (int k,
                                             int n,
                                             double p);
double      binomial_cdf_comp               (int k,
                                             int n,
                                             double p);
double      x_factorial                     (double x);
double      log_x_factorial                 (double x);
double      normal_pvalue_2                 (double x);
double      normal_pvalue_1                 (double x);
double      t_cdf                           (double x,
                                             int df);
double      t_cdf_comp                      (double x,
                                             int df);
double      t_pvalue_2                      (double x,
                                             int df);
double      t_critval                       (double a,
                                             int df);
double      chisq_cdf                       (double x,
                                             int df);
double      chisq_cdf_comp                  (double x,
                                             int df);
double      chisq_critval                   (double a,
                                             int df);
double      f_cdf                           (double x,
                                             int dfn,
                                             int dfd);
double      f_cdf_comp                      (double x,
                                             int dfn,
                                             int dfd);
double      f_critval                       (double a,
                                             int dfn,
                                             int dfd);
double      normal_cdf                      (double x);
double      normal_cdf_inverse              (double x);
double      normal_pdf                      (double x);
double      normal_critval                  (double a);
double      log_normal_pdf                  (double x);
double      bvnorm_cdf                      (double a,
                                             double b,
                                             double rho);
double      gamma_cdf_comp                  (double s1,
                                             double s2,
                                             double x,
                                             int control);
double      tcrit95                         (int df);
double      rhocrit95                       (int n);
double      cephes_gamma                    (double x);
double      cephes_lgamma                   (double x);
double      gretl_get_pvalue                (char st,
                                             const double *p);
double      gretl_get_cdf                   (char st,
                                             double *p);
double      gretl_get_critval               (char st,
                                             double *p);
int         batch_pvalue                    (const char *str,
                                             double ***pZ,
                                             DATAINFO *pdinfo,
                                             PRN *prn);
void        print_pvalue                    (char st,
                                             double *p,
                                             double pv,
                                             PRN *prn);

Description

Details

binomial_cdf ()

double      binomial_cdf                    (int k,
                                             int n,
                                             double p);

k : maximum number of successes.
n : number of trials.
p : probability of success on each trial.
Returns : the probability of k or less successes on n trials given binomial probability p, or NADBL on failure.

binomial_cdf_comp ()

double      binomial_cdf_comp               (int k,
                                             int n,
                                             double p);

k : maximum number of successes.
n : number of trials.
p : probability of success on each trial.
Returns : the probability of k + 1 or more successes on n trials given binomial probability p, or NADBL on failure.

x_factorial ()

double      x_factorial                     (double x);

x : input value.
Returns : the factorial of int(x), cast to a double, or NADBL on failure.

log_x_factorial ()

double      log_x_factorial                 (double x);

x : input value.
Returns : the log of the factorial of int(x), cast to a double, or NADBL on failure.

normal_pvalue_2 ()

double      normal_pvalue_2                 (double x);

Calculates the two-sided p-value for x in relation to the standard normal distribution.

x : double-precision value.
Returns : 2 times (1 minus the value of the standard normal CDF evaluated at abs(x)).

normal_pvalue_1 ()

double      normal_pvalue_1                 (double x);

Calculates the one-sided p-value for x in relation to the standard normal distribution (that is, the probability that a random variable distributed as N(0, 1) is greater than x).

x : double-precision value.
Returns : 1 minus the value of the standard normal CDF evaluated at x.

t_cdf ()

double      t_cdf                           (double x,
                                             int df);

x : the cutoff point in the distribution.
df : degrees of freedom.
Returns : the integral from minus infinity to x of the t distribution with df degrees of freedom, or NADBL on failure.

t_cdf_comp ()

double      t_cdf_comp                      (double x,
                                             int df);

x : the cutoff point in the distribution.
df : degrees of freedom.
Returns : the integral from x to infinity of the t distribution with df degrees of freedom, or NADBL on failure.

t_pvalue_2 ()

double      t_pvalue_2                      (double x,
                                             int df);

x : the cutoff point in the distribution.
df : degrees of freedom.
Returns : the probability that t(df) is greater than x (two-sided, using the absolute value of x), or NADBL on failure.

t_critval ()

double      t_critval                       (double a,
                                             int df);

a : right-tail probability.
df : degrees of freedom.
Returns : the argument x such that the integral from x to infinity of the t(df) density is equal to the given probability a, or NADBL on failure.

chisq_cdf ()

double      chisq_cdf                       (double x,
                                             int df);

x : the cutoff point in the distribution.
df : degrees of freedom.
Returns : the integral from 0 to x of the chi-squared distribution with df degrees of freedom, or NADBL on failure.

chisq_cdf_comp ()

double      chisq_cdf_comp                  (double x,
                                             int df);

x : the cutoff point in the distribution.
df : degrees of freedom.
Returns : the integral from x to infinity of the chi-squared distribution with df degrees of freedom, or NADBL on failure.

chisq_critval ()

double      chisq_critval                   (double a,
                                             int df);

a : right-tail probability.
df : degrees of freedom.
Returns : the Chi-square argument x such that the integral from x to infinity of the Chi-square density is equal to the given probability a, or NADBL on failure.

f_cdf ()

double      f_cdf                           (double x,
                                             int dfn,
                                             int dfd);

x : the cutoff point in the distribution.
dfn : numerator degrees of freedom.
dfd : denominator degrees of freedom.
Returns : the integral of the F distribution with dfn and dfd degrees of freedom, from 0 to x, or NADBL on failure.

f_cdf_comp ()

double      f_cdf_comp                      (double x,
                                             int dfn,
                                             int dfd);

x : the cutoff point in the distribution.
dfn : numerator degrees of freedom.
dfd : denominator degrees of freedom.
Returns : the integral of the F distribution with dfn and dfd degrees of freedom, from x to infinity, or NADBL on failure.

f_critval ()

double      f_critval                       (double a,
                                             int dfn,
                                             int dfd);

a : right-tail probability.
dfn : numerator degrees of freedom.
dfd : denominator degrees of freedom.
Returns : the F argument x such that the integral from x to infinity of the F density is equal to the given probability a, or NADBL on failure.

normal_cdf ()

double      normal_cdf                      (double x);

x : double-precision value.
Returns : the value of the standard normal CDF evaluated at x, or NADBL on failure.

normal_cdf_inverse ()

double      normal_cdf_inverse              (double x);

x : double-precision value.
Returns : the argument, y, for which the area under the Gaussian probability density function (integrated from minus infinity to y) is equal to x, or NADBL on failure.

normal_pdf ()

double      normal_pdf                      (double x);

x : double-precision value.
Returns : the value of the standard normal PDF evaluated at x.

normal_critval ()

double      normal_critval                  (double a);

a : right-tail probability.
Returns : the argument z such that the integral from z to infinity of the standard normal density is equal to the given probability a, or NADBL on failure.

log_normal_pdf ()

double      log_normal_pdf                  (double x);

x : double-precision value.
Returns : the value of the log-normal PDF evaluated at x.

bvnorm_cdf ()

double      bvnorm_cdf                      (double a,
                                             double b,
                                             double rho);

Ripped and adapted from Gnumeric, with a bug corrected for the case (a * b < 0) && (rho < 0).

a : input value.
b : input value.
rho : input value, correlation coefficient.
Returns : for (x,y) a bivariate standard Normal rv with correlation coefficient rho, the joint probability that (x < a) && (y < b), or NADBL on failure.

gamma_cdf_comp ()

double      gamma_cdf_comp                  (double s1,
                                             double s2,
                                             double x,
                                             int control);

s1 :
s2 :
x :
control :
Returns :

tcrit95 ()

double      tcrit95                         (int df);

df : degrees of freedom.
Returns : the two-sided 95 percent critical value for the t distribution with df degrees of freedom, or NADBL on failure.

rhocrit95 ()

double      rhocrit95                       (int n);

n : sample size.
Returns : the two-sided 95 percent critical value for the sample correlation coefficient, sample size n, or NADBL on failure.

cephes_gamma ()

double      cephes_gamma                    (double x);

x :
Returns :

cephes_lgamma ()

double      cephes_lgamma                   (double x);

x :
Returns :

gretl_get_pvalue ()

double      gretl_get_pvalue                (char st,
                                             const double *p);

st :
p :
Returns :

gretl_get_cdf ()

double      gretl_get_cdf                   (char st,
                                             double *p);

st :
p :
Returns :

gretl_get_critval ()

double      gretl_get_critval               (char st,
                                             double *p);

st :
p :
Returns :

batch_pvalue ()

int         batch_pvalue                    (const char *str,
                                             double ***pZ,
                                             DATAINFO *pdinfo,
                                             PRN *prn);

Calculates and prints the probability that a random variable distributed as specified in the command line str exceeds the value indicated in str.

str : the command line, which should be of one of the following forms: pvalue z x (Normal distribution); pvalue t df x (t-distribution); pvalue X df x (Chi-square); pvalue F dfn dfd x (F-distribution); or pvalue G mean variance x (Gamma distribution). pvalue B prob n x (Binomial distribution). pvalue P mean k (Poisson distribution).
pZ : pointer to the data array.
pdinfo : data information struct.
prn : gretl printing struct.
Returns : 0 on success, non-zero code on error.

print_pvalue ()

void        print_pvalue                    (char st,
                                             double *p,
                                             double pv,
                                             PRN *prn);

st :
p :
pv :
prn :