resids_diag {GWAS.BAYES} | R Documentation

## resids_diag

### Description

Tests residuals to see if they are normal. This looks at the model with all significant SNPs from the preselection phase.

### Usage

    resids_diag(Y,SNPs,significant,kinship = FALSE,principal_components = FALSE,plot_it = TRUE)

### Arguments

`Y` | The phenotype response of interest
`SNPs` | Standardized SNP data set where the values of each column are either 0 or 1
`significant` | A vector of 0's and 1's where the 1's indicate a significant SNP. This is returned in the output of the preselection function.
`kinship` | A kinship matrix, can be calculated from the rrBLUP package.
`principal_components` | A matrix or vector of the principal components one would like to include in the analysis.
`plot_it` | If TRUE a histogram of the residuals is returned.

### Value

`value 1` | The output of a Shapiro-Wilk test for the residuals. If the p-value is above .05, there is no evidence that the residuals are not normal. If the p-value is below .05 there is evidence that the residuals are not normal, and some transformation is suggested.
`value 2` | A histogram of the residuals when plot_it = TRUE

### Examples

    data("vignette_lm_dat")
    Y <- vignette_lm_dat$Phenotype
    SNPs <- vignette_lm_dat[,-1]
    fullPreprocess <- preprocess_SNPs(SNPs = SNPs,Y = Y,MAF = 0.01,number_cores = 1)
    SNPs <- fullPreprocess$SNPs
    Y <- fullPreprocess$Y
    fullPreprocess$SNPs_Dropped
    principal_comp <- pca_function(SNPs = SNPs,number_components = 1,plot_it = FALSE)
    Significant_SNPs <- preselection(Y = Y, SNPs = SNPs,number_cores = 1, principal_components = principal_comp,frequentist = TRUE,controlrate = "bonferroni",threshold = .05,kinship = FALSE,info = FALSE)

    resids_diag(Y = Y,SNPs = SNPs,significant = Significant_SNPs$Significant,kinship = FALSE,principal_components = principal_comp,plot_it = TRUE)

[Package GWAS.BAYES version 1.1.0 Index]