Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: variable algorithm


From   David Kantor <kantor.d@att.net>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: variable algorithm
Date   Sun, 13 Feb 2011 12:46:52 -0500

Hi,
To add to what Michael and Marcello wrote, you may also want to know about cond(). See...
http://www.stata-journal.com/article.html?article=pr0016

Concerning -if-, if you don't already know, there is an -if- qualifier (-help if-) and an -if- command (-help ifcmd-); they are very different; your problem looks like it will need the -if- qualifier on -generate-, and not the -if-command. Alternatively, you might use cond() and not use and -if- qualifier at all.

You problem was not stated very clearly, but that doesn't matter much. Presumably, you know what you want to do. We have given you the tools to do it.

--David

At 11:45 AM 2/13/2011, Michael wrote:
Jet, other useful resources for newly leaning Stata are the Stata Net Courses:
        http://stata.com/netcourse/
and books such as "A Gentle Introduction to Stata, 3rd Edition":
        http://stata.com/bookstore/acock3.html
Michael

On Feb 13, 2011, at 8:36 AM, Marcello Pagano wrote:

> Try
> . help generate
> and followup on --if--
>
> m.p.
>
> On 2/13/2011 11:29 AM, Jet wrote:
>> Hi, M.P.,
>>
>>    I know this is a simple question to many veteran Stata users; I
>> tried to use the "findit" help at Stata, but did not find useful
>> information. Do you know where is the relevant information located?
>> thanks a lot.
>>
>>    Jet
>>
>>
>> On Sun, Feb 13, 2011 at 11:19 AM, Marcello Pagano
>> <pagano@hsph.harvard.edu>  wrote:
>>> Dear Jet,
>>>
>>> Please do your homework by yourself.
>>>
>>> m.p.
>>>
>>>
>>> On 2/13/2011 11:12 AM, Jet wrote:
>>>>
>>>> Dear Statalisters:
>>>>
>>>>       I am to convert nine variables into a new variable with three
>>>> categories ( X1 X2 .... X9, each variable coded 0, 1, 2 3, thus
>>>> ranging from 0-27). The rules of converting into into three categories
>>>> are as follows:
>>>>
>>>>       Category 1: MDD if X1 or X2>=2 AND 5 or more other variables>=2;
>>>>       Category 2: OTHER if X1 or X2>=2 AND 2, 3, 4 variables>=2;
>>>>       Category 3: NEITHER if neither of the above conditions are met.
>>>>
>>>>    thank you very much.

*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index