Statalist The Stata Listserver


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

RE: st: Mata - what comes after -st_addvar-?


From   "Simo Hansen" <[email protected]>
To   <[email protected]>
Subject   RE: st: Mata - what comes after -st_addvar-?
Date   Wed, 6 Sep 2006 10:49:56 +0300

In addition Raphael question, I would like ask whether Stata Crop. plans a
netcourse on the econometrics of cross-Section and panel data using Stata as
Stata Corp recently introduced a netcourcse on the econometrics of time
series using Stata.
Best regards,
Simo 

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Raphael Fraser
Sent: Tuesday, September 05, 2006 6:33 PM
To: [email protected]
Subject: Re: st: Mata - what comes after -st_addvar-?

Bill,

Any plans for a Mata netcourse in the future?

Raphael

On 9/5/06, William Gould, Stata <[email protected]> wrote:
> Danielle <[email protected]> wrote,
>
> > Suppose I have a columnvector in Mata. I know I can use -st_addvar- to
add a
> > variable to the Stata dataset. But how do I fill in the values of that
> > variable with the values of the Mata columnvector? (By now, I have pored
> > through the manual, and I canno t find a reference to this!) Thanks,
> > Danielle
>
> You use -st_store()- and I apologize that, in the Also See in
> [M-5] st_addvar(), that was not mentioned.
>
> Let's use the auto data,
>
>         . sysuse auto, clear
>
> The auto data has 74 observations, so let's create a 74 x 1 vector and
> then use -st_addvar()- to create new variable -example- in the Stata
> dataset:
>
>         . mata
>
>         : x = J(74, 1, 2)
>
>         : st_addvar("float", "example")
>         13
>
>         : st_store(., "example", x)
>
>         : end
>
>         . describe
>         <output shows now variable example>
>
>         . list
>         <output shows new variable example contains 2 in every
observation>
>
> -- 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/
>
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index