Description Usage Arguments Value Examples
Generate A Longitudinal Data Set
1 2 3 4 5 6 7 8 9 10 11 12 13 |
n |
number of sample size. |
model |
a character string for a nonlinear model: |
p |
a parameter for the dimension of coefficients in the log-normal model for the inflection point. |
bb0 |
a parameter for the true intercept term of the log-normal model for the inflection point. |
bb |
a (p-1)-length of the true coefficient vector of subject specific covariates. |
x.sd |
a parameter for the standard deviation of time points (log-transformed ages). |
v1 |
a parameter for the smallest visit number among all subjects have made. |
v2 |
a parameter for the largest visit number among all subjects have made. |
dist |
a character string for the distribution of the within-subject error term in the longitudinal model. Default is |
eps.sd |
a true scale parameter of the within-subject error term in the longitudinal model. |
u.sd |
a true scale parameter of the random error term in the inflection point model. |
A data frame of the longitudinal data with 7 variables:
subj.ida vector of the ID number for all subjects.
subj.cov a vector of the subject specific covariates for all subjects.
true_logta vector of the inflection points for all subjects.
agesa vector of the time points, which are the log transformed ages at clinical visits for all subjects
omegaa vector of the S-shaped function values depending on the ages and true_logt for all subjects.
tmsa vector of the observed longitudinal responses (total motor scores) for all subjects
sexa vector of the subjects's gender.
The number of rows for the returned data frame is determined by the number of subjects' visits, where 5, 6, and 7 visits are randomly assigned to all patients. For example, the first subject made 5 visits and the second subject made 7 visits. Then the size of the data frame containing these two subjects' longitudinal data is 12 by 7.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | library(HDChangePoint)
# How to Generate Simulated Data using mydata() #
n=80; model="logist"; p=2; bb0=0.5;bb=0.1; x.sd=0.3; v1=8; v2=10;
dist="normal"; eps.sd=0.05;u.sd=0.05;
## Specify parameters for the multi-stage nonparametric procedure
num.interp=45;newl=45; k1=20; k2=20; tolerance=0.009; iter=0; time.length=20;
set.seed(22)
## Data generation under the logistic model
outdat<-mydata(n=n, model=model, p=p, bb0=bb0, bb=bb, x.sd=x.sd,
dist=dist,v1=v1, v2=v2, eps.sd=eps.sd, u.sd=u.sd) #
## Multi-stage nonparametric estimation
results<-sim.nonpara(n=n, model=model, dist=dist, k1=k1, k2=k2,
num.interp=num.interp, newl=newl, eps.sd=eps.sd, mean.diff=1, tolerance=tolerance,
itermax=50, iter=iter, time.length=time.length, dat=outdat)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.