Changeset 447 for trunk/lib/statistics/Fisher.h
 Timestamp:
 Dec 15, 2005, 7:51:18 PM (16 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/lib/statistics/Fisher.h
r295 r447 11 11 namespace statistics { 12 12 /// 13 /// Class forFisher's exact test.13 /// @brief Fisher's exact test. 14 14 /// Fisher's Exact test is a procedure that you can use for data 15 15 /// in a two by two contingency table: \f[ \begin{tabular}{cc} … … 35 35 /// 10 a Chisquare test is reasonable to use. 36 36 /// 37 37 /// @note The statistica assumes that each column and row sum, 38 /// respectively, are fixed. Just because you have a 2x2 table, this 39 /// assumtion does not necessarily match you experimental upset. See 40 /// e.g. Barnard's test for alternative. 41 /// 38 42 39 43 class Fisher : public Score … … 53 57 54 58 /// 59 /// Cutoff sets the limit whether a value should go into the left 60 /// or the right column. @see score 61 /// 62 /// @return reference to cutoff for column 63 /// 64 inline double& cutoff_column(void) { return cutoff_column_; } 65 66 /// 67 /// Cutoff sets the limit whether a value should go into the left 68 /// or the right row. @see score 69 /// 70 /// @return reference to cutoff for row 71 /// 72 inline double& cutoff_row(void) { return cutoff_row_; } 73 74 /// 75 /// Calculates the expected values under the null hypothesis. 76 /// a' = (a+c)(a+b)/(a+b+c+d) 77 /// 78 void expected(u_int& a, u_int& b, u_unt& c, u_int& d); 79 80 /// 81 /// minimum_size is the threshold for when the pvalue calculation 82 /// is performed using a Chi2 approximation. 83 /// 84 /// @return reference to minimum_size 85 /// 86 inline u_int& minimum_size(void){ return minimum_size_; } 87 88 /// 89 /// If absolute, the pvalue is the twosided pvalue. If all 90 /// elements in table is at least minimum_size, a Chi2 91 /// approximation is used. 92 /// 55 93 /// @return pvalue 56 57 94 /// 95 double p_value() const; 58 96 59 97 /// … … 75 113 /// calculated as \f$ \sum w_i \f$, so when each weight is 76 114 /// unitary the same table is created as in the unweighted version 115 /// 77 116 /// @return odds ratio 117 /// 118 /// @note 78 119 /// 79 120 double score(const gslapi::vector& x, const gslapi::vector& y, … … 93 134 94 135 private: 136 double oddsratio(const double a, const double b, 137 const double c, const double d) const; 138 139 double p_value_approximative(void) const; 140 double p_value_exact(void) const; 141 95 142 std::vector<size_t> train_set_; 96 143 gslapi::vector weight_; 97 u_inta_;98 u_intb_;99 u_intc_;100 u_intd_;101 102 double oddsratio(const double a, const double b,103 const double c, const double d) const;144 double a_; 145 double b_; 146 double c_; 147 double d_; 148 double cutoff_column_; 149 double cutoff_row_; 150 double minimum_size_; 104 151 105 152 };
Note: See TracChangeset
for help on using the changeset viewer.