# 2.10.20 plotmatrix

## Brief Information

Create a scatter matrix plot as embedded graphs in worksheet

## Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Input irng

Input

Range

<active>

Specify the input data range.

Confidence Ellipse ellipse

Input

int

1

Specify whether to add confidence ellipse for each graph based on the chosen confidence level.

Confidence Level in % conflevel

Input

double

95

This is only available when the ellipse variable is set to 1. Use it to specify the confidence level in percentage for the confidence ellipses. This value must be greater than 0 and less than 100

Linear Fit fit

Input

int

0

Specify whether to perform a linear fit to each pair of variables. When this is checked, the fitted line and the adjusted R^2 value will be added to each scatter graph.

Exclude Missing Values Listwise missing

Input

int

0

Specify whether to exclude missing values listwisely. That is, exclude the entire row for all datasets if there are any missing values in this row.

Output Results rd

Output

ReportData

[<input>]<new>

This determines where the calculated data for the ellipse and the fit are stored. The default location is a new worksheet within the source workbook.

Result Graph rt

Output

ReportTree

[<input>]<new template:=graph>

This determines where the graphs will be stored. The default location is a new worksheet based on the GRAPH.OTW template within the source workbook.

## Description

This X-Function can be used to create a scatter matrix of multiple variables with normal distributions, which can be used to determine if pairs of such variables correlate or not.

Confidence ellipse can be added to each scatter plot. This helps you to judge the correlation of the pair of variables plotted in the graph.

Linear fit can be performed to each scatter plot. The inclination angle of the fitted line indicates the direction of the correlation. If it is positive, this means that the increase of one variable is likely to cause the increase of the other variable. While a negative angle indicates a reverse relationship. The slope of the fit varies from -1 (perfectly negative correlation) to +1 (perfect positive correlation).

## Examples

// Create a Scatter Matrix using columns 2, 3 and 5 of the specified Worksheet
newbook na:=PlotMatrixEX op:=1;
wo -a 3;   // Add 3 columns
col(1)=data(1,30);
col(2)=uniform(30);
col(3)=normal(30);
col(4)=uniform(30);
col(5)=col(3);
plotmatrix
irng:=[PlotMatrixEX]Sheet1!(2,3,5)
ellipse:=1
conflevel:=50
fit:=1;

// Here we create a new book with sheets for our data and our graphs.
// We then use this same book for gathering Scatter Matrix results
// for columns 1 and 2 in all sheets in our source book.
newbook na:=PMEx2 op:=1;
repeat 3 newsheet;
loop(ii,1,4) {
page.active = ii;     // for each sheet
col(1) = uniform(25);
col(2) = uniform(25);
}
for( ii = 1 ; ii <= 4 ; ii++)
{
range rData = [PMEx2]\$(ii)!(1,2);
plotmatrix
irng:=rData
ellipse:=1
conflevel:=50
fit:=1
rd:=[STATS]MyScatterData
rt:=[STATS]MyScatterGraphs;
}

## Algorithm

Assuming the pair of two variables follows bivariate normal distribution, we can study the relationship of the two variables by this test. The confidence ellipse is centered at , and the major semiaxis and major semiaxis are given by the following equations: 1) Confidence ellipse for the population mean: 2) Confidence ellipse for prediction: The inclination angle of the ellipse indicates the angle from the axis deasil. It is computed by the following equation: ## References

1. Lewlaw R. Paradowski.1997. Uncertainty Ellipses and Their Application to Interval Estimation of Emitter Position, IEEE Transactions on aerospace and electronic systems. 33. Page:126-133
2. J. Wesley Barnes. 2002. Statistical Analysis for Engineers and Scientists. Tsinghua University, China.

## Related X-Functions

Keywords:confidence, ellipse, linear fit
{"ft_lang_label":"__label__en","ft_lang_prob":0.69464445,"math_prob":0.90258855,"size":4196,"snap":"2020-24-2020-29","text_gpt3_token_len":1051,"char_repetition_ratio":0.12046756,"word_repetition_ratio":0.038235296,"special_character_ratio":0.24761678,"punctuation_ratio":0.12915601,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9937949,"pos_list":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20],"im_url_duplicate_count":[null,5,null,5,null,5,null,5,null,5,null,5,null,5,null,5,null,5,null,5,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-06-04T09:24:42Z\",\"WARC-Record-ID\":\"<urn:uuid:35f67cd1-fe60-4369-a6fd-8520d089db69>\",\"Content-Length\":\"151578\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:9ee554f2-bcfe-49d9-a056-b7953fad88c5>\",\"WARC-Concurrent-To\":\"<urn:uuid:e01f2c5a-217d-4837-a8aa-54f3dfe0e78a>\",\"WARC-IP-Address\":\"13.249.39.164\",\"WARC-Target-URI\":\"http://cloud.originlab.com/doc/X-Function/ref/plotmatrix\",\"WARC-Payload-Digest\":\"sha1:FISSQCM44EBIIOG2GZAW2KX52GACFWU3\",\"WARC-Block-Digest\":\"sha1:B344UFBMZJOA3UUZG3AKCJONVZQ7O4EW\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-24/CC-MAIN-2020-24_segments_1590347439213.69_warc_CC-MAIN-20200604063532-20200604093532-00514.warc.gz\"}"}