Description Usage Arguments Value Author(s) Examples
A function for doing matrix regression tests of a model against a nested model.
1 | matregtest(mats, pred, drop, numperm)
|
mats |
A list of numeric matrices, all assumed to be the same dimensions and symmetric. Diagonals are not used. Off-diagonal non-finite values not allowed. The first entry taken to be the response. |
pred |
The indices in mats of predictor variables in the more complex of the two models to be compared, should not include 1. Input is numeric value(s), e.g. pred=2, pred =2:3, pred =c(2,3,5). |
drop |
The indices in mats of predictor variables that are dropped to get from the complex to the simple model. Should be a subset of pred. |
numperm |
The number of permutations used to do the test |
matregtest
return an object of class list consisting of
ssr_dat |
Sum of squared residuals for the linear regression using all predictors in |
ssr_perm |
Vector of sums of squares of residuals for linear regressions using randomized matrices for the indices in |
p |
The approximate p-value for the test with null hypothesis the simpler model and alternative the more complex one |
Lei Zhao, leizhao@ku.edu ; Daniel Reuman, reuman@ku.edu
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | v2<-matrix(rnorm(100),10,10)
v2<-v2+t(v2)
v3<-matrix(rnorm(100),10,10)
v3<-v3+t(v3)
v4<-matrix(rnorm(100),10,10)
v4<-v4+t(v4)
err<-matrix(rnorm(100,sd=.05),10,10)
err<-err+t(err)
v1<-1*v2+2*v3+1+err
mats<-list(v1=v1,v2=v2,v3=v3,v4=v4)
resp<-1
pred<-2:4
drop<-4
numperm<-100
#in a real application numperm should typically
#be at least 1000
h<-matregtest(mats,pred,drop,numperm)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.