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" <simohansen@gmail.com>
To   <statalist@hsphsun2.harvard.edu>
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: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Raphael Fraser
Sent: Tuesday, September 05, 2006 6:33 PM
To: statalist@hsphsun2.harvard.edu
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 <wgould@stata.com> wrote:
> Danielle <dferry@nber.org> 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
> wgould@stata.com
> *
> *   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index