test.nb.gf: Testing Hypotheses in Gamma Frailty models

Description Usage Arguments Details Value Source References See Also Examples

View source: R/test.nb.gf.r

Description

test.nb.gf tests hypotheses for certain trends in Gamma frailty models

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
test.nb.gf(
  dataC,
  dataE,
  h,
  hgrad,
  h0 = 0,
  trend = c("constant", "exponential", "custom"),
  H0 = FALSE,
  one.sided = TRUE,
  ...
)

Arguments

dataC

a matrix or data frame containing count data from the control group. Columns correspond to time points, rows to observations.

dataE

a matrix or data frame containing count data from the experiment group. Columns correspond to time points, rows to observations.

h

hypothesis to be tested. The function must return a single value when evaluated on lambda.

hgrad

gradient of function h

h0

the value against which h is tested, see 'Details'.

trend

the trend which assumed to be underlying in the data.

H0

indicates if the sandwich estimator is calculated under the null hypothesis or alternative.

one.sided

indicates if the hypothesis should be tested one- or two-sided

...

Arguments to be passed to function fit.nb.gf().

Details

the function test.nb.gf tests for the null hypothesis h(η, λ) = h_0 against the alternative h(η, λ) \neq h_0. The fitting function allows for incomplete follow up, but not for intermittent missingness.

If parameter H0 is set to TRUE, the hessian and outer gradient are calculated under the assumption that lambda[2] ≥q h0 if trend = "constant" or lambda[3] ≥q h0 if trend = "exponential".

Value

test.nb.gf returns effect size, standard error, Z-statistic and p-value attained through standard normal approximation.

Source

test.nb.gf uses code contributed by Thomas Asendorf.

References

Fiocco M, Putter H, Van Houwelingen JC, (2009), A new serially correlated gamma-frailty process for longitudinal count data Biostatistics Vol. 10, No. 2, pp. 245-257.

See Also

rnbinom.gf for information on the Gamma Frailty model, n.nb.gf for calculating initial sample size required when performing inference, fit.nb.gf for calculating initial parameters required when performing sample size estimation.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
#Create data from two groups
random<-get.groups(n=c(100,100), size=c(0.7, 0.7), lambda=c(0.8, 0), rho=c(0.6, 0.6),
  tp=7, trend="constant")

#Define hypothesis
h<-function(lambda.eta){
  lambda.eta[2]
}
hgrad<-function(lambda.eta){
  c(0, 1, 0)
}
test.nb.gf(dataC=random[101:200,], dataE=random[1:100,], h=h, hgrad=hgrad, h0=0,
  trend="constant", H0=FALSE)

spass documentation built on Jan. 13, 2021, 7:57 p.m.

Related to test.nb.gf in spass...