Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
AW: st: float to numeric??
From 
 
"Martin Weiss" <[email protected]> 
To 
 
<[email protected]> 
Subject 
 
AW: st: float to numeric?? 
Date 
 
Mon, 21 Jun 2010 09:16:49 +0200 
<> 
" all
I want is to stata recognize values where chipeligrate == 0.1 so that I
can generate some other variable based on that."
Try http://www.stata.com/support/faqs/data/float.html then!
HTH
Martin
-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Özlen D. Luznar
Gesendet: Montag, 21. Juni 2010 05:30
An: [email protected]
Betreff: re: st: float to numeric??
I should have added that float, compress commands neither worked.  even
recast with force did not work!!!  I am really frustrated with this.  all
I want is to stata recognize values where chipeligrate == 0.1 so that I
can generate some other variable based on that.  I did not encounter this
problem before and honestly am surprised to see I have other variables
that are stored as float in the data set.  Very puzzling.
. recast  int wtfamf96
wtfamf96:  22113 values would be changed; not changed
. describe  wtfamf96
              storage  display     value
variable name   type   format      label      variable label
----------------------------------------------------------------------------
---
wtfamf96        float  %9.0g                  poverty adjusted family weight
. recast int  wtfamf96 [, force]
weights not allowed
r(101);
. recast int  wtcfam96
wtcfam96:  21634 values would be changed; not changed
. recast  wtdper96 {, force}
{ invalid name
r(198);
. recast int  wtdper96 [, force]
weights not allowed
r(101);
. recast long  wtfamf96
wtfamf96:  22113 values would be changed; not changed
. recast long  wtdper96 [, force]
weights not allowed
> .
>
> Check out the -float()- function.
>
> http://www.stata.com/help.cgi?data+types
>
> http://www.stata.com/help.cgi?float
>
>> Hi everyone,
>>
>>
>>  I have a variable stored as float chip eligibility rate variable.  very
>> straightforward - varies between .1 and 4.  But it is stored as float
>> and
>> gives me major toruble when I am using the values to generate new
>> variables etc.  I would like to store it as numeric so that stata can
>> recognize the values of this variable.  Does anyone have experience with
>> this??
>> . codebook chipeligrate
>>
>>
----------------------------------------------------------------------------
--
>> chipeligrate                   chip eligibility rate by year and age and
>> state
>>
----------------------------------------------------------------------------
--
>>
>>                   type:  numeric (float)
>>
>>                  range:  [.1,4]                       units:  .01
>>          unique values:  40                       missing .:  0/6585
>>
>>                   mean:   1.92923
>>               std. dev:   .720279
>>
>>            percentiles:        10%       25%       50%       75%
>> 90%
>>                                  1       1.5         2         2
>> 3
>>
>> I need to chnage this variable and store is as int but I can not figure
>> out how. So far I tried compress but it seemed to work but when I
>> described the variable, still float.
>>
>>  Thanks so much for your help in advance.
>>
>>
>
>
> -Dave
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>
>
-- 
Özlen D. Luznar
PhD Candidate - Public Policy
Graduate Research Assistant
University of Maryland Baltimore County (UMBC)
1000 Hilltop Circle
Baltimore, MD 21250
410-455-6527 office
443-846-5010 cell
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/