R/tchisq.R

Defines functions tchisq

Documented in tchisq

tchisq <-
function (obs) 
{esp = matrix(0, 2, dim(obs)[2])
 for (i in 1:2) {
     for (j in 1:dim(obs)[2]) {
         esp[i, j] = (sum(obs[i, ]) * sum(obs[, j]))/sum(obs)
         if (esp[i, j] == 0) {
             esp[i, j] = 0.1
         }
     }
 }
 test = sum(((obs - esp)^2)/esp)    
}

Try the dprep package in your browser

Any scripts or data that you put into this service are public.

dprep documentation built on May 29, 2017, 11:01 a.m.