\name{pp.est}
\alias{pp.est}
\title{ permutation pvalue estiation  }
\description{
  permutation pvalue estiation based on a genomeric interpretation of permuation p-value, only work for t-test currelty
}
\usage{
pp.est(y, x, pcuts = c(0.001, 1e-04, 1e-05, 1e-06), K = 10000, skip.extreme=TRUE, trace=0)
}
\arguments{
  \item{y}{ a trait of interest }
  \item{x}{ matrix of marker genotype, each row corresponds to one marker}
  \item{pcuts}{ p-value cutoffs }
  \item{K}{ number of genotype profiles simulated }
  \item{skip.extreme}{Wether to skip some extrem cases. if the nominal 
  p-value is extremely small, even the genotypes whose distance to best 
  partition is 1 may not belong to the signficant region, we may want 
  to skip that case}
  \item{trace}{ whether to print trace information }
}
\details{
  Given the trait y, we can find the best aossiciated partition, denoted as desired parition (DP).  
  We simulate K marker genotype profile whose distance to DP is r (r>=r1 and r<=r2) to estimate 
  the proportion of genotype profiles that yield a p-value smaller than the given p-value cutoff. 
}
\value{
  permutation p-value for each input p-value in pcuts. 
}
\author{ Wei Sun wsun@bios.unc.edu }
\keyword{ methods }
