corn

Code Examples

Modeling:

Code Uploaded: 2014-11-06
Code Updated: 2014-11-06

This code runs a simple, one poor dynamic model in R. The example is built following a population dynamics focus. 
 

Download Link

Code Uploaded: 2014-11-06
Code Updated:  2014-11-06

This code runs a three pool dynamic model and sources a series of inputs from a text file to iteratively simulate the model for each set of inputs.

Download Link 

Code Uploaded: 2014-11-06
Code Updated: 2014-11-06

This code builds and runs a simple, three pool dynamic model. 
 

Download Link

Code Uploaded: 2014-11-06
Code Updated: 2014-11-06

This code calculates the least cost ration for different cattle groups given input matricies specifying nutrient requirements and feed composition. 
 

Download Link

Code Uploaded: 2014-11-06
Code Updated: 2014-11-06

This code projects gain of feedlot cattle given their diet and optimized income over feed costs. 
 

Download Link

Statistical Analyses:

Code Uploaded: 2014-11-07
Code Updated: 2014-11-07

The code runs a linear regression analysis and creates relevant plots. 

Download Link

Code Uploaded: 2014-11-07
Code Updated: 2014-11-07

The code runs a nonlinear regression analysis and creates relevant plots. 
 

Download Link

 

Code Uploaded: 2014-11-06
Code Updated: 2014-11-06

This code runs an analysis of variance, calculates pairwise comparisons and generates plots to assess the assumptions used in the analysis 
 

Download Link

 

Code Uploaded: 2014-11-06
Code Updated: 2014-11-06

This code compares three methods of covariance analysis using SAS 
 

Download Link

Code Uploaded: 2014-11-06
Code Updated: 2014-11-06

This file provides code to run fixed-effects, random-effects, and mixed-effects models in SAS. An example of crossed and nested factors is also included. 
 

Download Link

Code Uploaded: 2014-11-06
Code Updated: 2014-11-06

This file provides code to run random-effects and mixed-effects models using proc Mixed. 
 

Download Link

Model Evaluation:

Code Uploaded: 2014-11-06
Code Updated: 2014-11-06

This code calculates the residuals of a model, calculates RMSPE, the proportions of MSPE stemming from mean, slope and residual bias, and graphs the observed vs. predicted values aandthe residuals. 
 

Download Link

Data Handling:

Code Uploaded: 2014-11-06
Code Updated: 2014-11-06

The code reads the sheets in an excel sheet downloaded from the NANP website and loads them as data tables into R 
 

Download Link

Code Uploaded: 2014-11-06
Code Updated: 2014-11-06

This code uses proc import to read the excel sheet downloaded from the NANP website into SAS 
 

Download Link

Graphs and Graphics:

Code Uploaded: 2014-11-06
Code Updated: 2014-11-06

This code shows how to use R to graph meta-data with study-specific slopes. 
 

Download Link