![]() ![]() We then write the command, the old name of the variable, and then the new name:Ī common situation when working with data is that we have data somewhere, but not in Stata format. If we want to change the name, for instance to "population", we can rename the variable with the rename command, usually abbreviated ren. New variables are automatically named "var1", "var2" and so on. In the QoG dataset, which I use in a lot of examples, the observations are countries, and the variables are country characteristics. If it's persons, each person should have its own row, and so on.Įach variable gets its own column. If it's countries, each country should have its own row. If we do, the variable must be a string variable, and the numbers will be treated like any other text, and cannot be analyzed statistically.Įach observation - what we're comparing - should have its own row in the dataset. If it is a number the variable becomes a numeric, and if it is a piece of text the variable turns into a "string variable", a text variable. The first value we enter determines the type of variable. Then we can just start to enter our data in the cells, or paste it, from Excel for instance. We just click the button "Data editor", the symbol with the pen.
0 Comments
Leave a Reply. |