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

From |
Jon Ebeling <[email protected]> |

To |
[email protected] |

Subject |
st: Hello all |

Date |
Sat, 18 Sep 2004 08:16:21 -0700 |

I have a problem in trying to convert an alpha character to real. I have converted the data from spss to stata using stat transfer, but one of the numeric variables has na positioned for all of the "na" measures. I can see the actual values since when I run sum by a grouping command they appear. I'm a bit rusty in stata now, and I do recall that I could use the function real to convert the alpha characteris to their actual numeric values. I cannot seem to get the real command to work.

Perhaps if there is someone out there who might recall this procedure, I would be appreciative.

Here is what happens:

. tab hours

enter the |

number of |

hours |

written on |

the |

questionnai |

re in the |

space here. |

enter | Freq. Percent Cum.

------------+-----------------------------------

na | 1 25.00 25.00

na | 1 25.00 50.00

na | 1 25.00 75.00

na | 1 25.00 100.00

------------+-----------------------------------

Total | 4 100.00

when I try to convert these to real numbers it does this:

. real("hours")

unrecognized command: real

r(199);

I have been unable to find the real command in the handbooks, so I thought I might ask more skilled persons here.

The actual numbers are these:

. sort secnum

. by secnum: sum hours

----------------------------------------------------------------------------------------------------------

-> secnum = 1 cathy

Variable | Obs Mean Std. Dev. Min Max

-------------+--------------------------------------------------------

hours | 1 89 . 89 89

----------------------------------------------------------------------------------------------------------

-> secnum = 2 hassan

Variable | Obs Mean Std. Dev. Min Max

-------------+--------------------------------------------------------

hours | 1 12 . 12 12

----------------------------------------------------------------------------------------------------------

-> secnum = 3 freddi

Variable | Obs Mean Std. Dev. Min Max

-------------+--------------------------------------------------------

hours | 1 24 . 24 24

----------------------------------------------------------------------------------------------------------

-> secnum = 9

Variable | Obs Mean Std. Dev. Min Max

-------------+--------------------------------------------------------

hours | 1 23 . 23 23

If anyone can show me what mistakes I'm making I will be in your debt.

Thanks

jon ebeling

csu, chico

.

*

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

- Prev by Date:
**Re: st: RE: About generating variable consisting elasticities for each observations after probit command.** - Next by Date:
**Re: st: Hello all (Out of the Office from 9/20-9/24)** - Previous by thread:
**st: About generating variable consisting elasticities for each observations after probit command.** - Next by thread:
**Re: st: Hello all (Out of the Office from 9/20-9/24)** - Index(es):

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