Skip to content

Instantly share code, notes, and snippets.

View daattali's full-sized avatar

Dean Attali daattali

View GitHub Profile
n <- 50
a <- 2
b <- -3
sigSq <- 0.5
x <- runif(n)
norm <- rnorm(n, sd = sqrt(sigSq))
y <- a + b * x + norm
plot(x,y)
abline(a, b, col = "blue")
n <- 50
a <- 2
b <- -3
sigSq <- 0.5
x <- runif(n)
norm <- rnorm(n, sd = sqrt(sigSq))
y <- a + b * x + norm
plot(x,y)
abline(a, b, col = "blue")
Dean Attali's View of the World
========================================================
First, let's load the data and the required libraries (in this case, just lattice for plotting)
**Note:** The data is available [here](http://www.stat.ubc.ca/~jenny/notOcto/STAT545A/examples/gapminder/data/gapminderDataFiveYear.txt)
```{r}
library("lattice")
gDat <- read.delim("gapminderDataFiveYear.txt")
```
Dean Attali
=================================
**STAT 545A hw 3**
**Sept 22 2013**
Exercises done:
* Average GDP/cap in each continent when the data was first and last collected **(easy)**
* Trimmed mean statistics for life expectancy in each continent for every year **(fun)**
* Absolute and relative world population in each of the continents **(very fun)**
* A list of all countries that at some point had their population size decrease **(very fun)**
Dean Attali
=================================
**STAT 545A hw 3**
**Sept 22 2013**
Exercises done:
* Average GDP/cap in each continent when the data was first and last collected **(easy)**
* Trimmed mean statistics for life expectancy in each continent for every year **(fun)**
* Absolute and relative world population in each of the continents **(very fun)**
* A list of all countries that at some point had their population size decrease **(very fun)**
Dean Attali
=================================
**STAT 545A hw 3**
**Sept 22 2013**
Exercises done:
* Average GDP/cap in each continent when the data was first and last collected **(easy)**
* Trimmed mean statistics for life expectancy in each continent for every year **(fun)**
* Absolute and relative world population in each of the continents **(very fun)**
* A list of all countries that at some point had their population size decrease **(very fun)**
Dean Attali
=================================
**STAT 545A hw 3**
**Sept 22 2013**
Exercises done:
* Average GDP/cap in each continent when the data was first and last collected **(easy)**
* Trimmed mean statistics for life expectancy in each continent for every year **(fun)**
* Absolute and relative world population in each of the continents **(very fun)**
* A list of all countries that at some point had their population size decrease **(very fun)**
```{r include = FALSE}
opts_chunk$set(tidy = FALSE)
```
Dean Attali
=================================
**STAT 545A hw 4**
**Sept 28 2013**
In this assignment, I will take data aggregation code written by other students, and create visuals that will complement their tabular data. The two students' work I will be using are [**Rebecca Johnston**](http://rpubs.com/rljohn/stat545a-2013-hw03_johnston-reb) and [**Daniel Dinsdale**](http://rpubs.com/danieldinsdale/stat545a-2013-hw03_dinsdale-dan).
```{r include = FALSE}
opts_chunk$set(tidy = FALSE)
```
Terrorism in Israel
===========================
**Dean Attali**
**Oct 4, 2013**
**STAT 545A**
@daattali
daattali / spinme
Created February 1, 2015 03:16
Add this at top of R script so that "source"ing the script will automatically render a markdown+HTML
#+ spinme-chunk, eval = FALSE, echo = FALSE
.scriptName <- basename(sys.frame(1)$ofile)
.spinOutput <- knitr::spin(.scriptName, knit = TRUE)
stop(sprintf("Ignore this error - your output is ready at:\n%s",
normalizePath(.spinOutput)),
call. = FALSE)
#+ spinme-done, eval = TRUE, echo = TRUE