hazell.vegetables: Gross profit for four vegetable crops in six years

Description Usage Format Details Source References Examples

Description

Gross profit for four vegetable crops in six years

Usage

 `1` ```data(hazell.vegetables) ```

Format

A data frame with 6 observations on the following 5 variables.

`year`

year factor, 6 levels

`carrot`

Carrot profit, dollars/acre

`celery`

Celery profit, dollars/acre

`cucumber`

Cucumber profit, dollars/acre

`pepper`

Pepper profit, dollars/acre

Details

The values in the table are gross profits (loss) in dollars per acre. The criteria in the example below are (1) total acres < 200, (2) total labor < 10000, (3) crop rotation.

Source

P.B.R. Hazell, (1971). A linear alternative to quadratic and semivariance programming for farm planning under uncertainty, Am. J. Agric. Econ., 53, 53-62.

References

Carlos Romero, Tahir Rehman. (2003). Multiple Criteria Analysis for Agricultural Decisions. Elsevier.

Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53``` ```data(hazell.vegetables) dat <- hazell.vegetables ## Not run: require(linprog) # colMeans(dat[ , -1]) # 252.8333 442.6667 283.8333 515.8333 # Maximize c'x for Ax=b A <- rbind(c(1,1,1,1), c(25,36,27,87), c(-1,1,-1,1)) cvec <- c(253, 443, 284, 516) # avg profit per acre colnames(A) <- names(cvec) <- cc(carrot,celery,cucumber,pepper) rownames(A) <- c('land','labor','rotation') bvec <- c(200,10000,0) const.dir <- c("<=","<=","<=") m1 <- solveLP(cvec, bvec, A, maximum=TRUE, const.dir=const.dir, lpSolve=TRUE) # m1\$solution # optimal number of acres for each crop # carrot celery cucumber pepper # 0.00000 27.45098 100.00000 72.54902 # Average income for this plan ## sum(cvec * m1\$solution) ## [1] 77996.08 # Year-to-year income for this plan ## as.matrix(dat[,-1]) ## [,1] ## [1,] 80492.16 ## [2,] 80431.37 ## [3,] 81884.31 ## [4,] 106868.63 ## [5,] 37558.82 ## [6,] 80513.73 # Brute-force search for optimum allocation that minimizes year-to-year # income variability. # For generality, assume we have unequal probabilities for each year. probs <- c(.15, .20, .20, .15, .15, .15) # Randomly allocate crops to 200 acres, 100,000 times mat <- matrix(runif(4*100000), ncol=4) mat <- 200*sweep(mat, 1, rowSums(mat), "/") profit <- mat ix <- apply(profit, 1, function(x) cov.wt(as.data.frame(x), wt=probs)\$cov) ix <- which.max(ix) mat[ix,] # Optimal planting allocation that minimizes the weighted variance ## carrot celery cucumber pepper ## 71.67002 27.90306 84.69966 15.72726 ## End(Not run) ```

Search within the agridat package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.