Question: > getwd ( ) > list.files ( ) [ 1 ] airquality.csv airquality.RData airquality.txt > raw < - read.csv ( airquality .

> getwd()
> list.files()
[1] "airquality.csv" "airquality.RData" "airquality.txt"
> raw<-read.csv("airquality.csv", header=TRUE)
> head(raw, n=5)
X Ozone Solar.R Wind Temp Month Day
11411907.46751
22361188.07252
331214912.67453
441831311.56254
55 NA NA 14.35655
> names(raw)[3]="SolarRadiation"
> head(raw, n=5)
X Ozone SolarRadiation Wind Temp Month Day
11411907.46751
22361188.07252
331214912.67453
441831311.56254
55 NA NA 14.35655
> m1=mean(raw$Ozone, na.rm=TRUE)
> m1
[1]42.12931
> m2=mean(raw$Ozone[raw$Temp<70], na.rm=TRUE)
> m2
[1]17.96154
> m3=mean(raw$Ozone[raw$Temp>70 & raw$Temp<80], na.rm=TRUE)
> m3
[1]26.0625
> m4=mean(raw$Ozone[raw$Temp>80 & raw$Wind<10], na.rm=TRUE)
> m4
[1]72.05128
> m5=mean(raw$Ozone[raw$Temp>80 & raw$Wind>10], na.rm=TRUE)
> m5
[1]43.6
> hist(raw$Ozone)
> var(raw$Ozone, na.rm=TRUE)
[1]1088.201
> sd(raw$Ozone, na.rm=TRUE)
[1]32.98788
> raw_no_NA <- na.omit(raw$Ozone)
> raw_no_NA
[1]4136121828231987161114181434
[16]6301111143223451153729713923
[31]2137201213135493264407797978510
[46]277483561796316801082052825064
[61]5939916783566122891104428652259
[76]2331442194516873761188485967873
[91]91473220232124442128913461813
[106]241613233671430141820
attr(,"na.action")
[1]51025262732333435363739424345
[16]465253545556575859606165727583
[31]84102103107115119150
attr(,"class")
[1] "omit"
> cor(raw$Ozone, raw$Wind, use = 'complete.obs')
[1]-0.6015465
> cor(raw$Ozone, raw$Temp, use = 'complete.obs')
[1]0.6983603
> cor(raw$Ozone, raw$SolarRadiation, use = 'complete.obs')
[1]0.34834179.
Calculate a complex mean Ozone level for each month and make a bar plot.
a. Tabulate variable Month
b. Use function tapply() to generate mean ozone level for each month
c. Generate a bar plot for monthly mean ozone levels.
d. Assign the title of the bar plot as Ozone level by Month
e. Label x axis as Month
f. Label y axis as Mean Ozone Level
g. Use rainbow color or heat colors for the bars
h. Add the value of May, June, July, August, September to the x axis.
10. Generate an xy plot for Ozone and Solar Radiation and add trend line to the xy plot.
Section 1: write a R script to complete the following tasks on ANOVA and Regression

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!