

Integer values between -32,767 and 32,740 Others, like income, go into tens of thousands and others again may represent precise measurements with a large number of decimal places. There are variables that consist of numbers 0 and 1 only.

Numbers (including datetime variables) can come in various sizes. These variables may contain up to 2 billion characters! However, you can use this type also for strings with 0 to 2045 characters. The other type of string variables is called "strL". so, "str26" may contain up to 26 characters. Typically, the type is denoted by "str#", with "#" being replaced by an appropriate number indicating the maximum length of the string. I am not quite sure what "earlier" means exactly.īut note that as of version 13.0, Stata offers two types of string variables: "Short" string variables with up to 2045 characters. In earlier versions, a string variable could contain up to 244 characters. But with Stata's "datetime" features, some computations, as well as the representation of data to the human eye (and mind) may become easier. These variables can be used like any other numeric variables. For instance, you may have one variable representing the year and another representing the month something happened.

Note that depending on the circumstances, using these specific features may not be absolutely necessary. There are specific ways for Stata to handle such information. Information about time may refer to dates as well as to time in terms of hours, minutes, seconds. This is what you will learn in a statistics course.Ī special type of numeric variables represents time.
#Tostring stata how to
it's always up to you to know what your data are about and how to handle them. In case you should try to hand in a paper to your professor in which you report this "mean country" value, your academic career may be in severe danger. For instance, Stata will compute the mean of the variable representing the country respondents come from, should you so desire. With numeric variables, you can perform any computations, meaningful or not. Here, "1" stands for Australia, 2" for West Germany", and so on. For instance, in the ISSP data, there is a variable indicating the country from which respondents come. Finally, numbers often are used to represent different entities. The extent of agreement likewise is represented numerically (with 1 standing for, say, "completely disagree" and 5 for "completely agree".
#Tostring stata series
In the social sciences, we often use measures for opinions or attitudes here, respondents state to which extent they agree or disagree with a series of statements (often called "items"). This may be income here the numbers stand for "real" numbers, i.e., 1200 Euros (or dollars) typically will be represented as 1200. The most common type of numeric variables is to represent something that has been "measured". But these numbers cannot be used as numbers, that is, you may not perform any mathematical operations on them. Actually, they may contain numbers as well they may even consist of numbers only.

Such variables are called string variables. The basic issue has already been pointed out in the introduction: In addition to numeric variables, your data set may contain variables that consist of other characters, particularly letters. Normally, this is stuff for advanced users, but there may be situations where even beginners have to know something about this issue. This is the topic of storage types, to which we will get back in the second section. in the memory or on the hard disk of your computer. This will be explored in the first section.Īnother thing to have in mind is the way numbers (or strings) are represented "internally", i.e. Second, "numbers" can mean different things. First, you may wish (or may have) to use data that contain "alphanumeric characters", or letters, as humans sometimes say. But this it not the whole story, in at least two ways. Typically, we think of (quantitative) data as numbers.
