Bookmark and Share

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: dropping matrix columns


From   Nick Cox <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: dropping matrix columns
Date   Thu, 12 Dec 2013 16:56:48 +0000

-svmat- really is an anomaly. I can remember comments about the end of
the last century, and I am being literal and not exaggerating, that it
was due for an overhaul, which never came. But then came Mata and -- I
am imputing a missing statement here -- the implication is that it is
superseded but remains available so as not to break any existing
programs or do-files. It's not worth any developer time to update
something in that condition. It would be like adding an engine to a
donkey.

So, the short and general answer is: Don't write anything now using
-svmat-. There will be a much better way to do what you want using
Mata. In particular, check out -putmata- and -getmata-.

Nick
[email protected]


On 12 December 2013 16:40,  <[email protected]> wrote:
>  Dear Stata Users,
>
> I am using a loop in which many large matrices are created. I want to use (each of) these matrices to create a single new dataset using the -svmat- command. For each of the matrices many of the column names start with a number AND are the columns empty. Since variable names that start with a number are not allowed -svmat- does not work, i.e. I first need to either change get rid of the first numbers in the column names or delete these columns ( I dont need them).
> How can I tell stata to drop all matrix columns for which the name starts with a number OR tell stata to drop all columns in a matrix that are entirely empty?
>
> Many thanks
>
> Darjusch
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/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/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index