BJfindU2: Find the Wilks Confidence Interval Upper Bound for Betafun...

Description Usage Arguments Details Value Author(s) References Examples

View source: R/BJfindU2.R

Description

This function uses simple search to find the upper level (default 95%) 1 parameter Wilks confidence limits based on the Buckley-James empirical likelihood test function for two dimensional beta's. The confidece interval is for the 1 parameter, determined by Betafun.

Usage

1
BJfindU2(NPmle, ConfInt, LLRfn, Betafun, dataMat, level=3.84)

Arguments

NPmle

a 2-d vector: the NPMLEs: beta1 hat and beta2 hat.

ConfInt

a vector of length 2. Approx. length of the 2 conf. intervals for beta1 and beta2. May use the SD from bj().

LLRfn

a function that returns the -2LLR.

Betafun

a function that takes the input of 2 parameter values (beta1, beta2) and returns a parameter that we wish to find its confidence Interval Lower Value.

dataMat

matrix of covariates

level

confidence level.

Details

Basically we repeatedly testing the value of the 2 parameters, until we find the max of Betafun, provided the -2 log likelihood value is <= 3.84 (or other level, if set differently).

Value

A list with the following components:

Upper

the upper confidence bound.

maxParameterNloglik

Final values of the 2 parameters, and the log likelihood.

Author(s)

Mai Zhou

References

Zhou, M. (2005). Computing censored empirical likelihood ratio by EM algorithm. JCGS

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
 
# The Stanford Heart Transplant Data: with 152 cases.
# Needs bjtest( ) function from emplik package to run.

## BJloglik <- function(para, dataMat) {
##            yvec <- dataMat[,1]
##            dvec <- dataMat[,2]
##            x <- dataMat[,3:4]
## temp <- bjtest(y=log10(yvec), d=dvec, x=x, beta=para)
## return(temp)
## }

## BJ2fun <- function (b1, b2) {
##    return(b2)
## }

## We first use bj() from Design library to find NPmle and
## the conservative SD of beta1 and beta2

## BJfindU2(NPmle=c(3.52696077,-0.01989555), 
##      ConfInt=c(0.3,0.0066), LLRfn=BJloglik, 
##      Betafun=BJ2fun, 
##      dataMat=cbind(stanford5$time, stanford5$status, 
##      rep(1,152),stanford5$age))
##
# This will take (~ 1 min.) to run.

ELYP documentation built on May 2, 2019, 5:17 a.m.

Related to BJfindU2 in ELYP...