Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: RE: Defining a matrix of Characters


From   "Siyam, Amani" <siyama@who.int>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: RE: Defining a matrix of Characters
Date   Wed, 15 Mar 2006 10:03:57 +0100

Dear Nick,

Thanks for your response. I am actually putting together a short *.ado
to perform an analysis that requires that matrix of characters. 

I have Stata 9.1 and I thought of using Mata but if I do that then any
user with a Stata version lower than 9.0  will not be able to run my
ado.

Am I correct in assuming that.

Thanks for your help.

Amani


-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Nick Cox
Sent: 14 March 2006 19:30
To: statalist@hsphsun2.harvard.edu
Subject: st: RE: Defining a matrix of Characters

Long route or short, you must use Mata
for this. 

Nick 
n.j.cox@durham.ac.uk 

Siyam, Amani
 
> Could you kindly tell me if it is possible to define a matrix 
> A[1x6] of
> characters as follows:
> 
> matrix A=[a b c d e f]
> 
> I tried going the long route as follows:
> 
> 	foreach i in a b c d e f  {
> 		gen `i'= "`i'"
> 	}
> 	mkmat a b c d e f , matrix(A)
> 	
> 	varlist:  a:  string variable not allowed
> 	r(109);
> 
> I got an error message as you can see...

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2020 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index