Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Data Analysis with STATA

You're reading from  Data Analysis with STATA

Product type Book
Published in Oct 2015
Publisher Packt
ISBN-13 9781782173175
Pages 176 pages
Edition 1st Edition
Languages

Table of Contents (16) Chapters

Data Analysis with Stata
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Introduction to Stata and Data Analytics 2. Stata Programming and Data Management 3. Data Visualization 4. Important Statistical Tests in Stata 5. Linear Regression in Stata 6. Logistic Regression in Stata 7. Survey Analysis in Stata 8. Time Series Analysis in Stata 9. Survival Analysis in Stata Index

Summarizing the data and preparing tabulated reports


Now, we will use the Fridge_sales data for further commands. For this, you need to inform Stata that you will be using Fridge_sales_data with the following command:

use fridge_sales_data

Now, in this data, the variables' volume denotes the volume of the fridge. How do you generate this variable in Stata? Your answer lies in using the summarize command:

summarize volume

The output of this command is as follows:

Now, you need to create a new variable called volume_ratio. The volume ratio denotes the fridge volume divided by 20:

generate volume_ratio = volume / 20

The generate command creates new variables in the given dataset. Similarly, for existing variables that need to be treated and made perfect for further analysis, you can use the replace command:

For example, take a look at the following:

replace volume = volume / 20

Now, you can see the changes between the original variable and the derived variable using the summarize command:

summarize...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}