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]

st: Transferring non real matrice from Mata to Stata.


From   Amadou DIALLO <stata.diallo@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: Transferring non real matrice from Mata to Stata.
Date   Thu, 7 Jul 2011 14:47:10 +0100

Hello,
I'm trying to send a non real matrice to Stata using st_matrix but
this is not working.
Some help may be handy.
Thanks.

. mata
------------------------------------------------- mata (type end to
exit) -----------------------------------
: A = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
"."\"yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"\1
type mismatch:  string \ real not allowed
r(3000);

: A
                                                           1
    +---------------------------------------------------------+
  1 |  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx  |
  2 |                                                      .  |
  3 |                   yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy  |
    +---------------------------------------------------------+

: A = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
"."\"yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"

: A
                                                           1
    +---------------------------------------------------------+
  1 |  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx  |
  2 |                                                      .  |
  3 |                   yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy  |
    +---------------------------------------------------------+

: B = 1\2\3

: C = strofreal(B)

: C
       1
    +-----+
  1 |  1  |
  2 |  2  |
  3 |  3  |
    +-----+

: D = A,C

: D
                                                           1
    +---------------------------------------------------------
  1 |  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  2 |                                                      .
  3 |                   yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
    +---------------------------------------------------------
                                                           2
     ---------------------------------------------------------+
  1                                                        1  |
  2                                                        2  |
  3                                                        3  |
     ---------------------------------------------------------+

: st_matrix("D",D)
             st_matrix():  3253  nonreal found where real required
                 <istmt>:     -  function returned error
r(3253);

: end
-------------------------------------------------------------------------------------------------------------



-- 

Amadou B. DIALLO, PhD.

Economist (Anti-Poverty Programs - DR Congo), AFTP3, The World Bank,
Washington DC.

Director, Center for Research and Training on Adult Health and Education.
Mayotte (FRANCE). www.aprosasoma.org
*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index