Utility for computing P-values

Utility for computing P-values

This script computes P-values for experimental G values, based on empirical distribution of P-values computed by multiG2DcalcMultipop(). All scripts are provided in their current state of development with no warranty that they will work in all cases, and only for reference purposes. They can be used and modified by citing the Author (see script header). Example files can be obtained from the Author upon request.

#this script was written by Ivan Scotti, INRA, URFM
#Site Agroparc, Domaine Saint-Paul
#84914 AVIGNON Cedex 9
#you are free to use and modify it, provided you quote the author
#for questions, please contact Ivan Scotti at
#ivan.scotti[at]paca.inra.fr
#15 July 2015
#
PvalCalc<-function(sample,reference)
#sample = a numeric vector of empirical G values
#reference =  a numeric vector of simulated G values
#value: a numeric vector of empirical P values for the empirical G values
#with length(value)=length(sample)
  {
  pvalCalc<-function(z,ref) rank(c(z,ref))[1]/(length(ref)+1)
  sapply(X=sample,FUN=pvalCalc,ref=reference)
}

Date de modification : 22 juin 2023 | Date de création : 16 juillet 2015 | Rédaction : Ivan Scotti