You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Function (arguments \texttt{n, ...}) that generates a list of \texttt{data.table}'s with covariates with each element representing a unique time-point.
52
+
\end{flushleft}
53
+
};
54
+
55
+
\node (outcome) [proc, above=of trial] {
56
+
\textbf{\texttt{outcome}} \\
57
+
\nodepart{two}
58
+
\vspace*{-1.2em}
59
+
\begin{flushleft}
60
+
Function (arguments \texttt{x}: covariate data.table, \texttt{...}: additional
61
+
arguments defining parameters of the outcome model) that generates the outcome given covariates.
62
+
\end{flushleft}
63
+
};
64
+
65
+
\node (exclusion) [proc, above left=of trial] {
66
+
\textbf{\texttt{exclusion}} \\
67
+
\nodepart{two}
68
+
\vspace*{-1.2em}
69
+
\begin{flushleft}
70
+
Function (arguments \texttt{data}: data.table, \texttt{...}) that defines exclusion / inclusion criterions for the trial.
71
+
\end{flushleft}
72
+
};
73
+
74
+
\node (info) [proc, left=of trial] {
75
+
\textbf{\texttt{info}} \\
76
+
\nodepart{two}
77
+
\vspace*{-1.2em}
78
+
\begin{flushleft}
79
+
Optional string describing the trial simulation.
80
+
\end{flushleft}
81
+
};
82
+
83
+
84
+
\node (simulate) [method, above right=of trial] {
85
+
\textbf{\$\texttt{simulate}} \\
86
+
\nodepart{two}
87
+
\vspace*{-1.2em}
88
+
\begin{flushleft}
89
+
\textit{Simulate data from the specified trial design.}
90
+
\textbf{Arguments} \texttt{n}: sample size, \text{...}: additional arguments controlling covariate and outcome parameters. \textbf{Returns} `data.table` as defined by the object initialization with default subject identifier `id` and observation period `num`.
91
+
\end{flushleft}
92
+
};
93
+
94
+
\node (run) [method, right=of trial] {
95
+
\textbf{\$\texttt{run}} \\
96
+
\nodepart{two}
97
+
\vspace*{-1.2em}
98
+
\begin{flushleft}
99
+
\textit{Simulate and estimate parameters several times.}
100
+
\textbf{Arguments} \texttt{R}: replications, \texttt{estimators}: list of estimators of the trial target parameter, \texttt{...} additional arguments to the simulation routine. \textbf{Returns} an object with the Monte Carlo simulation results which can be analyzed with the \texttt{summary} method.
101
+
\end{flushleft}
102
+
};
103
+
104
+
\node (estimatepower) [method, below=of trial] {
105
+
\textbf{\$\texttt{estimate\_power}} \\
106
+
\nodepart{two}
107
+
\vspace*{-1.2em}
108
+
\begin{flushleft}
109
+
\textit{Estimate the statistical power of an estimator in a given scenario using Monte Carlo simulations.}
110
+
\textbf{Arguments} \texttt{R}: number of replications, \texttt{estimators}: estimator to consider,
111
+
\texttt{summary.args}: arguments to the summary method that defines the statistical null hypothesis,
112
+
\texttt{...} additional arguments to the simulation routine. \textbf{Returns} estimated power for the given trial scenario.
Function (arguments \texttt{n, ...}) that generates a list of \texttt{data.table}'s with covariates with each element representing a unique time-point.
86
-
\end{flushleft}
87
-
};
88
-
89
-
\node (outcome) [proc, above=of trial] {
90
-
\textbf{\texttt{outcome}} \\
91
-
\nodepart{two}
92
-
\vspace*{-1.2em}
93
-
\begin{flushleft}
94
-
Function (arguments \texttt{x}: covariate data.table, \texttt{...}: additional
95
-
arguments defining parameters of the outcome model) that generates the outcome given covariates.
96
-
\end{flushleft}
97
-
};
98
-
99
-
\node (exclusion) [proc, above left=of trial] {
100
-
\textbf{\texttt{exclusion}} \\
101
-
\nodepart{two}
102
-
\vspace*{-1.2em}
103
-
\begin{flushleft}
104
-
Function (arguments \texttt{data}: data.table, \texttt{...}) that defines exclusion / inclusion criterions for the trial.
105
-
\end{flushleft}
106
-
};
107
-
108
-
\node (info) [proc, left=of trial] {
109
-
\textbf{\texttt{info}} \\
110
-
\nodepart{two}
111
-
\vspace*{-1.2em}
112
-
\begin{flushleft}
113
-
Optional string describing the trial simulation.
114
-
\end{flushleft}
115
-
};
116
-
117
-
118
-
\node (simulate) [method, above right=of trial] {
119
-
\textbf{\$\texttt{simulate}} \\
120
-
\nodepart{two}
121
-
\vspace*{-1.2em}
122
-
\begin{flushleft}
123
-
\textit{Simulate data from the specified trial design.}
124
-
\textbf{Arguments} \texttt{n}: sample size, \text{...}: additional arguments controlling covariate and outcome parameters. \textbf{Returns} `data.table` as defined by the object initialization with default subject identifier `id` and observation period `num`.
125
-
\end{flushleft}
126
-
};
127
-
128
-
\node (run) [method, right=of trial] {
129
-
\textbf{\$\texttt{run}} \\
130
-
\nodepart{two}
131
-
\vspace*{-1.2em}
132
-
\begin{flushleft}
133
-
\textit{Simulate and estimate parameters several times.}
134
-
\textbf{Arguments} \texttt{R}: replications, \texttt{estimators}: list of estimators of the trial target parameter, \texttt{...} additional arguments to the simulation routine. \textbf{Returns} an object with the Monte Carlo simulation results which can be analyzed with the \texttt{summary} method.
135
-
\end{flushleft}
136
-
};
137
-
138
-
\node (estimatepower) [method, below=of trial] {
139
-
\textbf{\$\texttt{estimate\_power}} \\
140
-
\nodepart{two}
141
-
\vspace*{-1.2em}
142
-
\begin{flushleft}
143
-
\textit{Estimate the statistical power of an estimator in a given scenario using Monte Carlo simulations.}
144
-
\textbf{Arguments} \texttt{R}: number of replications, \texttt{estimators}: estimator to consider,
145
-
\texttt{summary.args}: arguments to the summary method that defines the statistical null hypothesis,
146
-
\texttt{...} additional arguments to the simulation routine. \textbf{Returns} estimated power for the given trial scenario.
\textbf{Returns} an integer with an attribute 'power' with the actual power estimate.
158
-
\end{flushleft}
159
-
};
160
-
161
-
162
-
163
-
\draw [arrow, dashed] (covar) -- (trial);
164
-
\draw [arrow, dashed] (info) -- (trial);
165
-
\draw [arrow, dashed] (exclusion) -- (trial);
166
-
\draw [arrow, dashed] (outcome) -- (trial);
167
-
168
-
\draw [arrow] (trial) -- (simulate);
169
-
\draw [arrow] (trial) -- (run);
170
-
\draw [arrow] (trial) -- (estimatepower);
171
-
\draw [arrow] (trial) -- (estimatesamplesize);
172
-
173
-
\end{tikzpicture}
174
-
```
42
+
{width=100%}
175
43
176
44
# Preliminaries
177
45
@@ -465,10 +333,10 @@ trial$estimate_power(n = 300, R = 500)
465
333
Last, we estimate the sample size required to attain 90% power for the specified
466
334
trial model and estimator
467
335
```{r}
468
-
trial$estimate_samplesize(
469
-
power = 0.9, # default
470
-
estimator = trial$estimators("adjusted")
471
-
)
336
+
# trial$estimate_samplesize(
337
+
# power = 0.9, # default
338
+
# estimator = trial$estimators("adjusted")
339
+
# )
472
340
```
473
341
The method optimizes the sample size by internally calling the
474
342
`Trial$estimate_power` method. Therefore, the behavior for updating model
0 commit comments