Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: RE: Stata and R


From   Ronggui Huang <ronggui.huang@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: Stata and R
Date   Wed, 26 Aug 2009 07:05:20 +0800

I think it is hard to find a Stata command resembles that of length in R.
Generally speaking, it gets the length of vectors (including lists)
and factors, but the exact meaning of length in R depends on the class
of object.

For a data frame (which is similar with a dataset in Stata), it is the
number of variables.


2009/8/26 Cohen, Elan <cohened@upmc.edu>:
> Could you please be more specific?  There is no concept of 'length' in Stata since all the variables belong to one dataset.  Just guessing, but something like -count if mi(x)- might be helpful.
>
> If you'd like to subset, take a look at -drop- and -keep-.
>
> - Elan
>
>
>> -----Original Message-----
>> From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-
>> statalist@hsphsun2.harvard.edu] On Behalf Of Frank Peter
>> Sent: Tuesday, August 25, 2009 12:13 PM
>> To: statalist@hsphsun2.harvard.edu
>> Subject: st: Stata and R
>>
>> Dear Statalister,
>>
>> Please, I am new to Stata, I am trying to replicate some R commands in
>> Stata. I will like to know the equivalent of length and subset in Stata.
>>
>> Thanks.
>>
>> Frank
>> *
>> *   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/
>



-- 
HUANG Ronggui, Wincent
PhD Candidate
Dept of Public and Social Administration
City University of Hong Kong
Home page: http://asrr.r-forge.r-project.org/rghuang.html

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index