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
<span id="cb3-6"><a href="#cb3-6" aria-hidden="true" tabindex="-1"></a>}</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
3389
-
<p>For the model’s data inputs, we initially encode three observed binary variables (<span class="math inline">\(Z_{i}\)</span>, <span class="math inline">\(W_{i}^{\text{obs}}\)</span>, and <span class="math inline">\(Y_{i}^{\text{obs}}\)</span>) along with the number of units in the sample (<span class="math inline">\(N\)</span>).</p>
3389
+
<p>For the model’s data inputs, we initially encode three observed binary variables (<span class="math inline">\(Z_{i}\)</span>, <span class="math inline">\(W_{i}^{\text{obs}}\)</span>, and <span class="math inline">\(Y_{i}^{\text{obs}}\)</span>) along with the number of units in the sample (<span class="math inline">\(N\)</span>). With the updated Stan syntax, we have shifted to using the <code>array</code> function for array declarations, which provides a more explicit and streamlined way to denote multidimensional structures. This modern syntax not only enhances clarity but also aligns with the direction of Stan’s evolution, ensuring compatibility with future versions.</p>
Copy file name to clipboardExpand all lines: education/causal_iv_one-sided/case_study_02_IV_one-sided.qmd
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -192,14 +192,14 @@ The model-based estimation strategy offers several advantages over the moment-ba
192
192
193
193
```stan
194
194
data {
195
-
int<lower=1> N; // Sample size N
196
-
int<lower=0, upper=1> Z[N]; // Treatment assigned Z
197
-
int<lower=0, upper=1> W[N]; // Treatment received W
198
-
int<lower=0, upper=1> Y[N]; // Outcome Y
195
+
int<lower=1> N; // Sample size N
196
+
array[N] int<lower=0, upper=1> Z; // Treatment assigned Z
197
+
array[N] int<lower=0, upper=1> W; // Treatment received W
198
+
array[N] int<lower=0, upper=1> Y; // Outcome Y
199
199
}
200
200
```
201
201
202
-
For the model's data inputs, we initially encode three observed binary variables ($Z_{i}$, $W_{i}^{\text{obs}}$, and $Y_{i}^{\text{obs}}$) along with the number of units in the sample ($N$).
202
+
For the model's data inputs, we initially encode three observed binary variables ($Z_{i}$, $W_{i}^{\text{obs}}$, and $Y_{i}^{\text{obs}}$) along with the number of units in the sample ($N$). With the updated Stan syntax, we have shifted to using the `array` function for array declarations, which provides a more explicit and streamlined way to denote multidimensional structures. This modern syntax not only enhances clarity but also aligns with the direction of Stan's evolution, ensuring compatibility with future versions.
0 commit comments