selecting checked radio inputs and filtering by html data attributes

selecting checked radio inputs and filtering by html data attributes

Hello. I know some vanilla javascript but am new to jQuery. 
I am trying to select checked radio inputs and then select only the ones whose html I have given a data-attribute of correct answer like so:

  1. data-answer="correctanswer"
My jQuery currently looks like this. 
  1. var checkedbox = $("[type='radio']").attr(":checked") === true; 
  2.  checkedbox.data( "answer" ) === correct answer;
I then want to do .length of the variable so I can see how many correct answers people have given in a quiz.