A few years ago, I wrote about how to <a href="http://blog.ryanwalker.us/2014/06/analyzing-2011-2012-california-health.html">analyze the 2012 California Health Interview Survey in R</a>. In 2012, plans for <a href="https://en.wikipedia.org/wiki/Covered_California">Covered California</a> (Obamacare in California) were just beginning to take shape. Today, Covered California is a relatively mature program and it is arguably the most successful implementation of the Affordable Care Act in the United States. This month, <a href="http://healthpolicy.ucla.edu/Pages/home.aspx">UCLA's Center for Health Policy</a> released the <a href="http://healthpolicy.ucla.edu/newsroom/press-releases/pages/details.aspx?NewsID=261">2015 California Health Interview Survey</a> (CHIS for short). With this fantastic new data set, we can measure the impact of Covered California in its second year. In this brief post, I'll review the basics of the working with CHIS data in R by way of a simple example. My hope is to inspire other R users to dive into this unique data set. <br><br><h2>The CHIS Quickstart guide for R</h2>Though CHIS is a complex survey, it's simple to work with CHIS data in R. Here's how to get started: <ul><li> Head over to the <a href="http://healthpolicy.ucla.edu/chis/Pages/default.aspx">CHIS site and create an account</a>.</li><li> Once you've created a free account and accepted a bunch of terms of use agreements, you'll be able to <a href="http://healthpolicy.ucla.edu/chis/data/public-use-data-file/Pages/2015.aspx">download</a> the CHIS public use data files. You'll want to download the Stata .dta versions, as these are the easiest to work with using R's foreign package.</li><li> CHIS data is divided into 3 groups, child, adolescent, and adult. We'll work with the adult data below.</li><li> You'll also want to download the appropriate data dictionary for your data set. The dictionary provides excellent documentation about the hundreds of variables covered by CHIS. If it's your first time working with CHIS, I recommend a quick skim of the entire dictionary to get a sense of the kinds of things covered by the survey. </li> </ul>Once you've downloaded the data, to bring it into R you can use the foreign package: <pre><br># Read CHIS file<br>library(foreign)<br>file CHIS   </pre> <br> The most important thing to understand about CHIS data is how to use the replicate weights RAKEDW0-RAKED80. I covered the use of replicate weights in detail in this <a href="http://blog.ryanwalker.us/2014/06/analyzing-2011-2012-california-health.html">post</a>. The important points about replicate weights in CHIS are: <ul><li>Use RAKEDW0 for estimating means and counts in CHIS. RAKEDW0 is designed so that it's sum across all rows in the CHIS data is equal to the total non-institutionalized adult population of California.</li><li>Use RAKEDW1-RAKED80 for estimating variances as described <a href="http://blog.ryanwalker.us/2014/06/analyzing-2011-2012-california-health.html">here</a>. </li></ul> As an example, let's start by getting counts of health insurance coverage by type. For this we have two insurance type variable INSTYPE and the new INS9TP which gives a more detailed breakdown of insurance types. <pre><br># tabulate the data<br>print(as.data.frame(xtabs(rakedw0~instype, CHIS, drop.unused.levels = TRUE)))<br>#              instype       Freq<br># 1           UNINSURED  2910380.5<br># 2 MEDICARE &amp; MEDICAID  1561496.7<br># 3   MEDICARE &amp; OTHERS  1646743.6<br># 4       MEDICARE ONLY  2129841.7<br># 5            MEDICAID  6239539.9<br># 6    EMPLOYMENT-BASED 12193686.7<br># 7 PRIVATELY PURCHASED  1985807.9<br># 8        OTHER PUBLIC   415154.8  <br></pre> <br> One interesting health behavior that CHIS tracks is fast food consumption. To create the variable AC31, CHIS asked respondents about the number of times they ate fast food in the past week. This simple script explores how fast food consumption behavior interacts with health insurance coverage type:<br><br><div><a href="https://1.bp.blogspot.com/--3Uu1NXiieE/WGK0611DkVI/AAAAAAAAAZU/fAMzltWZUGwscPQsB5OUPQ7IixQx8PK2wCLcB/s1600/chis2015demo.png"></a></div><br><br> Already with this superficial analysis we can see some interesting things. First we notice that the uninsured are eating fast food more often than the non-Medicaid insured. The uninsured's fast food behavior looks quite similar to the Medicaid population while the fast food behaviour of the employment-based insured resembles the behaviour of the private purchase group. And most importantly, everyone is eating too much fast food.<br><br><h2>Conclusion</h2>I hope this simple example inspires you to investigate CHIS data on your own. I think it would be especially interesting to see some further analysis of the nearly 3 million Californians who remain uninsured despite the relative success of Covered California. Some interesting background research on this topic can be found <a href="http://laborcenter.berkeley.edu/pdf/2012/aca_uninsured12.pdf">here</a> and <a href="http://healthpolicy.ucla.edu/publications/search/pages/detail.aspx?PubID=1593">here</a>. Feel free to get in touch if you are working with CHIS data to improve public health in California.<br>