This simulation study is taken from this [article] (https://pubmed.ncbi.nlm.nih.gov/35574725/). I am trying to generate this simulation
Theoretical Set up
Define the set of true basis functions,
\begin{align*} \psi_{1}(t)= \sqrt{2} \cos\left(2 \pi t \right)\\ \psi_{2}(t)= \sqrt{2} \sin\left(4 \pi t \right)\\ \psi_{3}(t)= \sqrt{2} \cos\left(4 \pi t \right) \end{align*} such that the constraints $\lVert \psi_{k} \rVert^{2}=1$ if $k=k^{\prime}$, and $0$ otherwise, are fulfilled, $k=1,2,3$. We then independently sample the scores according to $\lambda_{i} \sim MVN(0,\Sigma)$, where $\Sigma=diag(10,6,3)$. Given the set of true basis functions and scores, the longitudinal trajectory can be formulated according to the Karhunen-Loeve expansion as, \begin{align*} Z_{i}(t)= \mu(t)+\lambda_{i,1}\psi_{1}(t)+\lambda_{i,2}\psi_{2}(t)+\lambda_{i,3}\psi_{3}(t) \end{align*} where the mean function $\mu(t)$ is assumed to be $0$. The individualized realization of the longitudinal trjectoiry $\left\{Z_{i}(t_{i,r)}, r=1,\ldots,R_{i} \right\}$ are assumed to have $\max(R_{i}) \leq 20$ for $\forall i$, constrained by censoring or event occurrence. We consider these $R_{i}$ visits to happen on a fixed time grid from $0$ to $25$, which increment of $25/\max(R_{i})$ unit.
To link covariates to the time-to-event, we assume a proportional hazard model such that the hazard function follows, \begin{align*} h_{i}(t)=h_{0}(t) \exp{\left\{\alpha_{1} X_{i}+\int_{0}^{\tau} \phi(t) Z_{i}(t) dt\right\} } \end{align*} where $\tau$ is the maximum observation time. The fixed covariate $X_{i}$ is assumed to follow a Bernoulli distribution with a success probability of $0.50$, with the corresponding coefficient $\alpha_{1}$ set to $-1$. Consider the time-varying coefficient: \begin{align*} \text{Scenario} : \phi(t)=0.25 \psi_{1}(t)+ 0.50 \psi_{2}(t)+ \psi_{3}(t)\\ \end{align*}
Here, we let the baseline hazard follow a Weibull distribution $h_{0}(t)= \kappa \rho (\rho t)^{\kappa-1}$ with increasing risk over time and consider $\kappa=2, \rho=0.096$. Given the above setup, the survival time $T_{i}$ can then be generated from the inverse of the cumulative hazard function $H^{−1}(u)$, where $u \sim U(0,1)$. We have assumed the independent censoring scheme in this simulation study, where $C_{i} \sim U(0, C_{max})$, with $C_{max}$ set at a value such that the $\%$ of being censored by the end of the study approximately matches our target censoring percentage.
My questions:
How would I satisfy this condition: The individualized realization of the longitudinal trajectory $\left\{Z_{i}(t_{i,r)}, r=1,\ldots,R_{i} \right\}$ are assumed to have $\max(R_{i}) \leq 20$ for $\forall i$, constrained by censoring or event occurrence. We consider these $R_{i}$ visits to happen on a fixed time grid from $0$ to $25$, which increment of $25/\max(R_{i})$ unit.
How would I satisfy this condition: We have assumed the independent censoring scheme in this simulation study, where $C_{i} \sim U(0, C_{max})$, with $C_{max}$ set at a value such that the $\%$ of being censored by the end of the study approximately matches our target censoring percentage (assume like 33% or 66%)
So, this is related to part 1, so I need to know of $Z_{i}$'s should look like before I link them with my covariate, so is the
tthat I have even make sense. ( I am not sure if this question even makes sense)
I am very sorry for the long post. I have been struggling at this problem for a while now. I appreciate any help I can get. Thank you for your time, and looking forward to reading/applying your comments.
fda.uscpackage and coding-specific questions are off-topic here anyway. For implementation in code you are more likely to get a helpful answer on Stack Overflow. I edited my answer to represent my new "Reconsiderations." – EdM May 25 '23 at 13:52