2.13.1.3 crosstab(Pro)


Menu Information

Statistics: descriptive statistics: Cross Tabulation and Chi-Square

Brief Information

Perform cross tabulation analysis

Additional Information

This feature is for OriginPro only.

Command Line Usage

crosstab row:=col(B) col:=col(G) lay:=col(C);

X-Function Execution Options

Please refer to the page for additional option switches when accessing the x-function from script

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Row row

Input

Range

<active>

Specify data from a column as row variable.

Column col

Input

Range

<unassigned>

Specify data from a column as column variable.

Layer lay

Input

Range

<optional>

Specify data from a column as layer variable. When a layer variable is specified, the Cross Tabulation between the row and column variable will be created at each level of the layer variable.

Frequencies freq

Input

Range

<optional>

If data is summarized as frequency data mode, specify the frequency column as frequencies variable.

Contingency Table ctable

Input

TreeNode

<unassigned>

It determines which statistics to calculate and output in the Contingency Table.

Significant Level sig

Input

double

0.05

Specify the significant level for the following hypothesis testing.

Chi-Square Test chi

Input

int

1

Specify whether to perform Chi-Square Tests to determine whether there is a significant relationship between variables in the contingency table.

Note: To learn more details for these statistics, see the introduction, algorithm and the interpreting results page

Fisher's Exact Test fisher

Input

int

0

Specify whether to perform Fisher's Exact Test to determine whether there is a significant relationship between variables in the contingency table.

Note: To learn more details for these statistics, see the introduction, algorithm and the interpreting results page

Measures of Association massocial

Input

TreeNode

<unassigned>

It determines which statistics to calculate to assess the strength of the relationship between the variables in the contingency table.

Kappa kappa

Input

int

0

Specify whether to perform this test to measure and test the agreement of matched-pairs data.

Bowker's Test (Mcnemar for [2*2]) bowker

Input

int

1

Specify whether to perform this test to measure and test the agreement of matched-pairs data.

Cochran-Mantel-Haenszel cmh

Input

int

0

Specify whether to analysis the relationship of multiple contingency tables, including conditional independence test, odds radios’homogeneity test and common odds radio.

Relative Risk risk

Input

int

0

Specify whether to calculate Relative Risk to measures the ratio of the odds of an event occurring in an group to the odds of the event occurring in a comparison group.

Odds Ratio ratio

Input

int

0

Specify whether to calculate Odds Ratio to measures the ratio of the odds that an event or result will occur to the odds of the event not happening.

Mosaic Plot mosaic

Input

int

0

Specify whether to display Mosaic Plot whose area of each rectangle is proportional to the proportions of the Y variable in each level of the X variable.

Crosstab Report report

Output

ReportTree

[<input>]<new>

Specify the sheet for the crosstab result. The default value is a new sheet in the workbook of input data.

Plot Data rdplot

Output

ReportData

[<input>]<new>

Specify the sheet for the mosaic plot data. The default value is a new sheet in the workbook of input data.

Description

Cross tabulation is particularly useful for analyzing categorical data. In these analyses, a contingency table is used to display the frequency distribution of two or more variables. Analyses based on the table can determine whether there is a significant relationship between variables, and assess the strength of the relationship between the variables.

More Information

Options Tree Details

  • Contingency Table and Measures of Association
Please refer to Details of TreeNodes in Crosstab for more information.


For more information, please refer to our User Guide.

Examples

This example shows how to perform the Cross Tabulation. To get the interpretion of the Results, please refer this page.

// Import data file
newbook;
impASC fname:=system.path.program$+"\Samples\Statistics\MontanacOutlookPoll.dat";

// Preparing data for analysis. Set three columns as Categorical.
wks.col2.categorical.type=2;
wks.col3.categorical.type=2;
wks.col7.categorical.type=2;

//Performing Cross Tabulation
crosstab -r 2 row:=[MontanacOutlo]MontanacOutlookPoll!B"Age" col:=[MontanacOutlo]MontanacOutlookPoll!G"Financial Status" lay:=[MontanacOutlo]MontanacOutlookPoll!C"Sex"  mosaic:=1;