Statistics - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : System : Information : Updates : Maple 2016 : updates/Maple2016/Statistics

Statistics

 

Linear Regression

Hypothesis Testing

Summary and Tabulation

Visualizations

Linear Regression

All linear regression commands have been updated in Maple 2016 with a new option, summarize, that allows for the display of a summary for the given regression model.

 

withStatistics:

X  Vector1, 2, 3, 4, 5, 6, datatype=float:

Y  Vector2, 3, 4, 3.5, 5.8, 7, datatype=float:

 

By default, the Fit command returns the resulting regression model for the given model function:

 

Fita+b*t+c*t^2, X, Y, t;

1.96000000000000+0.164999999999999t+0.110714285714286t2

(1.1)

 

The summarize option includes a full summary for each of the regression coefficients, as well as values for the r-squared and adjusted r-squared for the model. Also, the solution module for regression commands has been extended with the ability to return values for r-squared, adjusted r-squared, and the value of the t-statistic for testing whether the corresponding regression coefficient is different than 0 and its corresponding probability.

 

Summary:
----------------
Model: 1.9600000+.16500000*t+.11071429*t^2
----------------
Coefficients:
    Estimate  Std. Error  t-value  P(>|t|)
a    1.9600    1.1720      1.6724   0.1930
b    0.1650    0.7667      0.2152   0.8434
c    0.1107    0.1072      1.0325   0.3778
----------------
R-squared: 0.9252, Adjusted R-squared: 0.8753

 

The summarize option can also be used to return an embedded table, which contains more details on the residuals:

 

Fita+b*t+c*t^2, X, Y, t, summarize=embed:

Summary

Model:

1.9600000+0.16500000t+0.11071429t2

Coefficients

Estimate

Standard Error

t-value

P(>|t|)

a

1.96000

1.17199

1.67237

0.193045

b

0.165000

0.766748

0.215194

0.843415

c

0.110714

0.107226

1.03253

0.377769

R-squared:

0.925169

Adjusted R-squared:

0.875282

Residuals

Residual Sum of Squares

Residual Mean Square

Residual Standard Error

Degrees of Freedom

1.28771

0.429238

0.655163

3

Five Point Summary

Minimum

First Quartile

Median

Third Quartile

Maximum

0.891429

0.290357

0.155714

0.290595

0.548571

Hypothesis Testing

The summarize option has also been added to all hypothesis testing commands. Previously, the infolevel command would have been required to print the results of a hypothesis test as a report.

 

withStatistics:

X  Array9, 10, 8, 4, 8, 3, 0, 10, 15, 9:

OneSampleChiSquareTestX, 7, confidence=.95, summarize=embed:

Chi-Square Test on One Sample

Null Hypothesis:

Sample drawn from population with standard deviation equal to 7

Alternative Hypothesis:

Sample drawn from population with standard deviation not equal to 7

Sample Size

Sample Standard Deviation

Distribution

Computed Statistic

Computed p-value

Confidence Interval

10.

4.24788

ChiSquare9

3.31429

0.0989571

2.92184..7.75496

Result:

Accepted: This statistical test does not provide enough evidence to conclude that the null hypothesis is false.

Summary and Tabulation

The DataSummary, FivePointSummary, and FrequencyTable commands can also accept a summarize option as well as be used to return summary statistics for DataFrames:

withStatistics:

X  DataFrameSampleUniform0,1,50,2|LinearAlgebra:-RandomVector50,generator=rand0..3

12310.8147236863931790.276025076998578320.9057919370756190.679702676853675230.1269868162935060.655098003973841140.9133758561390190.162611735194631250.6323592462254100.118997681558377160.09754040499940950.498364051982143070.2784982188670480.959743958516081180.5468815192049840.3403857266661330............

(3.1)

DataSummaryX,summarize=embed:

 

1

2

3

mean

0.5661101110386353

0.48987882283825

1.22

standarddeviation

0.3125414653315035

0.27855206779473884

1.1830434635864795

skewness

0.3716519256798299

0.11582452515575123

0.3106598115832435

kurtosis

1.729650721370971

1.7837876411157099

1.5501229720154914

minimum

0.031832846377420676

0.011902069501241397

0.0

maximum

0.9705927817606157

0.9597439585160811

3.0

cumulativeweight

50.0

50.0

50.0

Visualizations

There are many new visualizations in Maple 2016 for statistics and data analysis, including new options for creating colorschemes using point values:

withStatistics: 

dataMatrixSampleUniform0,1,50,2 | LinearAlgebra:-RandomVector50,generator=rand0..3

50 x 3 MatrixData Type: anythingStorage: rectangularOrder: Fortran_order

(4.1)

Maple 2016 also introduces a new visualization in Statistics for generating heat maps. A heat map is a visualization method that represents the magnitude of the included data as a discrete density plot.

U  seq0..10: V  seqsini, i=0..10: W  seqcosi, i=0..10:

CMCorrelationMatrixMatrixU, V, W, ignore;

1.0.1167417651013270.3542424351168500.1167417651013271.0.07016628339543250.3542424351168500.07016628339543251.

(4.2)

There are also two new visualizations related to Principal Component Analysis: Biplot, and ScreePlot.

IrisDFImportdatasets/iris.csv,base=datadir

IrisDFSepal LengthSepal WidthPetal LengthPetal WidthSpecies15.13.51.40.2setosa24.931.40.2setosa34.73.21.30.2setosa44.63.11.50.2setosa553.61.40.2setosa65.43.91.70.4setosa74.63.41.40.3setosa853.41.50.2setosa..................

(4.3)

The new GridPlot command is useful for visualizing multidimensional datasets. GridPlot generates a matrix of plots corresponding to the columns of a dataset.

GridPlotIrisDF`Sepal Length`,`Sepal Width`,`Petal Length`,`Petal Width`,upper = ScatterPlot, lower=SunflowerPlot, width=600, widthmode=pixels;

`Sepal Length`

`Sepal Width`

`Petal Length`

`Petal Width`