Learn R Programming

riskPredictClustData (version 0.2.6)

riskPredict: Assessing risk prediction performance for clustered data

Description

Assessing risk prediction performance for clustered data.

Usage

riskPredict(frame, alpha=0.05)

Arguments

frame

A data frame with 4 columns: cid, subuid, status, and score. cid indicates cluster id; subuid indicates unit ID within a cluster; status=1 indicates an eye is progressed; status=0 indicates an eye is not progressed; score represents the risk score.

alpha

numeric. confidence level for \(eta_c\).

Value

A list of 6 elements:

stat

the test statistics \(\hat{\eta}_c^{(1)}\) hateta_c^(1) based on the prediction rule.

se.stat

standard error of the test statistic under the null hypothesis.

z

z score z=(stat - 0.5)/se.stat

pval

p-value of the test

rho

correlation between \(H(Z_{ij}) and H(Z_{i \ell})\)

mu.hat

estimated \(\mu\).

theta.hat

estimated \(\theta\).

theta.c.hat

estimated \(\theta_c\).

E.stat.Ha

expectation of \(\hat{\eta}_c\) under the alternative hypothesis.

se.stat.Ha

standard error for \(\hat{\eta}_c\) under the alternative hypothesis.

CIlow

lower confidence limit for \(\eta_c\).

CIupp

upper confidence limit for \(\eta_c\).

datHk

A nSubj by 2 matrix of probit transformed risk scores by using only the first 2 observations of each subject.

ci

the vector of \(c_i\), the number of progressing subunits for the \(i\)-th subject.

di

the vector of \(d_i\), the number of non-progressing subunits for the \(i\)-th subject.

Details

To obtain 95% confidence interval of \(\eta_c\), we first obtain 95% confidence interval \([c_1, c_2]\) for \(\Phi^{-1}(\eta_c)\), then transform back: \([\Phi(c_1), \Phi(c_2)]\).

References

Rosner B, Qiu W, and Lee MLT. Assessing Discrimination of Risk Prediction Rules in a Clustered Data Setting. Lifetime Data Anal. 2013 Apr; 19(2): 242-256.

Examples

Run this code
# NOT RUN {


set.seed(1234567)
datFrame = genSimDataGLMEM(nSubj = 30, beta0 = -6, sd.beta0i = 1.58, 
                          beta1 = 1.58, beta2 = -3.95, beta3 = 3.15, beta4 = 2.06,
                          beta5 = 0.51, beta6 = 1.47, beta7 = 3.11, 
                          p.smkcur = 0.08, p.inieye31 = 0.44, p.inieye32 = 0.42,
                          p.inieye41 = 0.12, p.inieye42 = 0.11, sd.lncalorc = 0.33)

print(dim(datFrame))
print(datFrame[1:2,])

tt1 = getScore(fmla = prog~smkcur+lncalorc+inieye3+inieye4+factor(rtotfat), 
  cidVar = "cid", subuidVar = "subuid", statusVar = "prog", 
  datFrame = datFrame, mycorstr = "exchangeable",
  verbose = FALSE)
myframe1=tt1$frame

print(dim(myframe1))
print(myframe1[1:3,])

res1 = riskPredict(myframe1)
print(names(res1))
print(res1)


# }

Run the code above in your browser using DataLab