# Data Science: An Introduction/Single Variable Analysis

Data Science: An Introduction
* Welcome to Data Science
** 01: A History of Data Science
** 02: A Mash-up of Disciplines
** 03: Definitions of Data
** 04: The Impact of Data Science
* Thinking about the World
** 05: Thinking Like a Visual Artist
** 06: Thinking Like a Data Engineer (Oct 13, 2012)
** 07: Thinking Like a Hacker
** 08: Thinking Like a Programmer
** 09: Thinking Like a Scientist
** 10: Thinking Like a Mathematician
** 11: Thinking Like a Statistician
** 12: Thinking Like a Domain Expert
* Analyzing and Visualizing, Part One
** 13: Single Variable Analysis
** 14: Single Variable Tables and Plots
* Setting up the Problem
** 15: Theory-Based Inquiry
** 16: Theoretical vs Measured Variables
** 17: Hypothesis Testing
* Collecting, Ingesting, Transforming Data
** 18: Collecting vs Finding Data
** 19: Data Dictionaries and Schemas
** 20: Data Preparation and Metadata
* Analyzing and Visualizing, Part Two
** Scientific data visualisation
** 21: Two Variable Analysis
** 22: Two Variable Tables
** 23: Two Variable Plots
* Emergent Answers to Free Form Problems
** 24: Non-Theory-Based Inquiry
** 25: Exploratory Analysis
* Analyzing and Visualizing, Part Three
** 26: Scientific data visualisation
** 26: Multiple Variable Analysis
** 27: Multiple Variable Tables
** 28: Multiple Variable Plots
* Presenting Results
** 29: Statistical Significance vs Substantive Significance
** 30: Telling the Story
** 31: Writing Good Data-Rich Paragraphs
** 32: Creating Good Data-Rich Slides
* Appendices
** 01. Glossary
** 02. Working in Groups
** 03. 250 R Commands
** 04. Research Design
** 05. Data Dictionary
Edit This Box

## Note to Contributors (remove this section when the chapter is complete)

First, please register yourself with Wikibooks (and list yourself below), so that we know who our co-contributors are. Also, please abide by the Wikibooks Editing Guidelines, Manual of Style, and Policies and Guidelines. Thank you.
Secondly, we only need basic, clear, straightforward information in each chapter. We are not trying to be exhaustive or complete—the value of this book is in the simple synthesis across subjects. There are other venues in which to wax eloquent on the deepness and complexities of a particular subject. Please place yourself in a "beginner's mind" as you make contributions. Please also scope each chapter so that it can be taught in a one-hour class period. If the chapter requires more than an hour to teach, it is probably too detailed.
* To the extent possible, please use terms and concepts in the way in which they are defined in the Wikipedia and Wiktionary. This way students can refer to the corresponding Wikipedia / Wiktionary page to get a deeper understanding of the concept.
Thirdly, this is a cross-disciplinary book. We want to help people apply data science to all fields. Therefore, we need a wide variety of simple examples and simple exercises.
Fourthly, please adhere to the simple structure of each chapter: Summary of Main Points, Discussion, More Reading, Exercises, and References. We want the More Reading section to link to on-line resources. The References section may contain off-line resources. To start a new page, you should use the wiki markup from this prototype page.
Fifthly, as with any Wikibook please feel free to make corrections, expand explanations, and make additions where necessary, even if it is not "your" chapter. Use the discussion page to explain changes that might be controversial.
Sixthly, some syntax rules:
* Please bold key terms and phrases the student should learn.
* Put the name of functions and code snippets using the 'code' tags: <code>lm</code>
* Use in-line links [[ ]] to the Wikipedia, Wiktionary, WikiCommons, Wikibooks, and other Wikimedia Foundation properties.
* Use references (<ref> </ref>) to "external" sources—both on-line and off-line.
** Use the citations templates to make citations : Template:Cite book, Template:Cite web, Template:Cite journal
* If you want to add an image or graph, you should load it into the Commons rather than uploading into Wikibooks.
** If appropriate, add the tag {{Created with R}}) when you upload the graph.
* If using a different package than R standard packages, put the name of the package in bold in parenthesis after each function : <code>MCMCprobit</code> ('''MCMCpack''')
* You can use the third chapter Definitions of Data as an example of how to craft a chapter.
Finally, thank you so much for volunteering to be part of our our team!

## Chapter Summary

As discussed in chapter three, a variable is a set of values we have measured from a group of objects. For example, we can measure the first name of each person in a class. Their actual collected name is the value for that person for the variable (which, in this case, we would call "FirstName") When we put all the values of "FirstName" together in a group, we call that group of values a Distribution. In data science speak we would say that "a variable has a distribution of values." In practice, however, many data scientists interchange the words distribution and variable as if they were synonyms.
Descriptive Statistics are calculations we perform on distributions to simply describe the variables. The two most common descriptive statistics we normally calculate are called Measures of Central Tendency, and Measures of Dispersion. Every variable, and hence every distribution, has a data type—nominal, ordinal, interval, or ratio. We have distinct descriptive statistics for each data type. The table below lists the names of the simple descriptive statistics for each data type.
Generally speaking, except for physics and chemistry, most data science projects either do not use ratio data, or the ratio data is converted to interval data (into what is sometimes called "log-normal" data). Thus, the Geometric Mean and the Coefficient of Variation are rarely used by data scientists. We also must be careful not to mis-apply the descriptive statistics of one data type to that of another. This will often result in a mis-interpretation of the data. The exception is that we can cautiously apply descriptive statistics of a "lower" data type to a "higher" data type. That is, we can appropriately calculate the median for interval data, but not the arithmetic mean for ordinal data.

## Discussion
#### Distributions

The Normal Distribution
Other Common Distributions

#### Nominal Variables

Central Tendency
Dispersion

#### Ordinal Variables

Central Tendency
Dispersion
From Ordinal to "ordered nominal"

#### Interval Variables

Central Tendency
Dispersion
From Interval to Ordinal

#### Ratio Variables

Central Tendency
Dispersion
From Ratio to Interval

## Copyright Notice

You are free:
* to Share — to copy, distribute, display, and perform the work (pages from this wiki)
* to Remix — to adapt or make derivative works
Under the following conditions:
* Attribution — You must attribute this work to Wikibooks. You may not suggest that Wikibooks, in any way, endorses you or your use of this work.
* Share Alike — If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.
* Waiver — Any of the above conditions can be waived if you get permission from the copyright holder.
* Public Domain — Where the work or any of its elements is in the public domain under applicable law, that status is in no way affected by the license.
* Other Rights — In no way are any of the following rights affected by the license:
   * Your fair dealing or fair use rights, or other applicable copyright exceptions and limitations;
   * The author's moral rights;
   * Rights other persons may have either in the work itself or in how the work is used, such as publicity or privacy rights.
* Notice — For any reuse or distribution, you must make clear to others the license terms of this work.The best way to do this is with a link to the following web page.
       http://creativecommons.org/licenses/by-nc-sa/3.0/