print.twostageTE: print for twostageTE

Description Usage Arguments Value Author(s) Examples

View source: R/print.twostageTE.R

Description

print method for twostageTE

Usage

1
2
## S3 method for class 'twostageTE'
print(x, ...)

Arguments

x

twostageTE object

...

ignored

Value

prints basic information about the object (point estimate and confidence intervals)

Author(s)

Shawn Mankad

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
X=runif(25, 0,1)
Y=X^2+rnorm(n=length(X), sd=0.1)
oneStage_IR=stageOneAnalysis(X, Y, 0.25, type="IR-wald", 0.99)
print(oneStage_IR)

## The function is currently defined as
function (x, ...) 
{
    if (!inherits(x, "twostageTE")) {
        stop("Error:  Object is not of class twostageTE")
    }
    if (!is.null(cl <- x$call)) {
        names(cl)[2] <- ""
        cat("Call:\n")
        dput(cl)
    }
    cat(sprintf("\n%.1f%% Confidence Interval", x$level * 100))
    if (is.na(x$L2)) {
        cat(sprintf("\nn   Lower   d0_hat   Upper\n%d   %.3f   %.3f   %.3f\n", 
            length(x$Y1), x$L1, x$estimate, x$U1))
    }
    else {
        cat(sprintf("\nn1   n2   Lower   d0_hat   Upper\n%d   %d   %.3f   %.3f   %.3f\n", 
            length(x$Y1), length(x$Y2), x$L2, x$estimate, x$U2))
    }
    invisible(x)
  }

twostageTE documentation built on May 1, 2019, 9:18 p.m.