Pew Research – Health Care Data

In a my previous Pew Data post, we started to break down how to identify variables of a large, 197 variable 2,008 person response, data set.  Toward the end of the post we had broken the data set into a state-by-state breakdown.

I would like to explore more of the approval ratings by state and would like to generate some new variables in the process. Specifically, I would be interested in generating percentages for approval ratings for our departed (from office) President Obama (miss you already!).

> Frequency_Approval = table($q1)
> Percentage_Approval = table($q1)/(2008*0.01)
> cbind(Frequency_Approval,Percentage_Approval)


As you can see, we identified the categorical variable of frequency with it’s three levels (Approve, Disapprove, Don’t know/Refused), and created a percentage distribution based on those three levels. the cbind function was used to tie those newly created variables together in one table.


About dwmaasberg

Memories are physical connections between neurons. I think that is pretty cool!
This entry was posted in Pew Research, R. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s