Learn R Programming

quad (version 1.0)

quadp: This function provides you the pvalue based on the Pearson Family distribution.

Description

Main function of this package. It returns the pvalue of the quadratic form statistics.

Usage

quadp(y, A, mycoef)

Arguments

y
y is the vector in quadratic form $y^T A y$
A
A is the symmetric matrix
mycoef
global variables

Value

stat
test statistics value
p
pvalue based on the Pearson family fitting using the exact four moments

Details

This is the main function in the package. It returns the test statistics of the quadratic form and its corresponding p value using Pearson family for the fitting.

See Also

lincombfun, sumfun

Examples

Run this code
#####  m is the dimension of the A matrix, n is the length of y        ##
#####  no row/column of A can be all constant, as this is degenerate and creates problems. 
library(PearsonDS)

m=15
n=20
set.seed(1)
x=matrix(rnorm(m*n),m,n) # just an example
y=rnorm(n)     
A=t(x-rowMeans(x))
data(mycoef)
##### The code below assumes that y and A have been presepecified or otherwise preloaded
#result=quadp(y,A,mycoef)
#print(result)

Run the code above in your browser using DataLab