Skip to content

Commit

Permalink
brfss 2022
Browse files Browse the repository at this point in the history
  • Loading branch information
ajdamico committed Jan 22, 2024
1 parent 6c94e81 commit 3c6ee66
Show file tree
Hide file tree
Showing 65 changed files with 25 additions and 30 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# You can find the book at http://asdfree.com/
american-community-survey-acs: <p><a href="https://github.com/asdfree/acs/actions"><img src="https://github.com/asdfree/acs/actions/workflows/r.yml/badge.svg" alt="Github Actions Badge"></a></p>
american-housing-survey-ahs: <p><a href="https://github.com/asdfree/ahs/actions"><img src="https://github.com/asdfree/ahs/actions/workflows/r.yml/badge.svg" alt="Github Actions Badge"></a></p>
american-national-election-studies-anes: <p><img src='https://img.shields.io/badge/tested%20on%20my%20laptop:-2024 01 10-brightgreen' alt='Local Testing Badge'></p>
american-national-election-studies-anes: <p><img src='https://img.shields.io/badge/tested%20on%20my%20laptop:-2024 01 22-brightgreen' alt='Local Testing Badge'></p>
american-time-use-survey-atus: <p><a href="https://github.com/asdfree/atus/actions"><img src="https://github.com/asdfree/atus/actions/workflows/r.yml/badge.svg" alt="Github Actions Badge"></a></p>
area-health-resources-files-ahrf: <p><a href="https://github.com/asdfree/ahrf/actions"><img src="https://github.com/asdfree/ahrf/actions/workflows/r.yml/badge.svg" alt="Github Actions Badge"></a></p>
behavioral-risk-factor-surveillance-system-brfss: <p><a href="https://github.com/asdfree/brfss/actions"><img src="https://github.com/asdfree/brfss/actions/workflows/r.yml/badge.svg" alt="Github Actions Badge"></a></p>
census-of-governments-cog: <p><a href="https://github.com/asdfree/cog/actions"><img src="https://github.com/asdfree/cog/actions/workflows/r.yml/badge.svg" alt="Github Actions Badge"></a></p>
consumer-expenditure-survey-ces: <p><a href="https://github.com/asdfree/ces/actions"><img src="https://github.com/asdfree/ces/actions/workflows/r.yml/badge.svg" alt="Github Actions Badge"></a></p>
current-population-survey-cps: <p><a href="https://github.com/asdfree/cps/actions"><img src="https://github.com/asdfree/cps/actions/workflows/r.yml/badge.svg" alt="Github Actions Badge"></a></p>
european-social-survey-ess: <p><img src='https://img.shields.io/badge/tested%20on%20my%20laptop:-2024 01 10-brightgreen' alt='Local Testing Badge'></p>
european-social-survey-ess: <p><img src='https://img.shields.io/badge/tested%20on%20my%20laptop:-2024 01 22-brightgreen' alt='Local Testing Badge'></p>
exame-nacional-de-desempenho-de-estudantes-enade: <p><a href="https://github.com/asdfree/enade/actions"><img src="https://github.com/asdfree/enade/actions/workflows/r.yml/badge.svg" alt="Github Actions Badge"></a></p>
exame-nacional-do-ensino-medio-enem: <p><a href="https://github.com/asdfree/enem/actions"><img src="https://github.com/asdfree/enem/actions/workflows/r.yml/badge.svg" alt="Github Actions Badge"></a></p>
fda-adverse-event-reporting-system-faers: <p><a href="https://github.com/asdfree/faers/actions"><img src="https://github.com/asdfree/faers/actions/workflows/r.yml/badge.svg" alt="Github Actions Badge"></a></p>
Expand Down
7 changes: 1 addition & 6 deletions asdfree_cache/html/__packages
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
httr
archive
readr
DBI
duckdb
haven
bookdown
rmarkdown
stringr
haven
Matrix
survival
survey
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
12 changes: 6 additions & 6 deletions brfss.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ library(haven)
zip_tf <- tempfile()
zip_url <- "https://www.cdc.gov/brfss/annual_data/2021/files/LLCP2021XPT.zip"
zip_url <- "https://www.cdc.gov/brfss/annual_data/2022/files/LLCP2022XPT.zip"
download.file( zip_url , zip_tf , mode = 'wb' )
Expand Down Expand Up @@ -327,7 +327,7 @@ summary( glm_result )

## Replication Example {-}

This example matches Alaska's confidence intervals from the [BRFSS Prevalence & Trends Data](https://nccd.cdc.gov/BRFSSPrevalence/rdPage.aspx?rdReport=DPH_BRFSS.ExploreByTopic&irbLocationType=StatesAndMMSA&islClass=CLASS07&islTopic=TOPIC28&islYear=2021&rdRnd=24558):
This example matches Alaska's confidence intervals from the [BRFSS Prevalence & Trends Data](https://nccd.cdc.gov/BRFSSPrevalence/rdPage.aspx?rdReport=DPH_BRFSS.ExploreByTopic&irbLocationType=StatesAndMMSA&islClass=CLASS07&islTopic=TOPIC28&islYear=2022&rdRnd=24558):

```{r eval = FALSE , results = "hide" }
Expand All @@ -342,10 +342,10 @@ result <-
na.rm = TRUE
)
stopifnot( round( confint( result )[ 1 , 1 ] , 3 ) == 0.094 )
stopifnot( round( confint( result )[ 1 , 2 ] , 3 ) == 0.122 )
stopifnot( round( confint( result )[ 2 , 1 ] , 3 ) == 0.878 )
stopifnot( round( confint( result )[ 2 , 2 ] , 3 ) == 0.906 )
stopifnot( round( confint( result )[ 1 , 1 ] , 3 ) == 0.092 )
stopifnot( round( confint( result )[ 1 , 2 ] , 3 ) == 0.114 )
stopifnot( round( confint( result )[ 2 , 1 ] , 3 ) == 0.886 )
stopifnot( round( confint( result )[ 2 , 2 ] , 3 ) == 0.908 )
```

Expand Down
2 changes: 1 addition & 1 deletion docs/american-national-election-studies-anes.html
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ <h1>
<section class="normal" id="section-">
<div id="american-national-election-studies-anes" class="section level1 unnumbered hasAnchor">
<h1>American National Election Studies (ANES)<a href="american-national-election-studies-anes.html#american-national-election-studies-anes" class="anchor-section" aria-label="Anchor link to header"></a></h1>
<p><img src='https://img.shields.io/badge/tested%20on%20my%20laptop:-2024 01 10-brightgreen' alt='Local Testing Badge'></p>
<p><img src='https://img.shields.io/badge/tested%20on%20my%20laptop:-2024 01 22-brightgreen' alt='Local Testing Badge'></p>
<p>A time series recording belief, public opinion, and political participation back to Dewey vs. Truman.</p>
<ul>
<li><p>Most tables contain one row per sampled eligible voter, varying weights like pre- and post-election.</p></li>
Expand Down
12 changes: 6 additions & 6 deletions docs/behavioral-risk-factor-surveillance-system-brfss.html
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ <h2>Download, Import, Preparation<a href="behavioral-risk-factor-surveillance-sy
<span id="cb170-2"><a href="behavioral-risk-factor-surveillance-system-brfss.html#cb170-2" tabindex="-1"></a></span>
<span id="cb170-3"><a href="behavioral-risk-factor-surveillance-system-brfss.html#cb170-3" tabindex="-1"></a>zip_tf <span class="ot">&lt;-</span> <span class="fu">tempfile</span>()</span>
<span id="cb170-4"><a href="behavioral-risk-factor-surveillance-system-brfss.html#cb170-4" tabindex="-1"></a></span>
<span id="cb170-5"><a href="behavioral-risk-factor-surveillance-system-brfss.html#cb170-5" tabindex="-1"></a>zip_url <span class="ot">&lt;-</span> <span class="st">&quot;https://www.cdc.gov/brfss/annual_data/2021/files/LLCP2021XPT.zip&quot;</span></span>
<span id="cb170-5"><a href="behavioral-risk-factor-surveillance-system-brfss.html#cb170-5" tabindex="-1"></a>zip_url <span class="ot">&lt;-</span> <span class="st">&quot;https://www.cdc.gov/brfss/annual_data/2022/files/LLCP2022XPT.zip&quot;</span></span>
<span id="cb170-6"><a href="behavioral-risk-factor-surveillance-system-brfss.html#cb170-6" tabindex="-1"></a> </span>
<span id="cb170-7"><a href="behavioral-risk-factor-surveillance-system-brfss.html#cb170-7" tabindex="-1"></a><span class="fu">download.file</span>( zip_url , zip_tf , <span class="at">mode =</span> <span class="st">&#39;wb&#39;</span> )</span>
<span id="cb170-8"><a href="behavioral-risk-factor-surveillance-system-brfss.html#cb170-8" tabindex="-1"></a></span>
Expand Down Expand Up @@ -1240,7 +1240,7 @@ <h3>Regression Models and Tests of Association<a href="behavioral-risk-factor-su
</div>
<div id="replication-example-5" class="section level2 unnumbered hasAnchor">
<h2>Replication Example<a href="behavioral-risk-factor-surveillance-system-brfss.html#replication-example-5" class="anchor-section" aria-label="Anchor link to header"></a></h2>
<p>This example matches Alaska’s confidence intervals from the <a href="https://nccd.cdc.gov/BRFSSPrevalence/rdPage.aspx?rdReport=DPH_BRFSS.ExploreByTopic&amp;irbLocationType=StatesAndMMSA&amp;islClass=CLASS07&amp;islTopic=TOPIC28&amp;islYear=2021&amp;rdRnd=24558">BRFSS Prevalence &amp; Trends Data</a>:</p>
<p>This example matches Alaska’s confidence intervals from the <a href="https://nccd.cdc.gov/BRFSSPrevalence/rdPage.aspx?rdReport=DPH_BRFSS.ExploreByTopic&amp;irbLocationType=StatesAndMMSA&amp;islClass=CLASS07&amp;islTopic=TOPIC28&amp;islYear=2022&amp;rdRnd=24558">BRFSS Prevalence &amp; Trends Data</a>:</p>
<div class="sourceCode" id="cb195"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb195-1"><a href="behavioral-risk-factor-surveillance-system-brfss.html#cb195-1" tabindex="-1"></a>result <span class="ot">&lt;-</span></span>
<span id="cb195-2"><a href="behavioral-risk-factor-surveillance-system-brfss.html#cb195-2" tabindex="-1"></a> <span class="fu">svymean</span>(</span>
<span id="cb195-3"><a href="behavioral-risk-factor-surveillance-system-brfss.html#cb195-3" tabindex="-1"></a> <span class="sc">~</span> no_doc_visit_due_to_cost ,</span>
Expand All @@ -1252,10 +1252,10 @@ <h2>Replication Example<a href="behavioral-risk-factor-surveillance-system-brfss
<span id="cb195-9"><a href="behavioral-risk-factor-surveillance-system-brfss.html#cb195-9" tabindex="-1"></a> <span class="at">na.rm =</span> <span class="cn">TRUE</span></span>
<span id="cb195-10"><a href="behavioral-risk-factor-surveillance-system-brfss.html#cb195-10" tabindex="-1"></a> )</span>
<span id="cb195-11"><a href="behavioral-risk-factor-surveillance-system-brfss.html#cb195-11" tabindex="-1"></a></span>
<span id="cb195-12"><a href="behavioral-risk-factor-surveillance-system-brfss.html#cb195-12" tabindex="-1"></a><span class="fu">stopifnot</span>( <span class="fu">round</span>( <span class="fu">confint</span>( result )[ <span class="dv">1</span> , <span class="dv">1</span> ] , <span class="dv">3</span> ) <span class="sc">==</span> <span class="fl">0.094</span> )</span>
<span id="cb195-13"><a href="behavioral-risk-factor-surveillance-system-brfss.html#cb195-13" tabindex="-1"></a><span class="fu">stopifnot</span>( <span class="fu">round</span>( <span class="fu">confint</span>( result )[ <span class="dv">1</span> , <span class="dv">2</span> ] , <span class="dv">3</span> ) <span class="sc">==</span> <span class="fl">0.122</span> )</span>
<span id="cb195-14"><a href="behavioral-risk-factor-surveillance-system-brfss.html#cb195-14" tabindex="-1"></a><span class="fu">stopifnot</span>( <span class="fu">round</span>( <span class="fu">confint</span>( result )[ <span class="dv">2</span> , <span class="dv">1</span> ] , <span class="dv">3</span> ) <span class="sc">==</span> <span class="fl">0.878</span> )</span>
<span id="cb195-15"><a href="behavioral-risk-factor-surveillance-system-brfss.html#cb195-15" tabindex="-1"></a><span class="fu">stopifnot</span>( <span class="fu">round</span>( <span class="fu">confint</span>( result )[ <span class="dv">2</span> , <span class="dv">2</span> ] , <span class="dv">3</span> ) <span class="sc">==</span> <span class="fl">0.906</span> )</span></code></pre></div>
<span id="cb195-12"><a href="behavioral-risk-factor-surveillance-system-brfss.html#cb195-12" tabindex="-1"></a><span class="fu">stopifnot</span>( <span class="fu">round</span>( <span class="fu">confint</span>( result )[ <span class="dv">1</span> , <span class="dv">1</span> ] , <span class="dv">3</span> ) <span class="sc">==</span> <span class="fl">0.092</span> )</span>
<span id="cb195-13"><a href="behavioral-risk-factor-surveillance-system-brfss.html#cb195-13" tabindex="-1"></a><span class="fu">stopifnot</span>( <span class="fu">round</span>( <span class="fu">confint</span>( result )[ <span class="dv">1</span> , <span class="dv">2</span> ] , <span class="dv">3</span> ) <span class="sc">==</span> <span class="fl">0.114</span> )</span>
<span id="cb195-14"><a href="behavioral-risk-factor-surveillance-system-brfss.html#cb195-14" tabindex="-1"></a><span class="fu">stopifnot</span>( <span class="fu">round</span>( <span class="fu">confint</span>( result )[ <span class="dv">2</span> , <span class="dv">1</span> ] , <span class="dv">3</span> ) <span class="sc">==</span> <span class="fl">0.886</span> )</span>
<span id="cb195-15"><a href="behavioral-risk-factor-surveillance-system-brfss.html#cb195-15" tabindex="-1"></a><span class="fu">stopifnot</span>( <span class="fu">round</span>( <span class="fu">confint</span>( result )[ <span class="dv">2</span> , <span class="dv">2</span> ] , <span class="dv">3</span> ) <span class="sc">==</span> <span class="fl">0.908</span> )</span></code></pre></div>
<hr />
</div>
<div id="analysis-examples-with-srvyr-4" class="section level2 unnumbered hasAnchor">
Expand Down
2 changes: 1 addition & 1 deletion docs/european-social-survey-ess.html
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ <h1>
<section class="normal" id="section-">
<div id="european-social-survey-ess" class="section level1 unnumbered hasAnchor">
<h1>European Social Survey (ESS)<a href="european-social-survey-ess.html#european-social-survey-ess" class="anchor-section" aria-label="Anchor link to header"></a></h1>
<p><img src='https://img.shields.io/badge/tested%20on%20my%20laptop:-2024 01 10-brightgreen' alt='Local Testing Badge'></p>
<p><img src='https://img.shields.io/badge/tested%20on%20my%20laptop:-2024 01 22-brightgreen' alt='Local Testing Badge'></p>
<p>The barometer of political opinion and behavior across the continent.</p>
<ul>
<li><p>One table per country with one row per sampled respondent.</p></li>
Expand Down
2 changes: 1 addition & 1 deletion docs/search_index.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions metadata/brfss.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ library(haven)

zip_tf <- tempfile()

zip_url <- "https://www.cdc.gov/brfss/annual_data/2021/files/LLCP2021XPT.zip"
zip_url <- "https://www.cdc.gov/brfss/annual_data/2022/files/LLCP2022XPT.zip"

download.file( zip_url , zip_tf , mode = 'wb' )

Expand Down Expand Up @@ -173,7 +173,7 @@ needs_srvyr_block: yes
~~~{replication_example_block}
## Replication Example {-}

This example matches Alaska's confidence intervals from the [BRFSS Prevalence & Trends Data](https://nccd.cdc.gov/BRFSSPrevalence/rdPage.aspx?rdReport=DPH_BRFSS.ExploreByTopic&irbLocationType=StatesAndMMSA&islClass=CLASS07&islTopic=TOPIC28&islYear=2021&rdRnd=24558):
This example matches Alaska's confidence intervals from the [BRFSS Prevalence & Trends Data](https://nccd.cdc.gov/BRFSSPrevalence/rdPage.aspx?rdReport=DPH_BRFSS.ExploreByTopic&irbLocationType=StatesAndMMSA&islClass=CLASS07&islTopic=TOPIC28&islYear=2022&rdRnd=24558):


```{r eval = FALSE , results = "hide" }
Expand All @@ -189,10 +189,10 @@ result <-
na.rm = TRUE
)

stopifnot( round( confint( result )[ 1 , 1 ] , 3 ) == 0.094 )
stopifnot( round( confint( result )[ 1 , 2 ] , 3 ) == 0.122 )
stopifnot( round( confint( result )[ 2 , 1 ] , 3 ) == 0.878 )
stopifnot( round( confint( result )[ 2 , 2 ] , 3 ) == 0.906 )
stopifnot( round( confint( result )[ 1 , 1 ] , 3 ) == 0.092 )
stopifnot( round( confint( result )[ 1 , 2 ] , 3 ) == 0.114 )
stopifnot( round( confint( result )[ 2 , 1 ] , 3 ) == 0.886 )
stopifnot( round( confint( result )[ 2 , 2 ] , 3 ) == 0.908 )

```

Expand Down
2 changes: 1 addition & 1 deletion vignetterator/generate.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
commit_memo <- "'fixes https://github.com/ajdamico/asdfree/issues/403'"
commit_memo <- "'brfss 2022'"

# source( file.path( path.expand( "~" ) , "Github/asdfree/vignetterator/generate.R" ) )

Expand Down

0 comments on commit 3c6ee66

Please sign in to comment.