Statalist


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

st: RE: matrix subsetting


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: matrix subsetting
Date   Thu, 8 Oct 2009 13:02:26 +0200

<>

**************
mat z = x[1..3,1],x[1..3,3]
**************


HTH
Martin

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Thomas
Sent: Donnerstag, 8. Oktober 2009 12:53
To: statalist@hsphsun2.harvard.edu
Subject: st: matrix subsetting

Dear all,

I am trying to extract non-adjacent columns (1 and 3) from a matrix (in 
Stata not Mata):

mat x = (1,2,3,4 \ 5,6,7,8 \ 9,10,11,12)
mat z = x[1..3,(1,3)]

I get a type mismatch error. What am I doing wrong?

Many thanks,
Thomas

-- 
________________________________
Thomas Triebs
email: tpt21@cam.ac.uk

PhD Candidate
Judge Business School
University of Cambridge

Member of the Electricity Policy
Reseach Group
http://www.eprg.group.cam.ac.uk/

*
*   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   |   What's new   |   Site index