22/7/2020

Swiss Fertility Data

Standardized fertility measure and socio-economic indicators for each of 47 French-speaking provinces of Switzerland at about 1888.

  • Fertility Ig, ‘common standardized fertility measure’
  • Agriculture % of males involved in agriculture as occupation
  • Examination % draftees receiving highest mark on army examination
  • Education % education beyond primary school for draftees.

Code For Output

fig<- with(swiss,
       plot_ly(data=swiss,
               x = Agriculture,
               y = Fertility,
               type="scatter",
               mode = "markers",
               color = Examination,
               size = Education
       )
)

fig<-fig %>% layout(title = 'Fertility vs Agriculture',
        paper_bgcolor='rgb(255,255,255)',
        plot_bgcolor='rgb(229,229,229)',
        xaxis = list(title = "Agriculture"),
        yaxis = list (title = "Fertility"))

Plotly Scatter Graph