Statalist The Stata Listserver


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

Re: st: variable data type problem


From   David Kantor <[email protected]>
To   [email protected]
Subject   Re: st: variable data type problem
Date   Mon, 18 Jun 2007 16:41:07 -0400

What is the data type to begin with?
What is the range of values? int can handle only -32767 .. 32740. Maybe some values are out of range.
(int is different from integer. There are three integer types: byte, int, and long. long has the largest range)

The other issue that -recast- would complain about is non-integer values, but I think that if you use the -force- option, those would be truncated, rather than changed to missing -- I think.

Try -recast long-
HTH
--David

At 02:11 PM 6/18/2007, Jon Schwabish wrote:

I am getting a very strange data storage type problem.
I am creating a data set that counts the number of
people by age using the -collapse- command. I then
merge these numbers back onto a larger data set (to
use as fixed weights). I am then using the
-tab- command to compare two variables (using the
weights) with no problem. When I use the -tabout-
command, I get an error that frequency weights must be
integers.

So here's the problem: 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).

Any ideas for dealing with this problem?

Thanks,
jon
*
*   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