I want to calculate a correlation matrix, where the lower triangle consists of Pearson and the upper triangle consists of Spearman rank correlation coefficients.
I am using `corr`

and `spearman`

, which works fine. But with `corr`

I cannot get the significance (p-value or stars and so on). So I tried `pwcorr, list`

which gives me the exact results but with significance.

Using this "new combination" I cannot create the matrix as with `corr`

.

```
//Get Pearson Matrix
corr var1 var2 var3
matrix R = r(C)
//Get Row and Column Names
local rnames : rownames R
local cnames : colnames R
//Get Spearman Rank Matrix
spearman var1 var2 var3, matrix star(0.05)
matrix S = r(Rho)
//Convert Pearson Matrix to Mata Matrix
mata: mataR = st_matrix("R")
//Convert Spearman Rank Matrix to Mata Matrix
mata: mataS = st_matrix("S")
//Clone Mata Pearson Matrix for Combined mataRS Mata Matrix
//Pearsson and Spearman Rank Matrix in Mata
mata: mataRS = mataR
//Replace Pearson r with Spearman rho in Top Half of Combined mataRS Mata Matrix
mata: mataRS[1,2] = mataS[2,1]
mata.... and so on.
//Display Pearson, Spearman Rank, and combined Matrices in Mata
mata: mataR
mata: mataS
mata: mataRS
//Convert combined mataRS Mata Matrix to Stata Matrix RS
mata: st_matrix("RS", mataRS)
matrix rownames RS = `rnames'
matrix colnames RS = `cnames'
//Display combined Stata Matrix RS
matlist RS, format(%8.4f)
```

When I replace `corr`

with `pwcorr, list`

I get the following error:

```
mata: mataRS[1,2] = mataS[2,1]
<istmt>: 3301 subscript invalid" for the command
```

(The code using is taken from http://www.stata.com/statalist/archive/2014-01/msg00349.html.)

Is there a "smart" way to solve this? (By the way, I am working with TeXMaker, so it would be great if the output can be transferred for LaTeX.)