Factors are qualitative data that are associated with categorization or the description of an attribute. Factors are often (but not always) represented with words, like colors or names of things. On the other hand, numeric data are generated by numeric measurements. R can store values as factors or numbers, but sometimes you have a choice of how to represent values.
1) I have two apples, one banana, one cherry. Does it make sense to calculate the "average" of these things? Would you code that as a factor or a numeric value in R?
Solution to 1:
In this case, I should say it does not make sense to calculate the "average" of these given items. This is because the colors, which are not numbers, cannot be subjected to numerical analysis. …show more content…
In otherwords,
(94 + 93 + 85 + 0) = 272
(272)/4 = 68
Therefore, the mean (average) of my quiz scores is 68.
I would code this as a numeric value in R, reason being that numeric data are generated by numeric measurements.
3) In another class, I received these grades on my quizzes: two As, one B, and one F. What is the mean (average) of my grades? Would you code that as a factor or a numeric value in R?
Solution to 3:
There is no mean (average) of my grades possible on my quizzes. This is because the letter grades are not numbers.
I would code that as a factor in R because factors are often represented with words like names.
4) How would you explain the difference in mean values obtained in #2 and #3 above?
Solution to 4:
In #2, the mean was 68 while #3 had no possible mean. Therefore, there is no difference in mean values to explain since the word "difference" refers to subtraction between two numbers. If it were possible to convert the letter grades to numbers in #3, then an average would be computed and hence,an explanation of the difference in mean value would be