You are not logged in. You can browse but not post. Login or Register by clicking 'Login or Register' at the top-right of this page. For more information on Statalist, see the FAQ.
I am working on the attached data and new stata user. Can I get commands for the mean, minimum, and maximum illiteracy rate among the 50 richest countries in the dataset.
I appreciate
If you have not yet imported your data into Stata, it is premature to ask for Stata code. If you are not sure how to load this data into Stata, read -help import delimited-.
If you have a Stata data set already, then please show example data using the -dataex- command. If you are running version 16 or a fully updated version 15.1 or 14.2, -dataex- is already part of your official Stata installation. If not, run -ssc install dataex- to get it. Either way, run -help dataex- to read the simple instructions for using it. -dataex- will save you time; it is easier and quicker than typing out tables. It includes complete information about aspects of the data that are often critical to answering your question but cannot be seen from tabular displays or screenshots. It also makes it possible for those who want to help you to create a faithful representation of your example to try out their code, which in turn makes it more likely that their answer will actually work in your data.
If you repost, showing an example from your Stata data set in this way, you are likely to get a timely and helpful response.
When asking for help with code, always show example data. When showing example data, always use -dataex-.
Thank you, I already have loaded the data set in stata 14.0, and could do some basic commands with the data such as summarize, but when asked 50 richest, I got confused. Let me visit the tutorials again.
Since you have not posted example data, I cannot know what your data set actually looks like, what your variable names are, and how the data are organized. Let me just give you some generic advice. First -drop- any observations for which the "rich" variable is missing. Then -gsort -rich- so that the 50 richest countries are in the first 50 observations. Then use -summarize- with the -in 1/50- condition.
You will need to replace "rich" by the actual name of whatever variable defines how rich a country is. This also assumes the data is organized with one and only one observation per country.
Comment