100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Summary R Code Cheat Sheet $10.14   Add to cart

Summary

Summary R Code Cheat Sheet

 4 views  0 purchase
  • Course
  • Institution

Summarized codes and lecture notes for LFE763 (Statistics for Biological Research)

Preview 3 out of 16  pages

  • March 25, 2024
  • 16
  • 2023/2024
  • Summary
  • Unknown
avatar-seller
R-Codes

,
, 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

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

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

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.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

70055 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$10.14
  • (0)
  Add to cart