DataFrames in Statistics - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

DataFrames in Statistics

 

Description

Examples

Description

• 

This help page describes how to use Statistics commands on DataFrame objects, and other spreadsheet-type data in matrices, sometimes called Matrix data sets.

• 

Many of the data sets you might encounter are two-dimensional in nature. They will have information about a number of items or events; for each item or event, the same properties are known. Such data sets can easily be represented in a DataFrame by having each row correspond to an item and each column to one property of all these items. This is how you would typically store such data in a spreadsheet. You can also store such data in a Matrix, as long as you keep track of labels for the rows and columns yourself.

• 

Many commands in the Statistics package can be used with this type of data:

– 

The following computational commands can be run on DataFrame objects (or Matrices). They are computed per column and the results are returned in a DataSeries object. The labels for the DataSeries are the column labels of the DataFrame. Alternatively, they are computed per column of a Matrix and the results are returned in a row Vector.

AbsoluteDeviation

CentralMoment

Count

CountMissing

Cumulant

DataSummary

Decile

Detrend

Difference

ExpectedValue

FivePointSummary

GeometricMean

HarmonicMean

HodgesLehmann

InterquartileRange

Kurtosis

Mean

MeanDeviation

Median

MedianDeviation

Mode

Moment

Percentile

QuadraticMean

Quantile

Quartile

Range

RousseeuwCrouxQn

RousseeuwCrouxSn

Scale

Skewness

StandardDeviation

StandardError

StandardizedMoment

TrimmedMean

Variance

Variation

WinsorizedMean

 

 

  

 

– 

The following visualization commands, listed on the Statistics Visualization help page, also accept DataFrame objects. Generally, the row and column labels are used to label data points and data sets, respectively, as appropriate.

AgglomeratedPlot

AreaChart

BarChart

Biplot

BoxPlot

BubblePlot

ColumnGraph

CumulativeSumChart

ErrorPlot

FrequencyPlot

GridPlot

LineChart

ParetoChart

PointPlot

ScatterPlot

ScreePlot

ViolinPlot

 

 

 

  

 

– 

Statistics[SplitByColumn] and Statistics[Join] split Matrices into submatrices and join them back together.

– 

DataFrame/Aggregate does similar things for DataFrame objects.

• 

Additional examples are found in the Statistics with DataFrames example worksheet.

Examples

We construct a DataFrame with housing data. The first column has number of bedrooms, the second has the area in square feet, the third has price.

We can determine the average number of bedrooms, average area, and average price with just the Mean command.

(1)

We can also determine the standard error for this mean.

(2)

Or the 30th percentile for each column.

(3)

The GridPlot command can display scatter plots of pairs of columns.

(4)

 

We can use the lower diagonal entries to display the values for the correlation.

(5)

 

We can determine the average area and price for subgroups of sales defined by number of bedrooms. (The Aggregate command is part of the DataFrame object, not the Statistics package, so it is not available for Matrices.)

(6)

To create a box plot of prices for each number of bedrooms requires a little more effort.

(7)

(8)

Most of the things mentioned above can be done with a Matrix, too. Consider the following examples.

(9)

(10)

Some commands have calling sequences where one of the arguments is compared to the data; this is the case for the second argument of AbsoluteDeviation and for the origin parameter of Moment. In these cases, it typically does not make much sense to use the same value for each column, so Maple supports using a list or Vector of values instead. These commands do not yet work directly with DataFrame objects.

(11)

(12)

See Also

examples/DataFrame/Statistics

 


Download Help Document