Question: #Data Sceince Homework 7 Fall 2 0 2 4 data < - read.csv ( storms . csv ) ggplot ( data , aes
#Data Sceince Homework Fall
data read.csvstormscsv
ggplotdata aesx year
geombarstat "count"
ggplotdata aesx year, fill factorType
geombarstat "count"
scalefilldiscrete
name "Type of Hurricane",
labels cTropical Storm",
datatable tabledata$Type
datatable
data$TypeNew ifelsetest data$type yes no
tabledata$TypeNew
optionsviewer NULL
libraryleaflet
m leaflet
m addTilesm
m addProviderTilesm "Esri.OceanBasemap"
cols cred "navy"
m addCircleMarkersm
lng data$lon,
lat data$lat,
radius
color colsdata$TypeNew
popup pasteYear: ascharacterdata$Year
m addLegendm
"topright",
colors cols,
labels ctropical "nontropical"
title "Type of Hurricane",
opacity
m
logmodel glmTypeNew ~ data$lat, data data, family "binomial"
summarylogmodel
summarylogmodel$coefficients
expcoefficientslogmodel
confint.defaultlogmodel
expconfintdefaultlogmodel
predictlogmodel, newdata listlat c type "response"
lats seqmindata$lat maxdata$lat
probs predictlogmodel,
newdata data.framelat lats
type "response",
sefit TRUE
pm probs$fit
pu probs$fit probs$sefit # confidence interval
pl probs$fit probs$sefit # confidence interval
plotdata$lat,
data$Typenew,
pch
cex
ylab "Probability",
xlab "Formation Latitude N
grid
polygoncrevlats lats crevpl pu
col "grey border NA
lineslats pm lwd
lineslats pu lwd col "red"
lineslats pl lwd col "red"
ablineh lty
ablineh lty
ablineh lty
Above is the original R code hurricane data set.Provide afivepage Report with imageson recreating hurricane research using the new dataset, The report include the map or the logistic regression graph, and provide aR code filefor data cleaning, map and logistic regression graph.Ensure code is accurate and thoroughly tested.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
