Statalist


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

Re: st: RE: marksample


From   "Ashim Kapoor" <[email protected]>
To   [email protected]
Subject   Re: st: RE: marksample
Date   Thu, 11 Sep 2008 17:11:24 +0530

Hello Nick,

Thank  you for your time. Also thank you for your note on sortrows.
Currently I am working on making " sortkeyrows" an ado file which will
sort using a key. I will email the ado file to the list once I am
done. I came across marksample while examining the code for sortrows.

Let me rephrase my question.

In the ado file for sortrows. we say " marksample touse".
:
:
Later on we say st_view(X,., tokens(varlist), touse)

Now if I understand st_view correctly touse should be a string of
variable names which should be non zero for selection of values. But
marksample is NOT producing is list of variable names.

Where am I wrong?

Thank you,
Ashim.

On 9/11/08, Nick Cox <[email protected]> wrote:
> -marksample- is not part of Mata. It is a Stata command.
>
> It marks observations, not variables.
>
> It produces a new temporary variable, not a matrix.
>
> It is possible to use -marksample- independently of -syntax-:
>
> . sysuse auto
> (1978 Automobile Data)
>
> . local if "2 == 2"
>
> . marksample touse, novarlist
>
> . su `touse'
>
>    Variable |       Obs        Mean    Std. Dev.       Min        Max
> -------------+--------------------------------------------------------
>    __000000 |        74           1           0          1          1
>
> However, it is usual to use -marksample- after -syntax-, or after a set
> of commands that produced similar results. I can't think up a different
> kind of situation in which -marksample- is the command of choice.
>
> Nick
> [email protected]
>
> Ashim Kapoor
>
> I am trying to learn MATA. I have a query. What is marksample ? Does
> it  return a matrix  with 0's in place of variables which are NOT
> marked. Is it ONLY used after syntax ?
>
> I did not find the help very useful. Can someone please shed some
> light on this ?
>
>
> *
> *   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/
>
*
*   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