wdm::Indep_test Class Reference

#include <wdm.hpp>

Public Member Functions

 Indep_test (std::vector< double > x, std::vector< double > y, std::string method, std::vector< double > weights=std::vector< double >(), bool remove_missing=true, std::string alternative="two-sided")
 
std::string method () const
 the method used for the test
 
std::string alternative () const
 the alternative hypothesis used for the test
 
double n_eff () const
 the effective sample size in the test
 
double estimate () const
 the estimated dependence measure
 
double statistic () const
 the test statistic
 
double p_value () const
 the p-value
 

Detailed Description

Independence test

The test calcualtes asymptotic p-values of independence tests based on (weighted) dependence measures.

Available methods:

  • "pearson", "prho", "cor": Pearson correlation
  • "spearman", "srho", "rho": Spearman's \( \rho \)
  • "kendall", "ktau", "tau": Kendall's \( \tau \)
  • "blomqvist", "bbeta", "beta": Blomqvist's \( \beta \)
  • "hoeffding", "hoeffd", "d": Hoeffding's \( D \)

Constructor & Destructor Documentation

wdm::Indep_test::Indep_test ( std::vector< double >  x,
std::vector< double >  y,
std::string  method,
std::vector< double >  weights = std::vector<double>(),
bool  remove_missing = true,
std::string  alternative = "two-sided" 
)
inline
Parameters
x,yinput data.
methodthe dependence measure; see class details for possible values.
weightsan optional vector of weights for the data.
remove_missingif true, all observations containing a nan are removed; otherwise throws an error if nans are present.
alternativeindicates the alternative hypothesis and must be one of "two-sided","greater"or"less";"greater"corresponds to positive association,"less"to negative association. For Hoeffding's \form#3, only"two-sided"` is allowed.

The documentation for this class was generated from the following file: