SHAZAM Questions and Answers (Q&A) - RSS feedhttp://community.econometrics.com/questions/SHAZAM Econometrics, Statistics and Analytics Communityen<font color="white">Copyright <b>SHAZAM Analytics, 2018</b></font>Sat, 11 Jan 2014 04:43:51 +0000In a Flexible Least Squares (FLS) regression, how do you save the "coeff=var" results into a matrix?http://community.econometrics.com/question/425/in-a-flexible-least-squares-fls-regression-how-do-you-save-the-coeffvar-results-into-a-matrix/For example, I have a `coeff=CT` at the end - which yields an n x k matrix - and then I use the `write(Betas.mtx) CT` to transfer it to a matrix but it gets diluted down to a single columnFri, 10 Jan 2014 13:14:42 +0000http://community.econometrics.com/question/425/in-a-flexible-least-squares-fls-regression-how-do-you-save-the-coeffvar-results-into-a-matrix/Answer by SHAZAMHelp for <p>For example, I have a <code>coeff=CT</code> at the end - which yields an n x k matrix - and then I use the <code>write(Betas.mtx) CT</code> to transfer it to a matrix but it gets diluted down to a single column</p>
http://community.econometrics.com/question/425/in-a-flexible-least-squares-fls-regression-how-do-you-save-the-coeffvar-results-into-a-matrix/?answer=429#post-id-429The matrix is being created and written correctly to the disk. The matrix can also be used in subsequent calculations.
However, there appears to be a bug in reading the header of the matrix when displaying in the data editor. This will be repaired in the next update (11.1) due shortly.
In the meantime you can open it in notepad as the file is simply text.
To write out a large matrix and override the default display, use a FORMAT statement. This example creates a 20 by 20 identity matrix and writes it to a file. See the SHAZAM Manual for more examples.
* Create an identity matrix 20x20
matrix x = iden(20)
* Define how to output
* i.e. 20 columns of floating point of up to 8 digits with 4 decimal places
format(20f8.4)
* Write the matrix x to the current path and use the previous format statement
write(xmatrix.mtx) x / format
Fri, 10 Jan 2014 19:48:42 +0000http://community.econometrics.com/question/425/in-a-flexible-least-squares-fls-regression-how-do-you-save-the-coeffvar-results-into-a-matrix/?answer=429#post-id-429Comment by OYassin for <p>The matrix is being created and written correctly to the disk. The matrix can also be used in subsequent calculations.</p>
<p>However, there appears to be a bug in reading the header of the matrix when displaying in the data editor. This will be repaired in the next update (11.1) due shortly.</p>
<p>In the meantime you can open it in notepad as the file is simply text.</p>
<p>To write out a large matrix and override the default display, use a FORMAT statement. This example creates a 20 by 20 identity matrix and writes it to a file. See the SHAZAM Manual for more examples.</p>
<pre><code>* Create an identity matrix 20x20
matrix x = iden(20)
* Define how to output
* i.e. 20 columns of floating point of up to 8 digits with 4 decimal places
format(20f8.4)
* Write the matrix x to the current path and use the previous format statement
write(xmatrix.mtx) x / format
</code></pre>
http://community.econometrics.com/question/425/in-a-flexible-least-squares-fls-regression-how-do-you-save-the-coeffvar-results-into-a-matrix/?comment=430#post-id-430Thanks! Opens well in notepad, however the result (which is supposed to be a 107x10 matrix as the header indicates correctly) turns out to be a 214x5 - basically it puts the last 5 columns under the first 5. Is there a way to adjust that default option?Fri, 10 Jan 2014 22:08:14 +0000http://community.econometrics.com/question/425/in-a-flexible-least-squares-fls-regression-how-do-you-save-the-coeffvar-results-into-a-matrix/?comment=430#post-id-430Comment by SHAZAMHelp for <p>The matrix is being created and written correctly to the disk. The matrix can also be used in subsequent calculations.</p>
<p>However, there appears to be a bug in reading the header of the matrix when displaying in the data editor. This will be repaired in the next update (11.1) due shortly.</p>
<p>In the meantime you can open it in notepad as the file is simply text.</p>
<p>To write out a large matrix and override the default display, use a FORMAT statement. This example creates a 20 by 20 identity matrix and writes it to a file. See the SHAZAM Manual for more examples.</p>
<pre><code>* Create an identity matrix 20x20
matrix x = iden(20)
* Define how to output
* i.e. 20 columns of floating point of up to 8 digits with 4 decimal places
format(20f8.4)
* Write the matrix x to the current path and use the previous format statement
write(xmatrix.mtx) x / format
</code></pre>
http://community.econometrics.com/question/425/in-a-flexible-least-squares-fls-regression-how-do-you-save-the-coeffvar-results-into-a-matrix/?comment=431#post-id-431Edited the answer above to show how to write using different formats.Sat, 11 Jan 2014 04:43:51 +0000http://community.econometrics.com/question/425/in-a-flexible-least-squares-fls-regression-how-do-you-save-the-coeffvar-results-into-a-matrix/?comment=431#post-id-431