Public
Edited
Oct 23, 2021
Importers
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function calcNetLaborCosts(grossWageRate) {
// calculation according to dlz agrarmanagement (Jan.2013, p. 112ff)
// using the table presented on page 114, we simplify the calculation of the social security costs by
// assuming an average expenditure of 22% of the gross wage rate on social security
const socialSecurityCosts = grossWageRate * 0.22;
// we assume a workload of 174 hours per month (2088 hours per year)
const yearlyNetCosts = 12 * 174 * (grossWageRate + socialSecurityCosts);
// However, 296 hours are reduced accounting for vacation and public holidays, resulting in an effective
// yearly workload of 1792 hours
const netWageRate = yearlyNetCosts / 1792;
return netWageRate;
}
Insert cell
function predict(y,size,distance) {
return y[0]
+ y[1] * size
+ y[2] * Math.pow(size,2)
+ y[3] * distance
+ y[4] * size * distance
+ y[5] * Math.pow(distance,2)
}
Insert cell
Insert cell
Insert cell
Insert cell
Object.keys(codes).reduce((arr, crop) => {
const data = sgms[crop].filter(
(r) => r.region === "Brandenburg" && r.year > 2013 && r.year < 2017
);
arr.push({
Crop: crop,
Price: d3.mean(data.map((p) => p.price)),
"Direct costs": d3.mean(
data.map((p) => p.seeds + p.fertilizer + p.pesticides + p.others)
),
"Variable costs": predict(
variableMachineCostsRegressionCoefficients[crop].varCosts,
17,
2
)
});
return arr;
}, [])
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
{
const data = [];
for (const crop in variableMachineCostsRegressionCoefficients) {
for (const key in variableMachineCostsRegressionCoefficients[crop]) {
const coefficients = variableMachineCostsRegressionCoefficients[crop][
key
].map((c, i) => {
data.push({
crop: codes[crop],
key,
coeff: "c" + i,
value: c
});
}); //.reduce((coeff, cur, i) => ((coeff["c" + i] = cur), coeff), {});
}
}
return data;
}
Insert cell
codes = ({
"konventionell/integriert::Mais - Körnermais::wendend, gezogene Saatbettbereitung, Saat": 171,
"konventionell/integriert::Mais - Silomais::wendend, gezogene Saatbettbereitung, Saat": 411,
"konventionell/integriert::Sommerackerbohnen - Körnergewinnung::wendend, gezogene Saatbettbereitung, Saat": 220,
"konventionell/integriert::Sommerhafer - Futterhafer::wendend, gezogene Saatbettbereitung, Saat": 143,
"konventionell/integriert::Speisekartoffeln::wendend, gezogene Saatbettbereitung, Legen": 602,
"konventionell/integriert::Wintergerste - Futtergerste::wendend, gezogene Saatbettbereitung, Saat": 131,
"konventionell/integriert::Winterraps::wendend, gezogene Saatbettbereitung, Saat": 311,
"konventionell/integriert::Winterroggen - Mahl- und Brotroggen::wendend, gezogene Saatbettbereitung, Saat": 121,
"konventionell/integriert::Winterweizen - Brotweizen::wendend, gezogene Saatbettbereitung, Saat": 115,
"konventionell/integriert::Zuckerrüben::wendend, gezogene Saatbettbereitung, Saat": 603
})
Insert cell
Insert cell
Insert cell
d3.mean(
sgms[
"konventionell/integriert::Mais - Silomais::wendend, gezogene Saatbettbereitung, Saat"
]
.filter((r) => r.region === "Nordrhein-Westfalen" && r.year > 2014)
.map((r) => r.price)
)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
d3 = require('d3@5')
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more