{
    "contents" : "#Name: Jake Heare\n# Assignment 4\n\n#Q1\n#q1a\nrandomCauchy<-rcauchy(1000, location=5, scale=1)\nmin(randomCauchy)\nmax(randomCauchy)\nmean(randomCauchy)\n\n#q1b\nx<-seq.int(from=0.01, to=0.985, by=0.025)\n\n#q1c\nbetaDensity<-dbeta(x, shape1=5, shape2=2, ncp=0, log=F)\n\n#q1d\nbetaDensityNorm<-betaDensity/(sum(betaDensity))\nbetaDensityNorm\nsum(betaDensityNorm)\n\n#q1e\nlengths<-seq.int(from=12, to=90, by=2)\n\n#q1f\nlength(betaDensityNorm)\nlength(lengths)\nlengthSample<-sample(lengths, size=1000, replace=T, prob=betaDensityNorm)\n\n#q1g\nrequire(ggplot2)\nlengthSampleDF<-as.data.frame(lengthSample)\nggplot(lengthSampleDF,aes(x=lengthSample))+geom_histogram(binwidth=1)+\n  ggtitle(\"Normalized Randomly Distributed\\nLengths of Walking Dead Viewership\")+\n  theme_bw()+labs(x=\"Average Time Spent Watching\",y=\"Number of Self Identified Viewers\")\n\n#Q2\n#q2a\nvirginica<-subset(iris, subset=Species==\"virginica\", select=Sepal.Width)\nversicolor<-subset(iris, subset=Species==\"versicolor\",select=Sepal.Width)\nirisv<-var.test(versicolor$Sepal.Width,virginica$Sepal.Width, ratio=1)\n\n#q2b\nirist<-t.test(versicolor$Sepal.Width,virginica$Sepal.Width,paired=F, var.equal=T)\n\n#q2c\nqqnorm(virginica$Sepal.Width)\nqqline(virginica$Sepal.Width)\nqqnorm(versicolor$Sepal.Width)\nqqline(versicolor$Sepal.Width)\n#Based on the normality line and the data within each the sepal width follows normality in both groups\n\n#q2d\nwilcox.test(versicolor$Sepal.Width, virginica$Sepal.Width, paired=F, exact=T)\n\n#q2e\nggplot(iris, aes(x=c(Sepal.Width,, color=Species, fill=Species))+\n  geom_histogram(binwidth=1)+\n  facet_wrap(~Species)+\n  scale_colour_manual(values=c(2:4))+\n  scale_fill_manual(values=c(2:4))",
    "created" : 1414452278834.000,
    "dirty" : false,
    "encoding" : "UTF-8",
    "folds" : "",
    "hash" : "2804526101",
    "id" : "43309ECE",
    "lastKnownWriteTime" : 1414536137,
    "path" : "~/R/IntroR/Heare_Assignment4.R",
    "project_path" : "Heare_Assignment4.R",
    "properties" : {
        "tempName" : "Untitled1"
    },
    "source_on_save" : false,
    "type" : "r_source"
}