Statalist The Stata Listserver

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

RE: st: Re: coding

From   Maarten buis <>
Subject   RE: st: Re: coding
Date   Sat, 28 Jan 2006 12:11:11 +0000 (GMT)

Alexander Nervedi wrote:
> All i need to do is figure out how to get the formatting to
> show leading zeros!

Maarten Buis wrote:
> *-------begin example------
> sysuse auto, clear
> list price in 1/10
> format price %06.0f
> list price in 1/10
> *-------end example---------

also see: This also discusses puting your
variable as a string. This might be convenient if you want to say "if the third character equals
whatever do something smart".

Michael Blasnik wrote:
> If you had more years than you might need to create the score
> variable as a double. 
As long as you have 9 years or less you could probably better use the long dataformat. This will
ensure that your variabel realy is an interger. 

so use -gen long score=possibility*10^(year-1)- instead of -gen score=possibility*10^(year-1)-


Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting adress:
Buitenveldertselaan 3 (Metropolitan), room Z214

+31 20 5986715

NEW Yahoo! Cars - sell your car and browse thousands of new and used cars online!
*   For searches and help try:

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