Statalist


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

Re: st: replace an element in a matrix in stata


From   "Scott Merryman" <[email protected]>
To   [email protected]
Subject   Re: st: replace an element in a matrix in stata
Date   Tue, 22 Jul 2008 20:21:04 -0500

See -help mf_editvalue-

Scott


On Tue, Jul 22, 2008 at 6:28 PM, Xu, Jun <[email protected]> wrote:
> dear stata listers,
>
> i have a question about matrix functions in stata. if i have a matrix like
> a = 1, 2, 3, 4, 5, 6
> and I want to replace the third element 3 with another number, let's say 7 and turn a into 1, 2, 7, 4, 5, 6. Is there a function in stata that can help me achieve that. the problem here is i only know the dimension of the incoming matrix a, but i don't know what's exactly in a, a generic matrix. but i know what's to replace. if i knew a's contents, i would use some quasi identity matrix. any suggestions? thanks!
>
> jun xu, phd
> assistant professor
> department of sociology
> ball state university
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index