Skip to content

Commit

Permalink
ivelasq published a site update
Browse files Browse the repository at this point in the history
  • Loading branch information
ivelasq committed Aug 28, 2023
1 parent c6c92ed commit a9fba11
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion c05-descriptive-analysis.html
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ <h3>Prerequisites<a href="c05-descriptive-analysis.html#prereq5" class="anchor-s
<span id="cb99-4"><a href="c05-descriptive-analysis.html#cb99-4" aria-hidden="true" tabindex="-1"></a> <span class="fu">as_survey_design</span>(<span class="at">strata =</span> stype, <span class="at">weights =</span> pw)</span></code></pre></div>
<p>We will be using data from ANES and RECS. Here is the code to create the design objects for each to use throughout this chapter. For ANES, we need to adjust the weight so it sums to the population instead of the sample (see the ANES documentation and Chapter <a href="c04-understanding-survey-data-documentation.html#c04-understanding-survey-data-documentation">4</a> for more information).</p>
<div class="sourceCode" id="cb100"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb100-1"><a href="c05-descriptive-analysis.html#cb100-1" aria-hidden="true" tabindex="-1"></a>anes_in <span class="ot">&lt;-</span> <span class="fu">read_osf</span>(<span class="st">&quot;anes_2020.rds&quot;</span>)</span>
<span id="cb100-2"><a href="c05-descriptive-analysis.html#cb100-2" aria-hidden="true" tabindex="-1"></a>target_pop <span class="ot">&lt;-</span> <span class="dv">231592693</span></span>
<span id="cb100-2"><a href="c05-descriptive-analysis.html#cb100-2" aria-hidden="true" tabindex="-1"></a>targetpop <span class="ot">&lt;-</span> <span class="dv">231592693</span></span>
<span id="cb100-3"><a href="c05-descriptive-analysis.html#cb100-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb100-4"><a href="c05-descriptive-analysis.html#cb100-4" aria-hidden="true" tabindex="-1"></a>anes_adjwgt <span class="ot">&lt;-</span> anes_in <span class="sc">%&gt;%</span></span>
<span id="cb100-5"><a href="c05-descriptive-analysis.html#cb100-5" aria-hidden="true" tabindex="-1"></a> <span class="fu">mutate</span>(<span class="at">Weight =</span> Weight <span class="sc">/</span> <span class="fu">sum</span>(Weight) <span class="sc">*</span> targetpop)</span>
Expand Down
2 changes: 1 addition & 1 deletion c06-statistical-testing.html
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ <h3>Prerequisites<a href="c06-statistical-testing.html#prereq6" class="anchor-se
<span id="cb251-7"><a href="c06-statistical-testing.html#cb251-7" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(gt)</span></code></pre></div>
<p>We will be using data from ANES and RECS. Here is the code to create the design objects for each to use throughout this chapter. For ANES, we need to adjust the weight so it sums to the population instead of the sample (see the ANES documentation and Chapter <a href="c04-understanding-survey-data-documentation.html#c04-understanding-survey-data-documentation">4</a> for more information).</p>
<div class="sourceCode" id="cb252"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb252-1"><a href="c06-statistical-testing.html#cb252-1" aria-hidden="true" tabindex="-1"></a>anes_in <span class="ot">&lt;-</span> <span class="fu">read_osf</span>(<span class="st">&quot;anes_2020.rds&quot;</span>)</span>
<span id="cb252-2"><a href="c06-statistical-testing.html#cb252-2" aria-hidden="true" tabindex="-1"></a>target_pop <span class="ot">&lt;-</span> <span class="dv">231592693</span></span>
<span id="cb252-2"><a href="c06-statistical-testing.html#cb252-2" aria-hidden="true" tabindex="-1"></a>targetpop <span class="ot">&lt;-</span> <span class="dv">231592693</span></span>
<span id="cb252-3"><a href="c06-statistical-testing.html#cb252-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb252-4"><a href="c06-statistical-testing.html#cb252-4" aria-hidden="true" tabindex="-1"></a>anes_adjwgt <span class="ot">&lt;-</span> anes_in <span class="sc">%&gt;%</span></span>
<span id="cb252-5"><a href="c06-statistical-testing.html#cb252-5" aria-hidden="true" tabindex="-1"></a> <span class="fu">mutate</span>(<span class="at">Weight =</span> Weight <span class="sc">/</span> <span class="fu">sum</span>(Weight) <span class="sc">*</span> targetpop)</span>
Expand Down
21 changes: 11 additions & 10 deletions c07-modeling.html
Original file line number Diff line number Diff line change
Expand Up @@ -410,16 +410,17 @@ <h3>Prerequisites<a href="c07-modeling.html#prereq7" class="anchor-section" aria
<span id="cb312-6"><a href="c07-modeling.html#cb312-6" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(broom)</span></code></pre></div>
<p>We will be using data from ANES and RECS. Here is the code to create the design objects for each to use throughout this chapter. For ANES, we need to adjust the weight so it sums to the population instead of the sample (see the ANES documentation and Chapter <a href="c04-understanding-survey-data-documentation.html#c04-understanding-survey-data-documentation">4</a> for more information).</p>
<div class="sourceCode" id="cb313"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb313-1"><a href="c07-modeling.html#cb313-1" aria-hidden="true" tabindex="-1"></a>anes_in <span class="ot">&lt;-</span> <span class="fu">read_osf</span>(<span class="st">&quot;anes_2020.rds&quot;</span>) </span>
<span id="cb313-2"><a href="c07-modeling.html#cb313-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb313-3"><a href="c07-modeling.html#cb313-3" aria-hidden="true" tabindex="-1"></a>anes_adjwgt <span class="ot">&lt;-</span> anes_in <span class="sc">%&gt;%</span></span>
<span id="cb313-4"><a href="c07-modeling.html#cb313-4" aria-hidden="true" tabindex="-1"></a> <span class="fu">mutate</span>(<span class="at">Weight =</span> Weight <span class="sc">/</span> <span class="fu">sum</span>(Weight) <span class="sc">*</span> targetpop)</span>
<span id="cb313-5"><a href="c07-modeling.html#cb313-5" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb313-6"><a href="c07-modeling.html#cb313-6" aria-hidden="true" tabindex="-1"></a>anes_des <span class="ot">&lt;-</span> anes_adjwgt <span class="sc">%&gt;%</span></span>
<span id="cb313-7"><a href="c07-modeling.html#cb313-7" aria-hidden="true" tabindex="-1"></a> <span class="fu">as_survey_design</span>(</span>
<span id="cb313-8"><a href="c07-modeling.html#cb313-8" aria-hidden="true" tabindex="-1"></a> <span class="at">weights =</span> Weight,</span>
<span id="cb313-9"><a href="c07-modeling.html#cb313-9" aria-hidden="true" tabindex="-1"></a> <span class="at">strata =</span> Stratum,</span>
<span id="cb313-10"><a href="c07-modeling.html#cb313-10" aria-hidden="true" tabindex="-1"></a> <span class="at">ids =</span> VarUnit,</span>
<span id="cb313-11"><a href="c07-modeling.html#cb313-11" aria-hidden="true" tabindex="-1"></a> <span class="at">nest =</span> <span class="cn">TRUE</span>)</span></code></pre></div>
<span id="cb313-2"><a href="c07-modeling.html#cb313-2" aria-hidden="true" tabindex="-1"></a>targetpop <span class="ot">&lt;-</span> <span class="dv">231592693</span></span>
<span id="cb313-3"><a href="c07-modeling.html#cb313-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb313-4"><a href="c07-modeling.html#cb313-4" aria-hidden="true" tabindex="-1"></a>anes_adjwgt <span class="ot">&lt;-</span> anes_in <span class="sc">%&gt;%</span></span>
<span id="cb313-5"><a href="c07-modeling.html#cb313-5" aria-hidden="true" tabindex="-1"></a> <span class="fu">mutate</span>(<span class="at">Weight =</span> Weight <span class="sc">/</span> <span class="fu">sum</span>(Weight) <span class="sc">*</span> targetpop)</span>
<span id="cb313-6"><a href="c07-modeling.html#cb313-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb313-7"><a href="c07-modeling.html#cb313-7" aria-hidden="true" tabindex="-1"></a>anes_des <span class="ot">&lt;-</span> anes_adjwgt <span class="sc">%&gt;%</span></span>
<span id="cb313-8"><a href="c07-modeling.html#cb313-8" aria-hidden="true" tabindex="-1"></a> <span class="fu">as_survey_design</span>(</span>
<span id="cb313-9"><a href="c07-modeling.html#cb313-9" aria-hidden="true" tabindex="-1"></a> <span class="at">weights =</span> Weight,</span>
<span id="cb313-10"><a href="c07-modeling.html#cb313-10" aria-hidden="true" tabindex="-1"></a> <span class="at">strata =</span> Stratum,</span>
<span id="cb313-11"><a href="c07-modeling.html#cb313-11" aria-hidden="true" tabindex="-1"></a> <span class="at">ids =</span> VarUnit,</span>
<span id="cb313-12"><a href="c07-modeling.html#cb313-12" aria-hidden="true" tabindex="-1"></a> <span class="at">nest =</span> <span class="cn">TRUE</span>)</span></code></pre></div>
<p>For RECS, details are included in the RECS documentation and Chapter <a href="c03-specifying-sample-designs.html#c03-specifying-sample-designs">3</a>.</p>
<div class="sourceCode" id="cb314"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb314-1"><a href="c07-modeling.html#cb314-1" aria-hidden="true" tabindex="-1"></a>recs_in <span class="ot">&lt;-</span><span class="fu">read_osf</span>(<span class="st">&quot;recs_2015.rds&quot;</span>)</span>
<span id="cb314-2"><a href="c07-modeling.html#cb314-2" aria-hidden="true" tabindex="-1"></a></span>
Expand Down
2 changes: 1 addition & 1 deletion search_index.json

Large diffs are not rendered by default.

0 comments on commit a9fba11

Please sign in to comment.