,
, NB: REMEMBER TO SET WORKING DIRECTORY
Data Visualization – Example Data: Census
Tufte’s 6 Principles of Graphical Integrity
1. Representation of numbers should match the true proportions
a. The “lie factor’ is a value used to describe the relation between the size of effect
shown in a graphic and the size of effect show in the data
b. Lie factor = size of effect shown in graphic/actual effect in data
c. Normally aim for a life factor 0.95 – 1.05
2. Labelling should be clear and detailed.
3. Design should not vary for some ulterior motive, show only data variation.
4. To represent money, well known units are best
a. Dollars or Pounds
5. The number of dimensions represent should be the same as the number in the data
a. Eg: Use are to show one dimensional data
6. Representations should not imply unintended context
Import Data: IceCream <- read.csv (“file name”)
View Data: View (IceCream)
Headers: Head (IceCream) – see the headers
Summary: summary (IceCream – summary of statistics of each column within the
data
Select Specific Column: IceCream $ColumnName
Maximum Value: max(IceCream $ColumnName)
Minimum Value: min(IceCream $ColumnName)
Range: range(IceCream $ColumnName)
To test for normality:
Subset: subset(filename, column name = “data of interest”
o Subsetting two variables: subset1 < - subset (filename, x1 == “a” & x2 ==
“b”
o Where the value “a” is one subset of the values in variable x1 and the value
“b” is one subset of the values in variable x2
Transforming Data & Adding Data
IceCream $ColumnName_transf <- (IceCream $ColumnName)^5 – Raises data to the
power of 5
IceCream $ColumnName_transf <- exp(FileName$ColumnName) – Raises the
constant e to the power of the population
IceCream$ColumnName_transf <- (IceCream $ColumnName) * 10 – Multiplies data
by 10
Log Transformations
Log(IceCream$ColumnName) – Computes log base e of data
Log(IceCream$ColumnName, 2) – Computes log base 2 of data
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller mariellamonyo. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $10.14. You're not tied to anything after your purchase.