| @@ 213-223 (lines=11) @@ | ||
| 210 | throw new \PEAR_Exception('cannot studentize data, standard deviation is zero.'); |
|
| 211 | } |
|
| 212 | $arr = array(); |
|
| 213 | if ($this->_dataOption == self::STATS_DATA_CUMMULATIVE) { |
|
| 214 | foreach ($this->_data as $val => $freq) { |
|
| 215 | $newval = ($val - $mean) / $std; |
|
| 216 | $arr["$newval"] = $freq; |
|
| 217 | } |
|
| 218 | } else { |
|
| 219 | foreach ($this->_data as $val) { |
|
| 220 | $newval = ($val - $mean) / $std; |
|
| 221 | $arr[] = $newval; |
|
| 222 | } |
|
| 223 | } |
|
| 224 | return $this->setData($arr, $this->_dataOption); |
|
| 225 | } |
|
| 226 | ||
| @@ 244-254 (lines=11) @@ | ||
| 241 | return $mean; |
|
| 242 | } |
|
| 243 | $arr = array(); |
|
| 244 | if ($this->_dataOption == self::STATS_DATA_CUMMULATIVE) { |
|
| 245 | foreach ($this->_data as $val => $freq) { |
|
| 246 | $newval = $val - $mean; |
|
| 247 | $arr["$newval"] = $freq; |
|
| 248 | } |
|
| 249 | } else { |
|
| 250 | foreach ($this->_data as $val) { |
|
| 251 | $newval = $val - $mean; |
|
| 252 | $arr[] = $newval; |
|
| 253 | } |
|
| 254 | } |
|
| 255 | return $this->setData($arr, $this->_dataOption); |
|
| 256 | } |
|
| 257 | ||