h2 = read_tsv(glue::glue("{DATA}/vgvp.txt"),col_names = FALSE)
## Parsed with column specification:
## cols(
##   X1 = col_character(),
##   X2 = col_double(),
##   X3 = col_double()
## )
h2p1 = read_tsv(glue::glue("{DATA}/vgvp_perm.txt"),col_names = FALSE)
## Parsed with column specification:
## cols(
##   X1 = col_character(),
##   X2 = col_double(),
##   X3 = col_double()
## )
h2p2 = read_tsv(glue::glue("{DATA}/vgvp_perm2.txt"),col_names = FALSE)
## Parsed with column specification:
## cols(
##   X1 = col_character(),
##   X2 = col_double(),
##   X3 = col_double()
## )
dim(h2)
## [1] 100   3
dim(h2p1)
## [1] 79  3
dim(h2p2)
## [1] 92  3
summary(h2$X2)
##      Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
## -0.086611  0.005914  0.107115  0.225480  0.411777  1.066195
summary(h2p1$X2)
##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
## -0.07780 -0.02123  0.09334  0.43573  0.36534 12.64227
summary(h2p2$X2)
##      Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
## -42.34265   0.00481   0.12064  -0.24615   0.36172   1.19819
h2p1$X2t = pmax(pmin(h2p1$X2,2), -1)
h2p2$X2t = pmax(pmin(h2p2$X2,2), -1)

par(mfrow=c(3,1))
hist(h2$X2,xlim=c(-1,2))
hist(h2p1$X2t,xlim=c(-1,2))
hist(h2p2$X2t,xlim=c(-1,2))

par(mfrow=c(1,1))

Reuse

Text and figures are licensed under Creative Commons Attribution CC BY 4.0. The source code is licensed under MIT.

Suggest changes

If you find any mistakes (including typos) or want to suggest changes, please feel free to edit the source file of this page on Github and create a pull request.

Citation

For attribution, please cite this work as

Haky Im (2020). Mean of unconstrained h2 is not a reliable measure of mean h2. ImLab Notes. /post/2020/10/29/first-note-hki/

BibTeX citation

@misc{
  title = "Mean of unconstrained h2 is not a reliable measure of mean h2",
  author = "Haky Im",
  year = "2020",
  journal = "ImLab Notes",
  note = "/post/2020/10/29/first-note-hki/"
}