row.slr.shapiro: Test normality of residuals for many variables.

Description Usage Arguments Value Author(s) References Examples

View source: R/row.slr.shapiro.R

Description

For each row of the data matrix Y, use the Shapiro-Wilk test to determine if the residuals of simple linear regression on x are normally distributed.

Usage

1

Arguments

Y

a data matrix with rows for variables and columns for subjects

x

a vector with values of the independent variables for regression of each row of Y.

Value

A data.frame with three columns:

stat

A vector with the Shapiro-Wilk test statistic for each row of Y

pval

A vector with the Shapiro-Wilk p-value for each row of Y

ebp

A vector with the estimated empirical Bayes probability of normally distributed residuals for each row of Y

Author(s)

Stan Pounds <stanley.pounds@stjude.org>; Demba Fofana <demba.fofana@stjude.org>

References

Patrick Royston (1982) Algorithm AS 181: The W test for Normality. Applied Statistics, 31, 176-180.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
  
####################Correlation Study#####################
# load data
data(correlation.data)
# Read the expression values  
Y<-exprs(correlation.data)
# Read the phenotype
x<-pData(correlation.data)
x[,1]
#Shapiro Test
row.slr.shapiro(Y,x[,1])

HybridMTest documentation built on Nov. 8, 2020, 8:29 p.m.