Fits time-varying regression model with partly parametric components. Time-dependent variables for longitudinal data. The model assumes that the mean of the observed responses given covariates is a linear time-varying regression model :
dynreg(
formula,
data = parent.frame(),
aalenmod,
bandwidth = 0.5,
id = NULL,
bhat = NULL,
start.time = 0,
max.time = NULL,
n.sim = 500,
meansub = 1,
weighted.test = 0,
resample = 0
)
a formula object with the response on the left of a '~' operator, and the independent terms on the right as regressors.
a data.frame with the variables.
Aalen model for measurement times. Specified as a survival model (see aalen function).
bandwidth for local iterations. Default is 50% of the range of the considered observation period.
For timevarying covariates the variable must associate each record with the id of a subject.
initial value for estimates. If NULL local linear estimate is computed.
start of observation period where estimates are computed.
end of observation period where estimates are computed. Estimates thus computed from [start.time, max.time]. Default is max of data.
number of simulations in resampling.
if '1' then the mean of the responses is subtracted before the estimation is carried out.
to compute a variance weighted version of the test-processes used for testing time-varying effects.
returns resample processes.
returns an object of type "dynreg". With the following arguments:
the cumulative regression coefficients. This is the efficient estimator based on an initial smoother obtained by local linear regression : $$ \hat B(t) = \int_0^t \tilde \beta(s) ds+ \hspace{4 cm}$$ $$ $$$$\int_0^t X^{-} (Diag(z) -Diag( X^T(s) \tilde \beta(s)) ) dp(ds \times dz), $$ where \(\tilde \beta(t)\) is an initial estimate either provided or computed by local linear regression. To plot this estimate use type="eff.smooth" in the plot() command.
the martingale based pointwise variance estimates.
robust pointwise variances estimates.
estimate of semi-parametric components of model.
variance for gamma.
robust variance for gamma.
simple estimate of cumulative regression coefficients that does not use use an initial smoothing based estimate $$ \hat B_0(t) = \int_0^t X^{-} Diag(z) dp(ds \times dz). $$ To plot this estimate use type="0.mpp" in the plot() command.
the martingale based pointwise variance estimates of cum0.
estimate of cumulative regression coefficients based on initial smoother (but robust to this estimator). $$ \hat B_{ms}(t) = \int_0^t X^{-} (Diag(z)-f(s)) dp(ds \times dz), $$ where \(f\) is chosen as the matrix $$ f(s) = Diag( X^T(s) \tilde \beta(s)) ( I - X_\alpha(s) X_\alpha^-(s) ), $$ where \(X_{\alpha}\) is the design for the sampling intensities.
This is also an efficient estimator when the initial estimator is consistent for \(\beta(t)\) and then asymptotically equivalent to cum, but small sample properties appear inferior. Its variance is estimated by var.cum.
To plot this estimate use type="ms.mpp" in the plot() command.
estimator where local averages are subtracted. Special case of cum.ms. To plot this estimate use type="ly.mpp" in plot.
the martingale based pointwise variance estimates.
estimate of parametric component of model.
estimate of variance of parametric component of model.
estimate of parametric components of model.
estimate of variance of parametric component of model.
estimate of variance of parametric component of model.
estimate of variance of parametric component of model.
observed absolute value of supremum of cumulative components scaled with the variance.
p-value for covariate effects based on supremum test.
resampled supremum values.
observed absolute value of supremum of difference between observed cumulative process and estimate under null of constant effect.
p-value based on resampling.
resampled supremum values.
observed integrated squared differences between observed cumulative and estimate under null of constant effect.
p-value based on resampling.
resampled supremum values.
resampling based constant to construct robust 95% uniform confidence bands.
observed test-process of difference between observed cumulative process and estimate under null of constant effect.
list of 50 random realizations of test-processes under null based on resampling.
covariances for nonparametric terms of model.
$$ E( Z_{ij} | X_{ij}(t) ) = \beta^T(t) X_{ij}^1(t) + \gamma^T X_{ij}^2(t) $$ where \(Z_{ij}\) is the j'th measurement at time t for the i'th subject with covariates \(X_{ij}^1\) and \(X_{ij}^2\). Resampling is used for computing p-values for tests of timevarying effects.
The data for a subject is presented as multiple rows or 'observations', each of which applies to an interval of observation (start, stop]. For counting process data with the )start,stop] notation is used the 'id' variable is needed to identify the records for each subject. The program assumes that there are no ties, and if such are present random noise is added to break the ties.
Martinussen and Scheike, Dynamic Regression Models for Survival Data, Springer (2006).
# NOT RUN {
# }
# NOT RUN {
## this runs slowly and is therfore donttest
data(csl)
indi.m<-rep(1,length(csl$lt))
# Fits time-varying regression model
out<-dynreg(prot~treat+prot.prev+sex+age,data=csl,
Surv(lt,rt,indi.m)~+1,start.time=0,max.time=2,id=csl$id,
n.sim=100,bandwidth=0.7,meansub=0)
summary(out)
par(mfrow=c(2,3))
plot(out)
# Fits time-varying semi-parametric regression model.
outS<-dynreg(prot~treat+const(prot.prev)+const(sex)+const(age),data=csl,
Surv(lt,rt,indi.m)~+1,start.time=0,max.time=2,id=csl$id,
n.sim=100,bandwidth=0.7,meansub=0)
summary(outS)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab