Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: names in -svmat- or -xsvmat-


From   Scott Merryman <scott.merryman@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: names in -svmat- or -xsvmat-
Date   Tue, 21 Feb 2012 09:15:38 -0600

. clear

. matrix A = matuniform(10,3 )

. svmat A, names("new" )
number of observations will be reset to 10
Press any key to continue, or Break to abort
obs was 0, now 10

. l

     +--------------------------------+
     |     new1       new2       new3 |
     |--------------------------------|
  1. | .2989895   .1242783   .4069879 |
  2. | .3532372   .1649015   .9410622 |
  3. | .8264513   .1102491   .9254955 |
  4. | .6745198   .4860738   .3739589 |
  5. | .5044847   .0174562   .6802818 |
     |--------------------------------|
  6. | .9221656   .1094441   .7122592 |
  7. | .7657751    .022603   .9540166 |
  8. |  .268645   .9931726   .2906715 |
  9. | .1230203   .2465395   .5952821 |
 10. | .3924873   .7112076   .8951514 |
     +--------------------------------+



"names(string) names the variables string1, string2, ..., stringn,
where string is a user-specified string and n is the number of columns
of the matrix."


Scott


On Tue, Feb 21, 2012 at 9:00 AM, Feiveson, Alan H. (JSC-SK311)
<alan.h.feiveson@nasa.gov> wrote:
> OK - I give up. Can someone please given an example of correct usage for the -names- option in -svmat- or -xsvmat- ? Thanks.
>
> Al Feiveson
>
>
> . matrix list A
>
> A[10,5]
>             c1          c2          c3          c4          c5
>  r1   .00821462  -.73199648  -.80059997  -1.3444995  -.73588118
>  r2   .38707652  -1.1705186   .27901232   .33415055  -.62922745
>  r3   1.5611447   .82326399  -.58581245    .6017733   .05173269
>  r4  -1.6878907  -1.4067196   1.0890974  -1.3119514    .0030182
>  r5  -1.1670293  -1.6118597   1.0981531   1.1144127   .47038956
>  r6  -1.2363605  -.10125067   .06286368  -1.0167974   .07966359
>  r7    .6152531  -1.0821879  -.30905276  -.02234645   -.0612078
>  r8  -.30916348   -.6575941  -1.3403386   .80353234   1.7169523
>  r9   .61394245   -.0329281  -.14108694  -2.0729119  -.83697348
> r10   .65664138  -1.4944258   3.2871298  -1.3584897   .36629252
>
>
>
> . xsvmat A,saving(bull,replace) names(y  x1  x2  x3  x4)
> new variables cannot be uniquely named or already defined
> r(110);
>
> . xsvmat A,saving(bull,replace) names(" y x1 x2 x3 x4")
> new variables cannot be uniquely named or already defined
>
> . xsvmat A,saving(bull,replace) names(y, x1, x2, x3, x4)
> invalid syntax
> r(198);
>
> . xsvmat A,saving(bull,replace) names("y, x1, x2, x3, x4")
> invalid syntax
> r(198);
>
> . xsvmat A,saving(bull,replace) names("y", "x1", "x2", "x3", "x4")
> invalid syntax
> r(198);
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index