Description Usage Arguments Details Value Note Examples

Compute SNP-by-SNP goodness-of-fit when compared to population
structure. This can be aggregated to determine genome-wide
goodness-of-fit for a particular value of *d*.

1 | ```
model.gof(X, LF, B)
``` |

`X` |
a matrix of SNP genotypes, i.e. an integer matrix of 0's, 1's, and 2's. Sparse matrices of class Matrix are not supported (yet). |

`LF` |
matrix of logistic factors |

`B` |
number of null datasets to generate - |

This function returns p-values for LFA model goodness of fit based on a simulated null.

vector of p-values for each SNP.

Genotype matrix is expected to be a matrix of integers with values 0, 1, and 2. Currently no support for missing values. Note that the coding of the SNPs does not affect the algorithm.

1 2 3 4 5 6 | ```
LF <- lfa(hgdp_subset, 4)
gof_4 <- model.gof(hgdp_subset, LF, 3)
LF <- lfa(hgdp_subset, 10)
gof_10 <- model.gof(hgdp_subset, LF, 3)
hist(gof_4)
hist(gof_10)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.