coveragep: Calculate coverage probabilities of \hat p for simulated data

Description Usage Arguments Details Value See Also Examples

View source: R/2DLTfunctions.r

Description

Calculate coverage probabilities of \hat p using the delta method and assuming a log-normal error distribution.

Usage

1
2
coveragep(fit, true.hr, true.b, true.pi.x, true.logphi, type = "LOGNORM",
  interval = 0.95, verbose = FALSE)

Arguments

fit

object resulting from a call of fityx (see details)

true.hr

true form of hazard rate function

true.b

true values of hazard rate parameters

true.pi.x

true form of perpendicular density distribution pi(x)

true.logphi

true values for pi(x) perpendicular density distribution parameters

type

LOGNORM log-normal confidence intervals; NORM normal confidence intervals.

interval

the interval used to determine coverage probability

verbose

boolean. FALSE only covered returned. TRUE a data frame of covered and associated calculations returned (see returns).

Details

In the call of fityx must have hessian=TRUE

Value

boolean; TRUE if within log-normal confidence interval, otherwise FALSE. verbose=TRUE a data frame of p phat, and CV[phat], interval, lower bound returned.

See Also

phat fityx

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
ystart=4;w=1
hr=h2; b=log(c(0.75,1))
pi.x=pi.norm; logphi=c(0.5,log(0.2))
N=50 #true number of animals
#generate some observations
simDat=simXY(N=N,pi.x=pi.x,logphi=logphi,
hr=hr,b=b,w=w,ystart=ystart)
x=simDat$locs$x; y=simDat$locs$y 
est.yx=fityx(y,x,b,hr,ystart,pi.x,logphi,w)
coveragep(fit=est.yx,true.hr=hr,true.b=b,interval=0.95,
 true.pi.x=pi.x,true.logphi=logphi,verbose=TRUE)

## End(Not run)     

david-borchers/LT2D documentation built on Aug. 17, 2020, 1:37 a.m.