{"action":"opened","issue":{"url":"https://api.github.com/repos/droglenc/FSA/issues/9","repository_url":"https://api.github.com/repos/droglenc/FSA","labels_url":"https://api.github.com/repos/droglenc/FSA/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/droglenc/FSA/issues/9/comments","events_url":"https://api.github.com/repos/droglenc/FSA/issues/9/events","html_url":"https://github.com/droglenc/FSA/issues/9","id":130771970,"number":9,"title":"NAs in agePrecision","user":{"login":"droglenc","id":5935175,"avatar_url":"https://avatars.githubusercontent.com/u/5935175?v=3","gravatar_id":"","url":"https://api.github.com/users/droglenc","html_url":"https://github.com/droglenc","followers_url":"https://api.github.com/users/droglenc/followers","following_url":"https://api.github.com/users/droglenc/following{/other_user}","gists_url":"https://api.github.com/users/droglenc/gists{/gist_id}","starred_url":"https://api.github.com/users/droglenc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/droglenc/subscriptions","organizations_url":"https://api.github.com/users/droglenc/orgs","repos_url":"https://api.github.com/users/droglenc/repos","events_url":"https://api.github.com/users/droglenc/events{/privacy}","received_events_url":"https://api.github.com/users/droglenc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-02T18:24:53Z","updated_at":"2016-02-02T18:24:53Z","closed_at":null,"body":"Here is the super brief summary of my confusion:\r\n1)\tWhen what = “difference” or “absolute difference” the N used to calculate the % appears to exclude the NA values.  This makes sense to me.\r\n2)\tWhen what = “precision”, the calculation appears to count NA values as “agreement”.  \r\n\r\nThe long winded version of my confusion follows:\r\n\r\nFirst, a simple example using the formula notation two different ways to achieve the same result (i.e., simply compare agerA1 and agerA2): \r\n\r\nExample 1)     ap.A<-agePrecision(~agerA1+agerA2,data=shad)\r\n                         summary(ap.A,what=\"precision\")\r\n\r\nExample 2)     ap.Ax<-agePrecision(agerA1~agerA2,data=shad)\r\n                         summary(ap.Ax,what=\"precision\")\r\n\r\nHow does agePrecision  handled “NA” values?  Did I miss something in the documentation?  Anyway, in the shad data, agerA1 codes the values for two of the samples as “NA” and agerA2 codes the same two scales as NA on the second read leaving 51 samples with an estimated age.   There is no difference between agerA1 and agerA2 for 26 scales.  26/51 = 50.9% (NA excluded).  However, to achieve the results calculated using agePrecision it is necessary to include the two NA values and consider them as “agreement” ((26+2)/53) = 52.83%.   I supposed that as long as the reader is consistent in assigning the scales as “NA” it make sense to include the NA values in the percent agreement calculation because NA is functionally serving as a value, and in this example, readerA agreed with both reads on which scales were NA. \r\n\r\nWhat if I try comparing agerA1 and agerB1?\r\n> summary(ap.AB,what=\"difference\")\r\n    -2     -1      0      1      2 \r\n18.182 15.152 45.455 12.121  9.091 \r\nTo calculate 45.455 (15 agreed out of 33).  Looks like the 20 NAs were excluded.  Sound reasonable.\r\n\r\n> summary(ap.AB,what=\"precision\")\r\n  n R   ACV   APE PercAgree\r\n 53 2 12.17 8.608     66.04\r\nNow I am confused.  To get 66.04% it’s necessary to count the 20 “NA’s” as agreed and divide by 53.  (20 NAs+ 15 agreed)/53 * 100 = 66.04%\r\n\r\n\r\nHow do “NA” values work with >2 reads?  At the bottom of page 84.  \r\n\r\nap.ABC<-agePrecision(~agerA1 + agerB1 + agerC1, data = shad)\r\nsummary(ap.ABC, what = “difference”)\r\nsummary(ap.ABC,what= “precision”)\r\n\r\nFootnote 7 says “The sample size is much smaller ...because Ager C did not estimate an age for several fish.”  Should it be Ager “B” who did not estimate ages?.  Either way, there are 33 samples where all 3 agers give an Age.  The summary results for what = “difference” are easy to calculate and the row totals clearly show NA values are excluded. For example, ap.ABC$absdiff shows row totals of 33 (A vs B, 51 (A vs C), and 33 (B vs C).  With these row totals, I can duplicate the results in summary(ap.ABS, what=”difference”).  If what = “difference” or “absolute difference”, NA values appear to be excluded from the N.\r\n\r\nHowever, I am again confused by the inclusion of the “NA” when calculating the PercAgree when what = “precision”.  With reader B there are 20 instances where the scale age is NA and only 2 instances where all three readers agree.  Therefore, PercAgree is calculated as = (20 of the NA values + 2 where everyone agrees)/53 * 100= 41.51%.  Why is the NA being counted as an agreement when reader B essentially said “I can’t read the scale”?  Should percent agreement be calculated on all 53 samples or only the 33 samples where everyone provided an age?  If we only use the 33 samples with an age, then 2/33 = 6.01%. \r\n\r\nBasically I am confused because it seems like NA values are not being treated the same when what is changed from “difference” to “precision”.\r\n"}}