fit.nb.gf
fits data using the pseudo maximum likelihood of a Gamma frailty model
fit.nb.gf(dataC, dataE, trend = c("constant", "exponential"), lower, upper,
method = "L-BFGS-B", start, approx = 20, rho = FALSE, H0 = FALSE,
h0 = 0)
a matrix containing count data from the control group, which is to be fitted. Columns correspond to time points, rows to observations.
a matrix containing count data from the experiment group, which is to be fitted. Columns correspond to time points, rows to observations.
the trend which assumed to underlying in the data.
vector of lower bounds for estimated parameters lambda
, size
and rho
, respectively.
vector of upper bounds for estimated parameters lambda
, size
and rho
, respectively.
algorithm used for minimization of the likelihood, see optim
for details.
vector of starting values for estimated parameters mu
, size
and rho
, respectively, used for optimization.
numer of iterations in numerical calculation of the sandwich estimator, see 'Details'.
indicates whether or not to calculate the correlation coefficient of Gamma frailties. Must be TRUE or FALSE.
indicates whether or not to calculate the hessian and outer gradient matrix under the null hypothesis, see 'Details'.
the value against which is tested under the null
fit.nb.gf
returns estimates of the trend parameters lambda
, dispersion parameter size
,
Hessian matrix hessian
, outer gradient product matrix ogradient
and, if inquired, correlation coefficient rho
.
the function fit.nb.gf
fits a Gamma frailty model as found in Fiocco (2009). The fitting function allows for incomplete follow up,
but not for intermittent missingness.
When calculating the expected sandwich estimator required for the sample size, certain terms can not be computed analytically and have
to be approximated numerically. The value approx
defines how close the approximation is to the true expected sandwich estimator.
High values of approx
provide better approximations but are compuationally more expensive.
If parameter H0 is set to TRUE, the hessian and outer gradient are calculated under the assumption that lambda[2]
\(\geq\) h0
if
trend = "constant"
or lambda[3]
\(\geq\) h0
if trend = "exponential"
.
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.
rnbinom.gf
for information on the Gamma frailty model, n.nb.gf
for calculating
initial sample size required when performing inference, bssr.nb.gf
for blinded
sample size reestimation within a running trial, optim
for more information on the used minimization algorithms.
# NOT RUN {
#Generate data from the Gamma frailty model
random<-get.groups(n=c(1000,1000), size=c(0.7, 0.7), lambda=c(0.8, -0.5), rho=c(0.6, 0.6),
tp=7, trend="constant")
fit.nb.gf(dataC=random[1001:2000,], dataE=random[1:1000,], trend="constant")
# }
Run the code above in your browser using DataCamp Workspace