ScoreFun2: ScoreFun2

Description Usage Arguments Value Examples

View source: R/FunsForOptimalV2.R

Description

caculate the gradient value for Maximum Likelihood Estimates in LBC model

Usage

1
ScoreFun2(bb, ixx, iyy, iw, iZZ)

Arguments

bb

initial values for the intercept and slope coefficients

ixx

continuous predictor

iyy

binary outcome

iw

the weighted parameter

iZZ

covariates to be incorporated in the model

Value

a numeric gradient value of the corresponding individual observation.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
iZZ <- matrix(0,100,10)
ixx <- matrix(0,100,1)
iyy <- matrix(0,100,1)
iw <-matrix(0,100,1)
# ixx: continuous predictor
# iyy: binary outcome
# iZZ: covariates to be incorporated in the model
# iw:  The weighted parameter
# myLBC <-
#   maxLik(
 #   logLik = LogLikeFun2,
 #   grad = ScoreFun2,
 #   start = inits,
 #   ixx = ixx,
 #   iyy = iyy,
 #   iw = iw,
 #   iZZ = as.matrix(iZZ)
 #  )
# as.matrix returns all values of iZZ as a matrix

LBC documentation built on Nov. 15, 2021, 9:07 a.m.