Matrix Data Sets in Statistics - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Statistics : Statistics Package : Statistics/MatrixDataSets

Matrix Data Sets in Statistics

Description

• 

This help page describes how to use Statistics commands on spreadsheet-type data in matrices.

• 

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 Matrix by having each row of the Matrix 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.

• 

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

– 

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

– 

The following commands can be run on Matrix data sets; they are computed per column and the results are returned in a row Vector:

AbsoluteDeviation

CentralMoment

Count

CountMissing

Cumulant

DataSummary

Decile

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

WindsorizedMean

Examples

withStatistics:

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

HouseSalesData:=Matrix15,3,1,1=3,1,2=1130,1,3=114694,2,1=4,2,2=1123,2,3=125236,3,1=2,3,2=1049,3,3=81647,4,1=4,4,2=1527,4,3=127368,5,1=3,5,2=907,5,3=88464,6,1=2,6,2=580,6,3=59481,7,1=2,7,2=878,7,3=96484,8,1=3,8,2=1075,8,3=113341,9,1=4,9,2=1040,9,3=104385,10,1=4,10,2=1295,10,3=136603,11,1=2,11,2=1100,11,3=80134,12,1=4,12,2=995,12,3=128007,13,1=4,13,2=908,13,3=115707,14,1=3,14,2=853,14,3=94666,15,1=3,15,2=856,15,3=89412

HouseSalesData:= 15 x 3 MatrixData Type: anythingStorage: rectangularOrder: Fortran_order

(1)

We can create box plots of the price for subgroups of sales defined by number of bedrooms.

ByRooms:=SplitByColumnHouseSalesData,1

ByRooms:=21049816472580594812878964842110080134,3113011469439078846431075113341385394666385689412,4112312523641527127368410401043854129513660349951280074908115707

(2)

We can determine the average area and price for the whole data set and for the sets with 2, 3, and 4 bedrooms. For the latter, we use the elementwise version of Mean by appending a tilde to the command.

MeanHouseSalesData

3.133333333333331021.066666666671.03708600000000105

(3)

`~`MeanByRooms

2.901.75000000000079436.5000000000,3.964.2000000000001.00115400000000105,4.1148.1.22884333333333105

(4)

We can also determine the standard error for this mean.

StandardErrorMean,HouseSalesData

0.21528865819918756.08322613730645615.81179205727

(5)

Or the 30th percentile for each column.

PercentileHouseSalesData,30

2.93333333333333905.06666666666789348.8000000000

(6)

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 doesn't make much sense to use the same value for each column, so Maple supports using a list or Vector of values instead.

AbsoluteDeviationHouseSalesData,3,1000,100000

0.666666666666667157.46666666666718336.8666666667

(7)

StandardErrorMoment,HouseSalesData,1,origin=3,1000,100000

0.20798860367640254.18154393982985425.38962762635

(8)

Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam