p-values of Correlation Matrix
p-values of Correlation Matrix
Dear Mr.Doan,
I need to present the p-value of 3 variable correlation matrix as below.
Let me know some additional code or other ways.
CMOM(CORR, PRINT)
# Y1 Y2 Y3
I need to present the p-value of 3 variable correlation matrix as below.
Let me know some additional code or other ways.
CMOM(CORR, PRINT)
# Y1 Y2 Y3
Re: p-values of Correlation Matrix
THE p-value? A joint test of all three off-diagonal values? Or the P-VALUES, individually. The individual correlations are asymptotically N(0,1/obs). So
dec symm pvalues(%ncmom,%ncmom)
ewise pvalues(i,j)=%if(i==j,%na,%ztest(%cmom(i,j)*sqrt(%nobs)))
?pvalues
dec symm pvalues(%ncmom,%ncmom)
ewise pvalues(i,j)=%if(i==j,%na,%ztest(%cmom(i,j)*sqrt(%nobs)))
?pvalues
Re: p-values of Correlation Matrix
Thank you for reply, but it doesn't work.
I just wanna get correlation matrix with p-value in each cell, just like the ones which STATA or E-views generate as default or easily.
Please don't tell me, "Then, just go to STATA or E-views".
I also have another problem, 'font broken'. How can I fix it?
My code is as below.
* correlation matrix
cal(panelobs=4) 2020
all 30//2024:1
open data C:\audit_satisfaction3.xls
data(format=xls, org=cols)
/*
print / $
YEAR DEPT REGION RISKP EVIDENCE REQUEST $
Y1 Y2_1 Y2_2 Y2 $
Y3_1 Y3_2 Y3_3 Y3_4 Y3_5 Y3
*/
CMOM(CORR, PRINT)
# Y1 Y2 Y3
dec symm pvalues(%ncmom,%ncmom)
ewise pvalues(i,j)=%if(i==j,%na,%ztest(%cmom(i,j)*sqrt(%nobs)))
CMOM(CORR, PRINT)
# Y2_1 Y2_2
CMOM(CORR, PRINT)
# Y3_1 Y3_2 Y3_3 Y3_4 Y3_5
CMOM(CORR, PRINT)
# Y2_1 Y2_2 Y3_1 Y3_2 Y3_3 Y3_4 Y3_5
CMOM(CORR, PRINT)
# Y1 Y2_1 Y2_2 Y3_1 Y3_2 Y3_3 Y3_4 Y3_5
I just wanna get correlation matrix with p-value in each cell, just like the ones which STATA or E-views generate as default or easily.
Please don't tell me, "Then, just go to STATA or E-views".
I also have another problem, 'font broken'. How can I fix it?
My code is as below.
* correlation matrix
cal(panelobs=4) 2020
all 30//2024:1
open data C:\audit_satisfaction3.xls
data(format=xls, org=cols)
/*
print / $
YEAR DEPT REGION RISKP EVIDENCE REQUEST $
Y1 Y2_1 Y2_2 Y2 $
Y3_1 Y3_2 Y3_3 Y3_4 Y3_5 Y3
*/
CMOM(CORR, PRINT)
# Y1 Y2 Y3
dec symm pvalues(%ncmom,%ncmom)
ewise pvalues(i,j)=%if(i==j,%na,%ztest(%cmom(i,j)*sqrt(%nobs)))
CMOM(CORR, PRINT)
# Y2_1 Y2_2
CMOM(CORR, PRINT)
# Y3_1 Y3_2 Y3_3 Y3_4 Y3_5
CMOM(CORR, PRINT)
# Y2_1 Y2_2 Y3_1 Y3_2 Y3_3 Y3_4 Y3_5
CMOM(CORR, PRINT)
# Y1 Y2_1 Y2_2 Y3_1 Y3_2 Y3_3 Y3_4 Y3_5
- Attachments
-
- audit_satisfaction3.xls
- (112.5 KiB) Downloaded 620 times
Re: p-values of Correlation Matrix
I've attached a procedure for doing that. Just replace
CMOM(CORR,PRINT)
# Y1 Y2 Y3
@fancycorr
# y1 y2 y3
To me, it looks pretty cluttered and it's not clear what value pairwise correlation p-values have in a three, four or five way set of variables.
CMOM(CORR,PRINT)
# Y1 Y2 Y3
@fancycorr
# y1 y2 y3
To me, it looks pretty cluttered and it's not clear what value pairwise correlation p-values have in a three, four or five way set of variables.
- Attachments
-
- fancycorr.src
- (683 Bytes) Downloaded 674 times
Re: p-values of Correlation Matrix
Thank you for your reply.
1. What do you mean, "where you are getting that"?
My company purchased WinRats pro 10 version with genuine product certification.
Font problem had never happened before year 2022 in my PC.
Ok, now that I got to know this is the Window problem, I will ask pc guy this problem.
2. My apology for your clutteredness.
I need the values of the Pearson correlation.
Your fancycorr source code works, though, the output looks weird
- every cell in correlation matrix is found to be significant at the 0.01 level.
Usually, as many research papers show, some cells are significant or others are not.
In addition to 3 by 3 correlation test, I estimated 5 by 5 and 10 by 10.
All the results are same, that is to say, All cells in correlation matrix seem to be significant at the 0.01 level.
For example, 5 by 5 corr. matrix is as below.
This might be my data problem or ambiguity of my request.
I need your opinion again. Thank you.
Y3_1 Y3_2 Y3_3 Y3_4 Y3_5
Y3_1 1.0000 0.7914 0.8588 0.7138 0.7072
(0.0000) (0.0000) (0.0000) (0.0000)
Y3_2 0.7914 1.0000 0.8627 0.7471 0.7874
(0.0000) (0.0000) (0.0000) (0.0000)
Y3_3 0.8588 0.8627 1.0000 0.7873 0.8062
(0.0000) (0.0000) (0.0000) (0.0000)
Y3_4 0.7138 0.7471 0.7873 1.0000 0.8171
(0.0000) (0.0000) (0.0000) (0.0000)
Y3_5 0.7072 0.7874 0.8062 0.8171 1.0000
(0.0000) (0.0000) (0.0000) (0.0000)
1. What do you mean, "where you are getting that"?
My company purchased WinRats pro 10 version with genuine product certification.
Font problem had never happened before year 2022 in my PC.
Ok, now that I got to know this is the Window problem, I will ask pc guy this problem.
2. My apology for your clutteredness.
I need the values of the Pearson correlation.
Your fancycorr source code works, though, the output looks weird
- every cell in correlation matrix is found to be significant at the 0.01 level.
Usually, as many research papers show, some cells are significant or others are not.
In addition to 3 by 3 correlation test, I estimated 5 by 5 and 10 by 10.
All the results are same, that is to say, All cells in correlation matrix seem to be significant at the 0.01 level.
For example, 5 by 5 corr. matrix is as below.
This might be my data problem or ambiguity of my request.
I need your opinion again. Thank you.
Y3_1 Y3_2 Y3_3 Y3_4 Y3_5
Y3_1 1.0000 0.7914 0.8588 0.7138 0.7072
(0.0000) (0.0000) (0.0000) (0.0000)
Y3_2 0.7914 1.0000 0.8627 0.7471 0.7874
(0.0000) (0.0000) (0.0000) (0.0000)
Y3_3 0.8588 0.8627 1.0000 0.7873 0.8062
(0.0000) (0.0000) (0.0000) (0.0000)
Y3_4 0.7138 0.7471 0.7873 1.0000 0.8171
(0.0000) (0.0000) (0.0000) (0.0000)
Y3_5 0.7072 0.7874 0.8062 0.8171 1.0000
(0.0000) (0.0000) (0.0000) (0.0000)
Re: p-values of Correlation Matrix
.7, .8, correlations are big numbers; with a data set that size, you would get around .30 as marginal at the .05 level, so those are more than 4 standard deviations. If those are raw data (which seems to be the case here), it wouldn't be surprising for high correlations like that if they have common trends or individual effects.
Re: p-values of Correlation Matrix
Understood as clear as it gets, thank you.