Sieve_NPMLE_Bootstrap: Sieve_NPMLE_Bootstrap function

Description Usage Arguments Details Value References See Also Examples

View source: R/Sieve_NPMLE_Bootstrap.R

Description

This function is used for calculating standard error estimates and 95% confidence bands in quantile using the bootstrap method.

Usage

1
2
Sieve_NPMLE_Bootstrap ( fam_ID, Y0, Delta0, p0G0, fix_t1, fix_t2,
                        Grid, Knot, degree=3, Bn, maxiter=400, ep=1e-05)

Arguments

fam_ID

family ID numbers.

Y0

observed event times or censoring times.

Delta0

indicators of event.

p0G0

probabilities of being a carrier.

fix_t1

a vector of fixed points at which the carrier's cumulative distribution function values are estimated.

fix_t2

a vector of fixed points at which the non-carrier's cumulative distribution function values are estimated.

Grid

a vector of grid points used for plotting the estimated distribution functions of carrier and non-carrier groups.

Knot

number of knots of the B-spline base functions.

degree

degree of the B-spline base functions.

Bn

number of bootstrap samples.

maxiter

maximum number of iterations.

ep

convergence criterion, default is ep= 1e-05.

Details

Using bootstrap for standard error estimation and 95% confidence bands calculation. We do the Bootstrap resample according to fam_ID.

Value

This function returns a list

Boot.L1

estimated cumulative hazard function for the carrier group.

Boot.L2

estimated cumulative hazard function for the non-carrier group.

SE_F1_fix_t

estimated standard errors for the carrier group at given points fix_t1.

SE_F2_fix_t

estimated standard errors for the non-carrier group at given points fix_t2.

References

Wang, Y., Liang, B., Tong, X., Marder, K., Bressman, S., Orr-Urtreger, A., Giladi, N. & Zeng, D. (2015). Efficient estimation of nonparametric genetic risk function with censored data. Biometrika, 102(3), 515-532.

See Also

p0G_Func(), Sieve_NPMLE_Switch().

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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
data("Simulated_data");

OID = Simulated_data[,1];
OY = Simulated_data[,2];
ind = order(OY);
ODelta = Simulated_data[,3];
Op0G = Simulated_data[,4];

Y = OY[ind];
Delta = ODelta[ind];
p0G = Op0G[ind];

Grid = seq(0.2, 3.65, 0.05);
fix_t1 = c(0.288, 0.693, 1.390);
fix_t2 = c(0.779, 1.860, 3.650);
px = seq(0.1, 3, 0.1);

SieveNPMLE_result = Sieve_NPMLE_Switch( Y=Y, Delta=Delta, p0G=p0G, px=px,
                                        Grid=Grid, Knot=7, degree=3  );

Lambda_1.hat = cumsum( SieveNPMLE_result$lamb1.hat );
Lambda_2.hat = cumsum( SieveNPMLE_result$lamb2.hat );

F_carr_func = function(x){ 1 - exp( - max( Lambda_1.hat[Y <= x] ) ) }
F_non_func  = function(x){ 1 - exp( - max( Lambda_2.hat[Y <= x] ) ) }

est.f1 = apply(matrix(fix_t1, ncol=1), 1, F_carr_func );
est.f2 = apply(matrix(fix_t2, ncol=1), 1, F_non_func  );

# ---------------- #
#    Bootstrap     #
# ---------------- #

 Boot = Sieve_NPMLE_Bootstrap( fam_ID=OID, Y0=OY, Delta0=ODelta, p0G0=Op0G,
                               fix_t1=fix_t1, fix_t2=fix_t2, Grid = Grid,
                               Knot=6, degree =3, Bn=10  );

 SE1 = Boot$SE_F1_fix_t;
 SE2 = Boot$SE_F2_fix_t;

 estp = data.frame( fix_t1 = fix_t1, F1.hat = est.f1, SE_F1 = SE1,
                    fix_t2 = fix_t2, F2.hat = est.f2, SE_F2 = SE2  );

 print(estp)

GSSE documentation built on May 2, 2019, 12:40 p.m.