Publications by Ben Jaffe

Document

08.05.2021

# Import the data wine<-read.csv("https://raw.githubusercontent.com/kitadasmalley/sp21_MATH376LMT/main/data/wine.csv", header=TRUE) a) Create a pairs plot. Does it appear that there are linear relationships between the response and explanatory variables? pairs(wine) # Response Variable is Quality # Explanatory Variables are everything else (e...

2477 sym R (5899 sym/36 pcs) 1 img

Document

29.04.2021

# loading in the data fec<-read.csv("fec_independent_expenditures.csv", header = TRUE) # calling in the appropriate packages library(dplyr) ## ## Attaching package: 'dplyr' ## The following objects are masked from 'package:stats': ## ## filter, lag ## The following objects are masked from 'package:base': ## ## intersect, setdi...

93 sym R (11463 sym/80 pcs) 10 img

Document

23.04.2021

Step One: Create an ANOVA table and produce the F-statistic and discuss the R-squared value. Show your work with R code (from scratch) and confirm using the lm() and anova() functions. First, we need to load in the data: library(tidyr) library(tidyverse) ## -- Attaching packages --------------------------------------- tidyverse 1.3.0 -- ## v ggp...

1015 sym R (7817 sym/57 pcs)

Document

07.04.2022

Code for Survival Analysis For a basic survival function, we can use the Cox Proportional Hazard method, doing so with the survival package. # Installing package #install.packages("survival") # Loading package library(survival) ## Warning: package 'survival' was built under R version 4.1.3 library(ggplot2) library(survminer) ## Warning: pack...

384 sym R (3424 sym/22 pcs) 4 img