EconDat | R Documentation |
R6 class for for storing economic data that is used in the simulation and prescription building steps of the OFPE data cycle. This class has methods for gathering economic data or using the default economic data on prices received for conventional and organic winter wheat, the cost of nitrogen, and fixed costs. The default data is gathered from 2000-2021 from MSU for prices and USDA ERS for fixed costs. This class also can receive data to model protein premiums/dockages or uses the default data from the Billings, MT grain elevator in 2016 or 2021. Both have a base protein of 11.5% where the 2016 premium/dockages range from 7-15% protein with a 15 cent premium per half, while 2021 premium/dockages range from 9.5-14% protein with a 2 cent premium and 8 cent dockage per half.
Thes user has the option of providing their own data to use for the simulation that feeds into the prescription generation in order to simulate a specific economic conditions. To specify the protein premium and dockage function, the user must supply a data frame with a column name 'pro' with the protein level and a column named 'PremDock' with the premium(+)/dockage(-) price. To specify the economic conditions to simulate, the user must supply a data frame with a column indicating the year, named 'Year', a column named 'org' for the price received per bushel for the crop grown organically , a column named 'conv' for the price received per bushel for a conventionally grown crop, and a column named 'cost' with the cost per pound of the user's seed or nitrogen fertilizer.
This class also stores the coefficients from the protein premium/dockage model derived from the protein premium/dockage data, and user supplied inputs for the cost of site-specific technology, and the fixed ownership costs per acre related to production, not including the cost of the input.
This class, like all other 'inputs' classes, gives the user the option of supplying their own parameter selections or to use an interactive method to select parameter values and options. Like all other 'inputs' classes, it is recommended that the user uses the interactive selection method unless providing their own economic and premium/ dockage data.
FC
Optional. Fixed costs ($/acre) associated with production, not including the input of interest. This includes things like the cost of labor, fuel, etc. If this parameter is not supplied the fixed costs in the Prc data frame is used, otherwise the provided FC value here overwrites all FC values in the Prc data frame. Providing this parameter keeps FC constant in the economic simulation.
ssAC
The cost ($/acre) of using site-specific technology or variable rate applications. For farmers that have variable rate technology this cost may be zero, otherwise is the cost per acre to hire the equipment/operators with variable rate technology.
Prc
Data frame containing information on the prices received for the crop and the cost of nitrogen. The user has the option to specify the economic conditions to simulate by supplying a data frame with a column indicating the year, named 'Year', a column named 'org' for the price received per bushel for the crop grown organically , a column named 'conv' for the price received per bushel for a conventionally grown crop, and a column named 'cost' with the cost per pound of the user's seed or nitrogen fertilizer. Alternatively, the user can elect to use the default economic conditions gathered from the Billings, MT elevator that conatin data from 2000 - 2016 on the price received for organic and conventionally grown hard red winter wheat and the cost of nitrogen fertilizer. This option can be accessed with the interactive selection method or by passing in 'Default' to this parameter.
PD
Data frame containing information on the protein premium/dockage received for the user's crop. To specify the protein premium and dockage function, the user must supply a data frame with a column name 'pro' with the protein level and a column named 'PremDock' with the premium(+)/dockage(-) price. Alternatively, the user can elect to use the default premium/dockage data gathered from the Billings, MT elevator in 2021.
B0pd
Intercept for the protein premium/dockage model fit to protein premium/dockage data. Used to calculate estimated net-return based off of predicted protein in the OFPE Monte Carlo simulation.
B1pd
Coefficient for observed protein in the protein premium/dockage model fit to protein premium/dockage data. Used to calculate estimated net-return based off of predicted protein in the OFPE Monte Carlo simulation.
B2pd
Coefficient for the squared protein term in the protein premium/dockage model fit to protein premium/dockage data. Used to calculate estimated net-return based off of predicted protein in the OFPE Monte Carlo simulation.
B3pd
Coefficient for the cubed protein term in the protein premium/dockage model fit to protein premium/dockage data. Used to calculate estimated net-return based off of predicted protein in the OFPE Monte Carlo simulation.
new()
EconDat$new(FC = NULL, ssAC = 0, Prc = NULL, PD = NULL)
FC
Fixed costs ($/acre) associated with production, not including the input of interest. This includes things like the cost of labor, fuel, etc.
ssAC
The cost ($/acre) of using site-specific technology or variable rate applications. For farmers that have variable rate technology this cost may be zero, otherwise is the cost per acre to hire the equipment/operators with variable rate technology.
Prc
Data frame containing information on the prices received for the crop and the cost of nitrogen. The user has the option to specify the economic conditions to simulate by supplying a data frame with a column indicating the year, named 'Year', a column named 'org' for the price received per bushel for the crop grown organically , a column named 'conv' for the price received per bushel for a conventionally grown crop, and a column named 'cost' with the cost per pound of the user's seed or nitrogen fertilizer. Alternatively, the user can elect to use the default economic conditions gathered from the MSU and USDA that conatin data from 2000 - 2021 on the price received for organic and conventionally grown hard red winter wheat, the cost of nitrogen fertilizer, and fixed costs. This option can be accessed with the interactive selection method or by passing in 'Default' to this parameter.
PD
Data frame containing information on the protein premium/dockage received for the user's crop. To specify the protein premium and dockage function, the user must supply a data frame with a column name 'pro' with the protein level and a column named 'PremDock' with the premium(+)/dockage(-) price. Alternatively, the user can elect to use the default premium/dockage data gathered from the Billings, MT elevator in 2016 or 2021. This option can be accessed with the interactive selection method or by passing in '2016' or '2021' to this parameter.
A new 'EconDat' object.
selectInputs()
Interactive method for selecting inputs related to the economic data and conditions of the Monte Carlo simulation. The user will be able to provide their inputs for the fixed costs per acre (FC) associated with production not including the experimental input. They also can input their costs associated with site-specific application of their experimental input (ssAC).
The user will be asked whether they would like to use the default economic conditions. The user can elect to use the default economic conditions gathered from the Billings, MT elevator that contain data from 2000 - 2016 on the price received for organic and conventionally grown hard red winter wheat and the cost of nitrogen fertilizer. ... Alternatively, the user will have the option of selecting from a tool that scrapes economic data from the web (in progress) ... However, if the user is interested in specific economic conditions or is analyzing data of a crop that is not hard red winter wheat or an experimental variable that is not nitrogen fertilizer, the user must supply their own data.frame in the initialization process.
Finally, the user will be asked whether they would like to use the default protein premium/dockage conditions. The user can elect to use the default data gathered from the Billings, MT elevator from 2016, or elect to forgo this input if not optimizing on protein data. However, if the user is interested in specific premium/dockage conditions or is analyzing data of a crop that is not hard red winter wheat, the user must supply their own data.frame in the initialization process.
EconDat$selectInputs()
None
No arguments needed because passed in during class instantiation.
A completed 'EconDat' object.
clone()
The objects of this class are cloneable with this method.
EconDat$clone(deep = FALSE)
deep
Whether to make a deep clone.
DBCon
for database connection class,
SimClass
for simulation class that rely on data in EconDat.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.