class: center, top, title-slide #
ADVENTURES WITH FARM DATA ###
Stuart Russell BVSc DBR MRCVS ### VetsForNHS
21st April 2021 --- layout: true .footnote[The _Future_ of Dairy.] <style type="text/css"> iframe { width: 40rem; height: 24rem; } .remark-code-line { font-size: 1.1rem; } </style> --- class: top, inverse background-image: url('./images/iStock_000010110567_Full.jpg') background-size: cover # Plan Background Why? Challenges Opportunities Case Studies --- layout: true # Background .footnote[The _Future_ of Dairy.] --- class: inverse background-image: url('./images/iStock_000012644748_XXXLarge.jpg') background-size: 100% background-position: 20% 0% ## Newly Graduated - Statistical PTSD -- - Not a coder -- - Lots of data --- ## After 3yr - Statistical PTSD -- - Macro incontinence -- - Excel whizzkid --- class: inverse background-image: url('./images/iStock_000009626499Large.jpg') background-size: cover ## After DBR - Excel guru -- - **Hates** Excel -- - **Frustrated** statistician -- - The coding begins... --- layout: false class: bottom, center, inverse background-image: url('./images/iStock_000013567165_Full.jpg') background-size: cover .footnote[The _Future_ of Dairy.] # Now? -- - -- ### Less frustrated! --- layout: true # Why? .footnote[The _Future_ of Dairy.] --- ## Value of Data - Assess performance -- - Benchmarking -- - Identify root causes -- - Predict the future -- .right[ ### _Thought_ _Is there value in knowing what happened last month if it doesn't reliably predict what will happen next week?_ ] --- <br> <br> <br> <br> .center[ #### What you _**don't measure**_, you _**can't manage**_. ] --- layout: true # Challenges .footnote[The _Future_ of Dairy.] --- - Farm/Vet software inevitably limited by imagination - **Designed to solve the common problems** - Data **prisons** - Hard & _**time consuming**_ to get access to on-farm datasets - Companies may not help - Statistical & coding **learning curves** --- .center[ <img src="./images/plos_screenshot.jpg" width="75%" height="75%"> ] -- .center[ _Is there value in knowing what happened last month if it doesn't reliably predict what will happen next week?_ ] --- layout: true # Opportunities .footnote[The _Future_ of Dairy.] --- class: inverse background-image: url('./images/iStock_000009626499Large.jpg') background-size: cover ### Data Sources - Bulk Tank Pickup Records - Monthly Milk Records - On-farm Databases - Farm Software - Parlour Software - TMR Wagon - Vet practice records - Data-collection services --- background-image: url('./images/iStock_000049322144_XXXLarge.jpg') background-size: 40% background-position: 100% ### Data Sources #### Sensors - Milk Meters -- - Weigh Scales -- - Wearables - Cow - Human? -- - Rumen Boluses --- background-image: url('./images/iStock_000049322144_XXXLarge.jpg') background-size: 40% background-position: 100% ### Data Sources #### Sensors (cont) - Automated Feeders -- - Parlour Pressure Sensors - VaDia/Inbuilt -- - Wash Temp & pH -- - Cameras & Computer Vision --- background-image: url('./images/iStock_000003721055Medium.jpg') background-size: 40% background-position: 100% ### Tools - Farm Software - Mainly designed to answer the **easy questions** -- - Excel - Easy to Learn - Limited - Very **'manual'** --- background-image: url('./images/iStock_000003721055Medium.jpg') background-size: 40% background-position: 100% ### Tools (cont) - Statistics Packages - **Expensive** - Limited - Very 'manual' --- background-image: url('./images/iStock_000003721055Medium.jpg') background-size: 40% background-position: 100% ### Tools (cont) - Coding Languages (e.g. R & Python ) - Learning Curve - **Free** - **Unlimited** - Can be Automated --- layout: true # Opportunities - Tools .footnote[The _Future_ of Dairy.] --- ### Excel Top Tip - Array Formulas #### The Formula For Everything .center[ ``` SUM(IF( <condition>, trueValue , falseValue )) ``` ] -- #### e.g. .center[ ``` =SUM(IF( $A$1:$A$65535 > 25, 1 , 0 )) =SUM(IF( $A$1:$A$65535 > 25, $A$1:$A$100 * $B$1:$B$100 , 0 )) ``` ] -- * **Enter with Ctrl+Shift+Enter** --- layout: true # Opportunities .footnote[The _Future_ of Dairy.] --- ## Approach .center[ #### How can I answer that question? ] -- <br> <br> <br> .center[ #### What might **stop** me answering that question **correctly**? ] -- --- <br> <br> <br> .center[ #### Statistics & data science can provide #### _**accurate answers**_ to _**impossible questions**_ ] --- layout: true # Case Studies .footnote[The _Future_ of Dairy.] --- - Heifer Weights -- - Parlour Performance -- - Heat Stress --- layout: true # Case Studies - Heifer Weights .footnote[The _Future_ of Dairy.] --- background-image: url('./images/iStock_000018764690_Double.jpg') background-size: 30% background-position: 100% # Problem - Heifers not giving enough **'Week 4 Milk'** - Suspect they are too young light at calving. --- .center[ <iframe src="https://connect.define.ag/weightsapp/" frameborder="0"></iframe> ] --- background-image: url('./images/iStock_000018764690_Double.jpg') background-size: 30% background-position: 100% #### Data - Weights - Genetics (ptaMilk) - Dates of Birth & Calving - Week 4 Milk Yields #### Technique - Examine Data in R - Multilevel Regression Model using R & Stan --- background-image: url('./graphs/weight_by_fdat.png') background-size: 50% background-position: 100% ### Examine Data in R #### Average Weight at Calving - 4yr of data - Recent drop. - Hint of a seasonal effect? --- background-image: url('./graphs/dlwg_by_fdat.png') background-size: 50% background-position: 100% ### Examine Data in R #### Average DLWG to Calving - Recent sharp drop - Same for age (not shown) --- background-image: url('./graphs/sire_ptaMilk.png') background-size: 50% background-position: 100% ### Examine Data in R #### Sire PTA Milk by Fresh Date - Recent Sharp Drop ### Summary - The Trifecta? - Which is most important? --- background-image: url('./graphs/seasonality_heiferW4MK.png') background-size: 50% background-position: 100% ### Modelling #### Seasonality - Plenty of scope for improvement --- background-image: url('./graphs/AFT vs Weight ME W4MK.jpeg') background-size: 50% background-position: 100% ### Modelling #### AFC vs BWT - Fallen off a cliff? --- background-image: url('./graphs/dlwg_smooth.png') background-size: 50% background-position: 100% ### Modelling #### DLWG - Fallen off a cliff? --- background-image: url('./graphs/heifer_losses_table.png') background-size: 90% background-position: 50% ### Modelling --- layout: true # Case Studies - Parlour Efficiency .footnote[The _Future_ of Dairy.] --- background-image: url('./images/iStock_000018764690_Double.jpg') background-size: 30% background-position: 100% # Problem - 'Manual Detaches' too high --- background-image: url('./images/iStock_000018764690_Double.jpg') background-size: 30% background-position: 100% #### Data - Per-milking Records #### Technique - Examine Data in R - Multilevel Regression Model using R & Stan --- background-image: url('./graphs/mandetaches.png') background-size: 60% background-position: 100% ### Examine Data in R #### Manual Detach Timeline - <15% 'acceptable' - Recent sharp rise - First visit was at peak! --- background-image: url('./graphs/manDetach vs potential.png') background-size: 50% background-position: 100% ### Examine Data in R #### vs Parlour Speed - Parlour speed is clearly one driver --- background-image: url('./graphs/multi_mandetach_effect.png') background-size: 50% background-position: 100% ### Modelling #### Manual Detach Effects - Economics depends on **recovery time** - Not possible to **estimate** here - Can **simulate** scenarios --- background-image: url('./graphs/mandetach_economics.png') background-size: 50% background-position: 100% ### Simulation #### Is it Worth Fixing - Reasonable reward if: - Baseline: 10% - Poor reward if: - Baseline: 15% #### Assumes not limiting cow numbers --- layout: true # Case Studies - Heat Stress .footnote[The _Future_ of Dairy.] --- background-image: url('./images/iStock_000018764690_Double.jpg') background-size: 30% background-position: 100% # Problem - Not the real problem, but we'll have to focus on heat stress here. - Real problem was **much** more interesting. **Sorry!** --- background-image: url('./images/iStock_000018764690_Double.jpg') background-size: 30% background-position: 100% #### Data - Daily Rumination & Eating Minutes per day - Milk Yields - Calving Dates - Historic Weather Patterns - Parity #### Technique - Examine Data in R - Multilevel Regression Model using R & Stan --- background-image: url('./graphs/ambient_temp.png') background-size: 50% background-position: 100% ### Examine Data in R #### External Average Daily Temperatures --- background-image: url('./graphs/combined_timeline.png') background-size: 70% background-position: 50% ### Modelling --- background-image: url('./graphs/date_timeline.png') background-size: 70% background-position: 50% ### Modelling --- background-image: url('./graphs/temp_timeline.png') background-size: 70% background-position: 50% ### Modelling --- background-image: url('./graphs/temp_effect.png') background-size: 60% background-position: 50% ### Modelling --- layout: false class: top, inverse background-image: url('./images/iStock_000010110567_Full.jpg') background-size: cover # Summary Background - Don't have to love statistics -- <br> <br> <br> <br> <br> Why? .center[ #### Statistics & data science can provide #### _**accurate answers**_ to _**impossible questions**_ ] --- class: top, inverse background-image: url('./images/iStock_000010110567_Full.jpg') background-size: cover # Summary (cont) Challenges - Knowledge - Access - Imagination <br> <br> <br> <br> -- .center[ #### If you do what you've always done #### you'll get what you've always got ]