Calculate percentage with lodash
Create a lodash chain, use _.groupBy() to get a dates map, and then reduce it to percentages:



function getNumOfYes(data) {
  return _(data).groupBy('date').reduce(function(percentage, answers) {
    var numOfYes = _.countBy(answers, 'answer').yes || 0;
    percentage.push(numOfYes / answers.length * 100);
    return percentage;
  }, []);
}

var data = [{
  "date": "1-1-2013",
  "answer": "yes"
}, {
  "date": "1-1-2013",
  "answer": "no"
}, {
  "date": "2-1-2013",
  "answer": "no"
}, {
  "date": "2-1-2013",
  "answer": "no"
}, {
  "date": "2-1-2013",
  "answer": " " //this is not answered!
}, , {
  "date": "2-1-2013",
  "answer": "no"
}];

var numOfYes = getNumOfYes(data);

console.log(numOfYes);

document.getElementById('results').innerText = JSON.stringify(numOfYes);
&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.js"&gt;&lt;/script&gt;

&lt;pre id="results"&gt;&lt;/pre&gt;