Sample Tabular Data: Los Angeles Ozone

Source Notebook

Monthly averages of hourly readings of ozone in downtown Los Angeles with values in pphm

Details

Series R: ozone readings in downtown Los Angeles, monthly averages of hourly readings in pphm, in years 1955-1972.

Examples

Basic Examples (1) 

In[1]:=
ResourceData[\!\(\*
TagBox["\"\<Sample Tabular Data: Los Angeles Ozone\>\"",
#& ,
BoxID -> "ResourceTag-Sample Tabular Data: Los Angeles Ozone-Input",
AutoDelete->True]\)]
Out[1]=

Column keys and types:

In[2]:=
ResourceData[\!\(\*
TagBox["\"\<Sample Tabular Data: Los Angeles Ozone\>\"",
#& ,
BoxID -> "ResourceTag-Sample Tabular Data: Los Angeles Ozone-Input",
AutoDelete->True]\), "ColumnKeys"]
Out[2]=
In[3]:=
ResourceData[\!\(\*
TagBox["\"\<Sample Tabular Data: Los Angeles Ozone\>\"",
#& ,
BoxID -> "ResourceTag-Sample Tabular Data: Los Angeles Ozone-Input",
AutoDelete->True]\), "ColumnTypes"]
Out[3]=

Scope & Additional Elements (2) 

Compute the mean for each column - each month:

In[4]:=
rules = Map[With[{name = #}, name -> Function[Mean[#[name]]]] &, Rest[ResourceData[\!\(\*
TagBox["\"\<Sample Tabular Data: Los Angeles Ozone\>\"",
#& ,
BoxID -> "ResourceTag-Sample Tabular Data: Los Angeles Ozone-Input",
AutoDelete->True]\), "ColumnKeys"]]];
In[5]:=
means = AggregateRows[ResourceData[\!\(\*
TagBox["\"\<Sample Tabular Data: Los Angeles Ozone\>\"",
#& ,
BoxID -> "ResourceTag-Sample Tabular Data: Los Angeles Ozone-Input",
AutoDelete->True]\)], rules]
Out[5]=

Visualize the mean seasonality:

In[6]:=
PieChart[Normal[means[1]], ChartLabels -> ColumnKeys[means], ColorFunction -> "RedBlueTones"]
Out[6]=

Analysis (5) 

Compute basic descriptive statistics for each year (remove year column first):

In[7]:=
ConstructColumns[ResourceData[\!\(\*
TagBox["\"\<Sample Tabular Data: Los Angeles Ozone\>\"",
#& ,
BoxID -> "ResourceTag-Sample Tabular Data: Los Angeles Ozone-Input",
AutoDelete->True]\)][[All, 2 ;;]], {"Mean" -> Mean, "Median" -> Median, "StandardDeviation" -> StandardDeviation, "IQR" -> InterquartileRange}]
Out[7]=

Reinsert back the year column:

In[8]:=
stats = InsertColumns[%, {"Year" -> ResourceData[\!\(\*
TagBox["\"\<Sample Tabular Data: Los Angeles Ozone\>\"",
#& ,
BoxID -> "ResourceTag-Sample Tabular Data: Los Angeles Ozone-Input",
AutoDelete->True]\)][All, "Year"], "Mean"}]
Out[8]=

Plot the mean yearly series:

In[9]:=
ListLinePlot[stats -> {"Year", "Mean"}, AxesLabel -> {"year", "pphm"}]
Out[9]=

Create standard deviation bands for the mean:

In[10]:=
bands = ConstructColumns[
  stats, {"Year", "Mean", "Lower" -> Function[#Mean - #StandardDeviation], "Upper" -> Function[#Mean + #StandardDeviation]}]
Out[10]=

Visualize the mean with the bands:

In[11]:=
ListLinePlot[
 bands -> {{"Year", "Mean"}, {"Year", "Lower"}, {"Year", "Upper"}}, PlotStyle -> {Automatic, LightGray, LightGray}, Filling -> 2 -> {3}, AxesLabel -> {"year", "pphm"}]
Out[11]=

Gosia Konwerska, "Sample Tabular Data: Los Angeles Ozone" from the Wolfram Data Repository (2024)  

Data Resource History

Source Metadata

See Also

Publisher Information