Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: RE: automated production of labels


From   "David Winter" <d.l.winter@bham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: RE: automated production of labels
Date   Wed, 2 Nov 2005 17:42:08 -0000

That may well do the job, Nick!  Many thanks

****************************************************
Mr David L. Winter, HNC
I.T. Manager (BCCSS Study)
Department of Public Health & Epidemiology
Room 105, Public Health Building
University of Birmingham
Edgbaston
Birmingham
B15 2TT
UK
tel.: +44 (0)121 414 6766
fax.: +44 (0)121 414 7923
****************************************************
-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Nick Cox
Sent: 02 November 2005 17:33
To: statalist@hsphsun2.harvard.edu
Subject: st: RE: automated production of labels

Do you want something like this? 

forval i = 0(5)30 { 
	label define riskintvl `i' "`i'-`=`i'+4'", add 
} 
label define riskintval 35 "35-", add 

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

David L. Winter, HNC
 
> I have used -stset- and then -stsplit- on my (large) datasets:
> 
> Stsplit riskintvl, at (0,5,10,15,20,25,30,35)
> 
> Using -tab- on the created variable riskintvl gives :
> 
> Risk     |
> Interval |   Freq
> ------------------
>      0   |   .....
>      5   |   .....
>     10   |   .....
>     15   |   .....
>     20   |   .....
>     25   |   .....
>     30   |   .....
>     35   |   .....
> 
> Is there any way that I can automatically produce labels for 
> the values
> of riskintvl that encompass the range of values within each cell
> (value[n] - (1-value[n+1]) i.e
> 
> 0-4, 5-9, 10-14, 15-19, 20-24, 25-29, 30-34, 35-
> 
> I would be useful to do this for any definition of variables produced
> using -stsplit-

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