Hello R friends,

Once again I come asking for some aid. Im trying to make a table with kappa
index and their corresponding p values for a little more then 20 variables.
Somehitng like...

     Kappa  p value
var1 0.95   0.001
var2 0.64   0.020
...

For this Im constructing a script to stick them all at once using the
matrix() function.

However a error with a particular variable is interrupting the script.

>kap.2.raters(ecg$Q15.E1,ecg$Q15.E2)
          rater2
rater1     Sim Não Ignorado
  Sim        0   1        0
  Não        0 304        0
  Ignorado   0   0        0

Observed agreement = 99.67 %
Expected agreement = 99.67 %
Kappa = 0
Erro em if (p.value < 0.001) { :
*  valor ausente onde TRUE/FALSE necessário*

To reproduce the error...
############
tab <- matrix(c(0,1,0,0,304,0,0,0,0),byrow=T,ncol=3,nrow=3)
dimnames(tab) <-
list(rater1=c('Yes','No','Inconclusive'),rater2=c('Yes','No','Inconclusive'))
kap.table(tab)
############

It is obvious that in this situation the kappa is not good since the
observed is identical to the expected. Therefore I would expect a p value
close to 1, but this error comes instead.

Although this table has very extreme values I was not expecting this error
since other variables analysis gave similar tables with lots of zeros and no
errors.

See, the problem is that this error is interrupting the script. Is there
anyway to avoid this error and extract the p value.

Kind regards,

Abraço forte e que a força esteja com você,

Dr. Pedro Emmanuel A. A. do Brasil
Instituto de Pesquisa Clínica Evandro Chagas
Fundação Oswaldo Cruz
Rio de Janeiro - Brasil
Av. Brasil 4365
Tel 55 21 3865-9648
email: pedro.bra...@ipec.fiocruz.br
email: emmanuel.bra...@gmail.com

---Apoio aos softwares livres
www.zotero.org - gerenciamento de referências bibliográficas.
www.broffice.org ou www.openoffice.org - textos, planilhas ou apresentações.
www.epidata.dk - entrada de dados.
www.r-project.org - análise de dados.
www.ubuntu.com - sistema operacional

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Epi@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-epi

Reply via email to