Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: names in -svmat- or -xsvmat-
From
"Roger B. Newson" <[email protected]>
To
[email protected]
Subject
Re: st: names in -svmat- or -xsvmat-
Date
Tue, 21 Feb 2012 15:25:40 +0000
The -xsvmat- package now (as of the kast week or so) has an option
rename(oldname1 newname1 ... oldnameK newnameK)
allowing the user to rename variables in the output resultsset at will,
if only the user knows the old names. So, in your case, you could type
xsvmat A,saving(bull,replace) names(c1 y c2 x1 c3 x2 c4 x3 c5 x4)
and get the names that you seem to want.
I hope this helps.
Roger
Roger B Newson BSc MSc DPhil
Lecturer in Medical Statistics
Respiratory Epidemiology and Public Health Group
National Heart and Lung Institute
Imperial College London
Royal Brompton Campus
Room 33, Emmanuel Kaye Building
1B Manresa Road
London SW3 6LR
UNITED KINGDOM
Tel: +44 (0)20 7352 8121 ext 3381
Fax: +44 (0)20 7351 8322
Email: [email protected]
Web page: http://www.imperial.ac.uk/nhli/r.newson/
Departmental Web page:
http://www1.imperial.ac.uk/medicine/about/divisions/nhli/respiration/popgenetics/reph/
Opinions expressed are those of the author, not of the institution.
On 21/02/2012 15:00, Feiveson, Alan H. (JSC-SK311) 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/