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

From |
tanaka yoshi <[email protected]> |

To |
<[email protected]> |

Subject |
RE: st: string calculation |

Date |
Fri, 18 Jan 2008 06:10:03 +0900 |

Dear Bill Thank you very much for your prompt reply and answer. I really appreciate it. I understood your answer about my previous quetion, but I have one more question about matrix calculation. I am really sorry to trouble you again. First, I define matrix X. X=("a","b"\"c","d" ) Next, I would like to define Y, which is the inverse matrix of X, in the following form. Y=("d/ad-bc","-b/ad-bc"\ "-c/ad-bc","a/ad-bc") is there any command to get the matrix Y, which consists of string expressions??? Thank you very much for your help. Yoshi > From: [email protected] > To: [email protected] > Subject: Re: st: string calculation > Date: Thu, 17 Jan 2008 14:26:30 -0600 > > Tanaka Yoshi asks, > >> I have a question about the matrix calculation in the form of string. >> [...] >> >> . mata >> : X=("a","b") >> : Y=("c","d") >> : Z=X+Y >> : Z >> 1 2 >> +-----------+ >> 1 | ac bd | >> +-----------+ >> : end >> >> the result is (ac, bd), but the expression i want to get is (a+c, b+d). > > I assume Tanak means that the result is ("ac", "bd") and what he wants > is ("a+c", "b+d"). One solution is > > : Z = X :+ "+" :+ Y > > : Z > 1 2 > +-------------+ > 1 | a+c b+d | > +-------------+ > > Above I used the :+ operator, see -help [m2] op_colon-. > > Another solution is > > : Z = X + ("+", "+") + Y > > : Z > 1 2 > +-------------+ > 1 | a+c b+d | > +-------------+ > > -- Bill > [email protected] > * > * 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/ _________________________________________________________________ 出会いがない、と嘆いているあなたにぴったりの恋人探し！まずは無料検索！ http://match.jp.msn.com/channel/index.aspx?avo=1&trackingid=1034447 * * 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/

**References**:**Re: st: string calculation***From:*[email protected] (William Gould, StataCorp LP)

- Prev by Date:
**st: Big Datasets** - Next by Date:
**Re: st: Plotting (time-dependent) regression coefficients** - Previous by thread:
**Re: st: string calculation** - Next by thread:
**Re: RE: st: string calculation** - Index(es):

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