Learn R Programming

prototest (version 1.2)

print.prototest: Print prototest object

Description

Generic print method for prototest objects

Usage

# S3 method for prototest
print (x, ...)

Arguments

x

object of type prototest.

...

other parameters passed to print function.

Details

Prints the test statistic and p-value associated with the prototest object x.

See Also

prototest.univariate, prototest.multivariate

Examples

Run this code
# NOT RUN {
require (prototest)

### generate data
set.seed (12345)
n = 100
p = 80

X = matrix (rnorm(n*p, 0, 1), ncol=p)


beta = rep(0, p)
beta[1:3] = 2 # three signal variables: number 1, 2, 3
signal = apply(X, 1, function(col){sum(beta*col)})
intercept = 3

y = intercept + signal + rnorm (n, 0, 1)

### treat all columns as if in same group and test for signal

# non-selective ELR test with nuisance intercept
elr = prototest.univariate (X, y, "ELR", selected.col=1:5) 
print (elr)
# }

Run the code above in your browser using DataLab