Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hw2 #216

Open
wants to merge 14 commits into
base: gh-pages
Choose a base branch
from
Open
89 changes: 89 additions & 0 deletions 2014-10-23-hw3-Beth-Rolfs.html

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions 2014-10-23-hw3-Beth-Rolfs.rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
title: "Homework 3"
author: "Bethany Rolfs"
date: "Thursday, October 23, 2014"
output: html_document
---

I chose to use wave 5 and 6 of the world values survey to evaluate happiness levels in contries with high and low grossdomestic product, according to the International Monetary FUnd, in 2013 . I will be evaluating survey results from countries that have the highest gross domestic product, the United States and China, , as well as two countries that have some of the lowest GDP globally, Rwanda and Trinidad and Tobago, from 2005-2009 and 2010-2014.

Respondents were asked to evaluate their feeling of happiness on an ordinal scale of very happy, rather happy, Not very happy, not happy at all, no answer, and dont know. I hypothesize that the countries with the higher GDP will have a higher feeling of happiness.



```{r, echo=FALSE}
setwd("~/GitHub/qmssviz/hw3")
library(ggplot2)
wave4<- read.csv("wave4.csv", stringsAsFactors=F)
wave6 <- read.csv("wave6.csv", stringsAsFactors=F)
mydata<- rbind(wave4, wave6)


```

```{r, echo=FALSE}
ggplot(data=mydata, aes(x=Status, fill= Country, y=Percent)) +geom_bar(stat="identity", position="dodge")
ggplot(data=wave4, aes(x=Status, fill= Country, y=Percent)) +geom_bar(stat="identity", position="dodge")
ggplot(data=wave6, aes(x=Status, fill= Country, y=Percent)) +geom_bar(stat="identity", position="dodge")

```


48 changes: 48 additions & 0 deletions hw1/2014-09-25-hw2-Beth-Rolfs.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
title: "Assignment 1 Upgraded (Assignment 2?)"
author: "Bethany Rolfs"
date: "Wednesday, September 24, 2014"
output: html_document
---
This is a second attempt at assignment 1. Last week I was struggling to figure out numerous aspects of Git as well as R Markdown. I am still without a doubt Noob level, but hopefully this attempt is a bit better. Here it goes!

```{r,echo=FALSE}
setwd("~/GitHub/qmssviz/hw1")
disease <- read.csv("Donation-Disease.csv", stringsAsFactors=F)
library(ggplot2)

ggplot(disease, aes(x=MoneyRaised, y=Death))+ geom_point(shape=1, size=5, color= "blue")+ geom_text(aes(label=Name), size=1.8, position=position_jitter(width=-8, height=21))+ xlab("Money Raised millon USD")+ ggtitle("How do we make our donation choices?")

```



```{r, echo=FALSE}
setwd("~/GitHub/qmssviz/hw1")
disease <- read.csv("Donation-Disease.csv")
library(ggplot2)

ggplot(data=disease,aes(x= Name, fill= Name, y=Death)) +geom_bar(position= "dodge",stat= "identity")+guides(fill= FALSE)+xlab("Medical Conditions")+ ylab("Number of Deaths")+ggtitle("Deaths Caused by Medical Conditons")

```


Note: While plotting this bar graph in the console I used the code -theme(axis.text.x=element_text(angle=90,hjust=1,vjust=0.5))- to make the x-axis vertical. For some reason this would not work in Markdown.Thoughts?






```{r, echo=FALSE}
setwd("~/GitHub/qmssviz/hw1")
disease <- read.csv("Donation-Disease.csv")
library(ggplot2)

ggplot(data=disease,aes(x= factor(MoneyRaised), fill= Name, y=Death)) +geom_bar(position=position_dodge(),stat= "identity")+xlab("Money Raised ($ millions)")+ ylab("Number of Deaths")+ggtitle("Deaths v. Money Raised for Medical Conditons")
```




It's clear that the there is no obvious correlation between the amount of money raised by individual orginizations and the number of deaths for each medical condition.
92 changes: 92 additions & 0 deletions hw1/2014-09-25-hw2-Beth-Rolfs.html

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions hw1/_posts/2014-09-18-hw1-Beth-Rolfs.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
title: "Homework assignment 1"
author: "Bethany Rolfs"
date: "Wednesday, September 17, 2014"
output: html_document
Published: False
Tags: hw1
---

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.

When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:



```{r, echo=FALSE}
plot(cars)
```

Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.

```{r}
with(trees, symbols(Height, Volume, circles= Girth/16, inches = FALSE, bg= "deeppink", fg= "gray30"))
```

```{r}
with(ChickWeight, symbols(weight, Time, circles= Diet, inches=FALSE, bg= "blue", fg= "gray30"))
```


It seems that the chicken who recieved a moderate diet grew to be the heaviest
94 changes: 94 additions & 0 deletions hw1/_posts/2014-09-18-hw1-Beth-Rolfs.html

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions hw2/B_Rolfs_hw2_09.25.14.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: "Homework 2"
author: "Bethany Rolfs"
output: html_document
---

Homework 2

To create new data only containing southern zones:
```{r}
setwd("~/GitHub/qmssviz/hw2")
lgas_data<-read.csv("lgas.csv")
hf_data<- read.csv("sample_health_facilities.csv")

southern_data <- hf_data[grep("South", hf_data$zone),]
pop_2006 <- lgas_data[,c(1,3)]
merge_data <- merge(southern_data, pop_2006, by = "lga_id")


```

Calculating the total number of fulltime doctors and nurses by state:

```{r}
aggregate(num_doctors_fulltime~ state, data = merge_data, sum)

aggregate(num_nurses_fulltime ~ state, data = merge_data, sum)
```

Sorting the results in descending order and final results:
```{r}
bystate <- aggregate(pop_2006 ~ state, data = merge_data, sum)
final_data <- merge(merge_data, bystate, by = "state")
names(final_data)[names(final_data)=="pop_2006.y"] <- "statepop"
final.sort <- final_data[order(-final_data$statepop),]

aggregate(num_doctors_fulltime ~ state,data = merge_data, sum)
aggregate(num_nurses_fulltime ~ state,data = merge_data, sum)
```
150 changes: 150 additions & 0 deletions hw2/B_Rolfs_hw2_09.25.14.html

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions hw3/B_Rolfs_Hw3_10.23.14
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
title: "Homework 3"
author: "Bethany Rolfs"
date: "Thursday, October 23, 2014"
output: html_document
---

I chose to use wave 5 and 6 of the world values survey to evaluate happiness levels in contries with high and low grossdomestic product, according to the International Monetary FUnd, in 2013 . I will be evaluating survey results from countries that have the highest gross domestic product, the United States and China, , as well as two countries that have some of the lowest GDP globally, Rwanda and Trinidad and Tobago, from 2005-2009 and 2010-2014.

Respondents were asked to evaluate their feeling of happiness on an ordinal scale of very happy, rather happy, Not very happy, not happy at all, no answer, and dont know. I hypothesize that the countries with the higher GDP will have a higher feeling of happiness.



```{r, echo=FALSE}
setwd("~/GitHub/qmssviz/hw3")
library(ggplot2)
wave4<- read.csv("wave4.csv", stringsAsFactors=F)
wave6 <- read.csv("wave6.csv", stringsAsFactors=F)
mydata<- rbind(wave4, wave6)


```

```{r, echo=FALSE}
ggplot(data=mydata, aes(x=Status, fill= Country, y=Percent)) +geom_bar(stat="identity", position="dodge")
ggplot(data=wave4, aes(x=Status, fill= Country, y=Percent)) +geom_bar(stat="identity", position="dodge")
ggplot(data=wave6, aes(x=Status, fill= Country, y=Percent)) +geom_bar(stat="identity", position="dodge")

```


31 changes: 31 additions & 0 deletions hw3/CHomework 3.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
title: "Homework 3"
author: "Bethany Rolfs"
date: "Thursday, October 23, 2014"
output: html_document
---

I chose to use wave 5 and 6 of the world values survey to evaluate happiness levels in contries with high and low grossdomestic product, according to the International Monetary FUnd, in 2013 . I will be evaluating survey results from countries that have the highest gross domestic product, the United States and China, , as well as two countries that have some of the lowest GDP globally, Rwanda and Trinidad and Tobago, from 2005-2009 and 2010-2014.

Respondents were asked to evaluate their feeling of happiness on an ordinal scale of very happy, rather happy, Not very happy, not happy at all, no answer, and dont know. I hypothesize that the countries with the higher GDP will have a higher feeling of happiness.



```{r, echo=FALSE}
setwd("~/GitHub/qmssviz/hw3")
library(ggplot2)
wave4<- read.csv("wave4.csv", stringsAsFactors=F)
wave6 <- read.csv("wave6.csv", stringsAsFactors=F)
mydata<- rbind(wave4, wave6)


```

```{r, echo=FALSE}
ggplot(data=mydata, aes(x=Status, fill= Country, y=Percent)) +geom_bar(stat="identity", position="dodge")
ggplot(data=wave4, aes(x=Status, fill= Country, y=Percent)) +geom_bar(stat="identity", position="dodge")
ggplot(data=wave6, aes(x=Status, fill= Country, y=Percent)) +geom_bar(stat="identity", position="dodge")

```


89 changes: 89 additions & 0 deletions hw3/CHomework_3.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions hw3/Feeling_of_happiness_w4.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
,,,,,,,,,,,World Values Survey Wave 5: 2005-2009,,,,,Feeling of happiness,,,,,,,,, ,TOTAL,Country/Region,,,,,China,Rwanda,Trinidad and Tobago,United StatesVery happy,26.1,18.8,11.9,51.7,34.4Quite happy,58.2,58,73.5,35.1,58.8Not very happy,13.2,19,12,11.6,6.4Not at all happy,2.2,3.5,2.4,1.7,0.4No answer,0.1,0.1,0.3,0,0Don�t know,0.2,0.6,0,0,0(N),5.749,1.991,1.507,1.002,1.249
Expand Down
Binary file added hw3/Feeling_of_happiness_w4.xls
Binary file not shown.
1 change: 1 addition & 0 deletions hw3/Feeling_of_happiness_w6.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
,,,,,,,,,,,World Values Survey Wave 6: 2010-2014,,,,,Feeling of happiness,,,,,,,,, ,TOTAL,Country Code,,,,,China,Rwanda,Trinidad and Tobago,United StatesVery happy,33,15.7,40.6,54.2,36.1Rather happy,54.9,68.8,49.8,33.8,53.5Not very happy,10.5,13.3,8.5,11.1,8.8Not at all happy,1.1,1.1,1,0.9,1.2No answer,0.3,0.5,0,0,0.5Don�t know,0.2,0.7,0,0,0(N),7.058,2.3,1.527,999,2.232
Expand Down
Binary file added hw3/Feeling_of_happiness_w6.xls
Binary file not shown.
31 changes: 31 additions & 0 deletions hw3/_posts/B_Rolfs_hw3_10.23.14.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
title: "Homework 3"
author: "Bethany Rolfs"
date: "Thursday, October 23, 2014"
output: html_document
---

I chose to use wave 5 and 6 of the world values survey to evaluate happiness levels in contries with high and low grossdomestic product, according to the International Monetary FUnd, in 2013 . I will be evaluating survey results from countries that have the highest gross domestic product, the United States and China, , as well as two countries that have some of the lowest GDP globally, Rwanda and Trinidad and Tobago, from 2005-2009 and 2010-2014.

Respondents were asked to evaluate their feeling of happiness on an ordinal scale of very happy, rather happy, Not very happy, not happy at all, no answer, and dont know. I hypothesize that the countries with the higher GDP will have a higher feeling of happiness.



```{r, echo=FALSE}
setwd("~/GitHub/qmssviz/hw3")
library(ggplot2)
wave4<- read.csv("wave4.csv", stringsAsFactors=F)
wave6 <- read.csv("wave6.csv", stringsAsFactors=F)
mydata<- rbind(wave4, wave6)


```

```{r, echo=FALSE}
ggplot(data=mydata, aes(x=Status, fill= Country, y=Percent)) +geom_bar(stat="identity", position="dodge")
ggplot(data=wave4, aes(x=Status, fill= Country, y=Percent)) +geom_bar(stat="identity", position="dodge")
ggplot(data=wave6, aes(x=Status, fill= Country, y=Percent)) +geom_bar(stat="identity", position="dodge")

```


89 changes: 89 additions & 0 deletions hw3/_posts/B_Rolfs_hw3_10.23.14.html

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions hw3/hw3.Rproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX
1 change: 1 addition & 0 deletions hw3/wave4.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Status,Country,PercentVery happy,Total-w4,26.1Quite happy,Total-w4,58.2Not very happy,Total-w4,13.2Not at all happy,Total-w4,2.2No answer,Total-w4,0.1Don't know,Total-w4,0.2Very happy,China-w4,18.8Quite happy,China-w4,58Not very happy,China-w4,19Not at all happy,China-w4,3.5No answer,China-w4,0.1Don't know,China-w4,0.6Very happy,Rwanda-w4,11.9Quite happy,Rwanda-w4,73.5Not very happy,Rwanda-w4,12Not at all happy,Rwanda-w4,2.4No answer,Rwanda-w4,0.3Don't know,Rwanda-w4,0Very happy,Trinidad and Tobago-w4,51.7Quite happy,Trinidad and Tobago-w4,35.1Not very happy,Trinidad and Tobago-w4,11.6Not at all happy,Trinidad and Tobago-w4,1.7No answer,Trinidad and Tobago-w4,0Don't know,Trinidad and Tobago-w4,0Very happy,United States-w4,34.4Quite happy,United States-w4,58.8Not very happy,United States-w4,6.4Not at all happy,United States-w4,0.4No answer,United States-w4,0Don't know,United States-w4,0
Expand Down
Binary file added hw3/wave4.xls
Binary file not shown.
1 change: 1 addition & 0 deletions hw3/wave6.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Status,Country,PercentVery happy,Total-w6,33Rather happy,Total-w6,54.9Not very happy,Total-w6,10.5Not at all happy,Total-w6,1.1No answer,Total-w6,0.3Don't know,Total-w6,0.2Very happy,China-w6,15.7Rather happy,China-w6,68.8Not very happy,China-w6,13.3Not at all happy,China-w6,1.1No answer,China-w6,0.5Don't know,China-w6,0.7Very happy,Rwanda-w6,40.6Rather happy,Rwanda-w6,49.8Not very happy,Rwanda-w6,8.5Not at all happy,Rwanda-w6,1No answer,Rwanda-w6,0Don't know,Rwanda-w6,0Very happy,Trinidad and Tobago-w6,54.2Rather happy,Trinidad and Tobago-w6,33.8Not very happy,Trinidad and Tobago-w6,11.1Not at all happy,Trinidad and Tobago-w6,0.9No answer,Trinidad and Tobago-w6,0Don't know,Trinidad and Tobago-w6,0Very happy,United States-w6,36.1Rather happy,United States-w6,53.5Not very happy,United States-w6,8.8Not at all happy,United States-w6,1.2No answer,United States-w6,0.5Don't know,United States-w6,0
Expand Down
8 changes: 8 additions & 0 deletions hw3/wave6_v2.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
,Total,China,Rwanda,Trinidad and Tobago,United States
Very happy,33,15.7,40.6,54.2,36.1
Rather happy,54.9,68.8,49.8,33.8,53.5
Not very happy,10.5,13.3,8.5,11.1,8.8
Not at all happy,1.1,1.1,1,0.9,1.2
No answer,0.3,0.5,0,0,0.5
Don?t know,0.2,0.7,0,0,0
(N),7.058,2.3,1.527,999,2.232