16 #ifndef QGSSTATISTICALSUMMARY_H 17 #define QGSSTATISTICALSUMMARY_H 63 InterQuartileRange = 16384,
64 All = Count | CountMissing | Sum | Mean | Median | StDev | Max | Min | Range | Minority | Majority | Variety | FirstQuartile | ThirdQuartile | InterQuartileRange
111 void addValue(
double value );
127 void addVariant(
const QVariant& value );
142 double statistic(
Statistic stat )
const;
146 int count()
const {
return mCount; }
155 double sum()
const {
return mSum; }
160 double mean()
const {
return mMean; }
166 double median()
const {
return mMedian; }
171 double min()
const {
return mMin; }
176 double max()
const {
return mMax; }
181 double range()
const {
return qIsNaN( mMax ) || qIsNaN( mMin ) ? std::numeric_limits<double>::quiet_NaN() : mMax - mMin; }
188 double stDev()
const {
return mStdev; }
201 int variety()
const {
return mValueCount.count(); }
241 double interQuartileRange()
const {
return qIsNaN( mThirdQuartile ) || qIsNaN( mFirstQuartile ) ? std::numeric_limits<double>::quiet_NaN() : mThirdQuartile - mFirstQuartile; }
250 Statistics mStatistics;
263 double mFirstQuartile;
264 double mThirdQuartile;
269 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsStatisticalSummary::Statistics )
271 #endif // QGSSTATISTICALSUMMARY_H double max() const
Returns calculated maximum from values.
Statistic
Enumeration of flags that specify statistics to be calculated.
int variety() const
Returns variety of values.
double minority() const
Returns minority of values.
double range() const
Returns calculated range (difference between maximum and minimum values).
double median() const
Returns calculated median of values.
double sampleStDev() const
Returns sample standard deviation.
void setStatistics(const Statistics &stats)
Sets flags which specify which statistics will be calculated.
double firstQuartile() const
Returns the first quartile of the values.
double stDev() const
Returns population standard deviation.
double sum() const
Returns calculated sum of values.
double mean() const
Returns calculated mean of values.
double majority() const
Returns majority of values.
double interQuartileRange() const
Returns the inter quartile range of the values.
int countMissing() const
Returns the number of missing (null) values.
Statistics statistics() const
Returns flags which specify which statistics will be calculated.
int count() const
Returns calculated count of values.
double min() const
Returns calculated minimum from values.
Calculator for summary statistics for a list of doubles.
double thirdQuartile() const
Returns the third quartile of the values.