Statalist The Stata Listserver


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

st: RE: RE: RE: tabodds command with 'if' option


From   "Visintainer, Paul" <PAUL_VISINTAINER@NYMC.EDU>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: RE: RE: tabodds command with 'if' option
Date   Tue, 7 Mar 2006 09:27:17 -0500

Appologies for the typo of the -for- command.  (The capitalization results from an "auto-correct" function in my word editor.  I catch most, but not all.)  More importantly, though, why is the -for- command being dropped?  Obviously -forval- and -foreach- are far more flexible, but the -for- command is quite convenient in routine data manipulation and analysis.  Its a great way to introduce new students to looping over numbers or variables.  I would vote for retaining it.

-p


-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu on behalf of Nick Cox
Sent: Fri 3/3/2006 11:04 AM
To: statalist@hsphsun2.harvard.edu
Subject: st: RE: RE: tabodds command with 'if' option
 
Note that -For- is not a Stata command. The command is -for-. Also, 
unless the user has an old version of Stata, no
on-line help is now available for -for-. 

For reasons documented elsewhere, -for- is in 
essence deprecated. -forval- and -foreach- 
should be considered preferable. 

Nick 
n.j.cox@durham.ac.uk 

Visintainer, Paul
 
> Assuming your data are set up appropriately, try:
> 
> For num 1/5: tabodds case year [fweight=freq] if cat == X

Sean Shu
 
> I have a cross-sectional time series dataset. I want to find 
> whether any
> 
> trend is presented over the years for different categories. So I used 
> tabodds command. But I want to apply the command for 
> different category 
> seperately. so I write the command syntax over the dataset attached:
> 
>  > tabodds case year [fweight=freq][if cat = 1]
>  > tabodds case year [fweight=freq][if cat = 2]
> ...
>  > tabodds case year [fweight=freq][if cat = 5]
> 
> Can you tell what's wrong with it? and Do I need write syntax to loop 
> the tabodds five time?

*
*   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/

<<winmail.dat>>




© Copyright 1996–2020 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index