Statalist The Stata Listserver


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

Re: st: variable data type problem


From   "Austin Nichols" <[email protected]>
To   [email protected]
Subject   Re: st: variable data type problem
Date   Mon, 18 Jun 2007 17:12:35 -0400

Jon Schwabish <[email protected]>:
I think David Kantor identified your problem, but I think you should,
in general, either round and then -recast- since -recast- will
truncate (e.g. turn 3.9 into 3), or (possibly better) specify your
weight as an [aweight] instead.

clear
input f
4
3.2
3.8
33735
end
recast int f, force
li

clear
input f
4
3.2
3.8
33735
end
replace f=round(f)
recast long f
li


On 6/18/07, David Kantor <[email protected]> wrote:
Try -recast long-
HTH
--David

At 02:11 PM 6/18/2007, Jon Schwabish wrote:
> The weights appear to be
>integers (using the data browser) and I've tried
>compressing and reformatting but to no avail. When I
>try -recast int wgt-, it turns out that about 14
>different observations would be changed, but I can't
>tell why. (If I try -recast int wgt, force- Stata
>turns those observations into missings).
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index