Crosstab by using the same input for both arguments
If I run one of the examples of crosstab, I get the same result as indicated in the crosstab webpage:
rng default; % for reproducibility
x1 = unidrnd(3,50,1);
x2 = unidrnd(3,50,1);
[table,chi2,p] = crosstab(x1,x2)
However, if I use the same input for both arguments of crosstab, I get a p-value basically equal to zero:
rng default; % for reproducibility
x1 = unidrnd(3,50,1);
x2 = unidrnd(3,50,1);
[table,chi2,p] = crosstab(x1,x1)
Shouldn’t I get a p-value higher if I use the same input for both argument of crosstab? (I was thinking about a p-value close to 1 actually)If I run one of the examples of crosstab, I get the same result as indicated in the crosstab webpage:
rng default; % for reproducibility
x1 = unidrnd(3,50,1);
x2 = unidrnd(3,50,1);
[table,chi2,p] = crosstab(x1,x2)
However, if I use the same input for both arguments of crosstab, I get a p-value basically equal to zero:
rng default; % for reproducibility
x1 = unidrnd(3,50,1);
x2 = unidrnd(3,50,1);
[table,chi2,p] = crosstab(x1,x1)
Shouldn’t I get a p-value higher if I use the same input for both argument of crosstab? (I was thinking about a p-value close to 1 actually) If I run one of the examples of crosstab, I get the same result as indicated in the crosstab webpage:
rng default; % for reproducibility
x1 = unidrnd(3,50,1);
x2 = unidrnd(3,50,1);
[table,chi2,p] = crosstab(x1,x2)
However, if I use the same input for both arguments of crosstab, I get a p-value basically equal to zero:
rng default; % for reproducibility
x1 = unidrnd(3,50,1);
x2 = unidrnd(3,50,1);
[table,chi2,p] = crosstab(x1,x1)
Shouldn’t I get a p-value higher if I use the same input for both argument of crosstab? (I was thinking about a p-value close to 1 actually) crosstab, p-value MATLAB Answers — New Questions